MFEM  v3.2
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
tetrahedron.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_TETRAHEDRON
13 #define MFEM_TETRAHEDRON
14 
15 #include "../config/config.hpp"
16 #include "element.hpp"
17 
18 namespace mfem
19 {
20 
22 class Tetrahedron : public Element
23 {
24 protected:
25  int indices[4];
26 
36 
37  unsigned transform;
38 
39 public:
41 
43  enum { TYPE_PU=0, TYPE_A=1, TYPE_PF=2, TYPE_O=3, TYPE_M=4 };
44 
46  { refinement_flag = 0; transform = 0; }
47 
49  Tetrahedron(const int *ind, int attr = 1);
50 
52  Tetrahedron(int ind1, int ind2, int ind3, int ind4, int attr = 1);
53 
55  virtual int GetType() const { return Element::TETRAHEDRON; }
56 
57  void ParseRefinementFlag(int refinement_edges[2], int &type, int &flag);
58  void CreateRefinementFlag(int refinement_edges[2], int type, int flag = 0);
59 
60  virtual int GetRefinementFlag() { return refinement_flag; }
61 
62  void SetRefinementFlag(int rf) { refinement_flag = rf; }
63 
65  virtual int NeedRefinement(DSTable &v_to_v, int *middle) const;
66 
68  virtual void SetVertices(const int *ind);
69 
71  virtual void MarkEdge(DenseMatrix &pmat) { }
72 
76  virtual void MarkEdge(const DSTable &v_to_v, const int *length);
77 
78  virtual void ResetTransform(int tr) { transform = tr; }
79  virtual unsigned GetTransform() const { return transform; }
80 
82  virtual void PushTransform(int tr)
83  { transform = (transform << 3) | (tr + 1); }
84 
86  static void GetPointMatrix(unsigned transform, DenseMatrix &pm);
87 
89  virtual void GetVertices(Array<int> &v) const;
90 
91  virtual int *GetVertices() { return indices; }
92 
93  virtual int GetNVertices() const { return 4; }
94 
95  virtual int GetNEdges() const { return (6); }
96 
97  virtual const int *GetEdgeVertices(int ei) const
98  { return geom_t::Edges[ei]; }
99 
100  virtual int GetNFaces(int &nFaceVertices) const
101  { nFaceVertices = 3; return 4; }
102 
103  virtual const int *GetFaceVertices(int fi) const
104  { MFEM_ABORT("not implemented"); return NULL; }
105 
106  virtual Element *Duplicate(Mesh *m) const;
107 
108  virtual ~Tetrahedron() { }
109 };
110 
111 extern Linear3DFiniteElement TetrahedronFE;
112 
113 }
114 
115 #endif
virtual int GetNFaces(int &nFaceVertices) const
virtual int GetNEdges() const
Definition: tetrahedron.hpp:95
virtual int GetType() const
Return element&#39;s type.
Definition: tetrahedron.hpp:55
Data type dense matrix using column-major storage.
Definition: densemat.hpp:22
virtual void SetVertices(const int *ind)
Set the vertices according to the given input.
virtual ~Tetrahedron()
virtual Element * Duplicate(Mesh *m) const
void CreateRefinementFlag(int refinement_edges[2], int type, int flag=0)
Definition: tetrahedron.cpp:59
virtual void ResetTransform(int tr)
Set current coarse-fine transformation number.
Definition: tetrahedron.hpp:78
static const int Edges[NumEdges][2]
Definition: geom.hpp:153
Geometry::Constants< Geometry::TETRAHEDRON > geom_t
Definition: tetrahedron.hpp:40
Data type tetrahedron element.
Definition: tetrahedron.hpp:22
virtual const int * GetFaceVertices(int fi) const
virtual unsigned GetTransform() const
Return current coarse-fine transformation.
Definition: tetrahedron.hpp:79
virtual void PushTransform(int tr)
Add &#39;tr&#39; to the current chain of coarse-fine transformations.
Definition: tetrahedron.hpp:82
virtual void MarkEdge(DenseMatrix &pmat)
Mark the longest edge by assuming/changing the order of the vertices.
Definition: tetrahedron.hpp:71
Linear3DFiniteElement TetrahedronFE
virtual int * GetVertices()
Definition: tetrahedron.hpp:91
virtual const int * GetEdgeVertices(int ei) const
Definition: tetrahedron.hpp:97
virtual int NeedRefinement(DSTable &v_to_v, int *middle) const
Return 1 if the element needs refinement in order to get conforming mesh.
static void GetPointMatrix(unsigned transform, DenseMatrix &pm)
Calculate point matrix corresponding to a chain of transformations.
virtual int GetNVertices() const
Definition: tetrahedron.hpp:93
void SetRefinementFlag(int rf)
Definition: tetrahedron.hpp:62
void ParseRefinementFlag(int refinement_edges[2], int &type, int &flag)
Definition: tetrahedron.cpp:43
virtual int GetRefinementFlag()
Definition: tetrahedron.hpp:60
Abstract data type element.
Definition: element.hpp:27