MFEM  v3.1
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  static const int edges[6][2];
27 
37 
38 public:
39 
41  enum { TYPE_PU=0, TYPE_A=1, TYPE_PF=2, TYPE_O=3, TYPE_M=4 };
42 
44 
46  Tetrahedron(const int *ind, int attr = 1);
47 
49  Tetrahedron(int ind1, int ind2, int ind3, int ind4, int attr = 1);
50 
51  void ParseRefinementFlag(int refinement_edges[2], int &type, int &flag);
52  void CreateRefinementFlag(int refinement_edges[2], int type, int flag = 0);
53 
54  virtual int GetRefinementFlag() { return refinement_flag; }
55 
56  void SetRefinementFlag(int rf) { refinement_flag = rf; }
57 
59  virtual int NeedRefinement(DSTable &v_to_v, int *middle) const;
60 
62  virtual void SetVertices(const int *ind);
63 
65  virtual void MarkEdge(DenseMatrix &pmat) { }
66 
70  virtual void MarkEdge(const DSTable &v_to_v, const int *length);
71 
73  virtual int GetType() const { return Element::TETRAHEDRON; }
74 
76  virtual void GetVertices(Array<int> &v) const;
77 
78  virtual int *GetVertices() { return indices; }
79 
80  virtual int GetNVertices() const { return 4; }
81 
82  virtual int GetNEdges() const { return (6); }
83 
84  virtual const int *GetEdgeVertices(int ei) const { return (edges[ei]); }
85 
86  virtual int GetNFaces(int &nFaceVertices) const
87  { nFaceVertices = 3; return 4; }
88 
89  virtual const int *GetFaceVertices(int fi) const
90  { MFEM_ABORT("not implemented"); return NULL; }
91 
92  virtual Element *Duplicate(Mesh *m) const;
93 
94  virtual ~Tetrahedron() { }
95 };
96 
97 extern Linear3DFiniteElement TetrahedronFE;
98 
99 }
100 
101 #endif
virtual int GetNFaces(int &nFaceVertices) const
Definition: tetrahedron.hpp:86
virtual int GetNEdges() const
Definition: tetrahedron.hpp:82
virtual int GetType() const
Return element&#39;s type.
Definition: tetrahedron.hpp:73
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()
Definition: tetrahedron.hpp:94
static const int edges[6][2]
Definition: tetrahedron.hpp:26
virtual Element * Duplicate(Mesh *m) const
void CreateRefinementFlag(int refinement_edges[2], int type, int flag=0)
Definition: tetrahedron.cpp:40
Data type tetrahedron element.
Definition: tetrahedron.hpp:22
virtual const int * GetFaceVertices(int fi) const
Definition: tetrahedron.hpp:89
virtual void MarkEdge(DenseMatrix &pmat)
Mark the longest edge by assuming/changing the order of the vertices.
Definition: tetrahedron.hpp:65
Linear3DFiniteElement TetrahedronFE
virtual int * GetVertices()
Definition: tetrahedron.hpp:78
virtual const int * GetEdgeVertices(int ei) const
Definition: tetrahedron.hpp:84
virtual int NeedRefinement(DSTable &v_to_v, int *middle) const
Return 1 if the element needs refinement in order to get conforming mesh.
virtual int GetNVertices() const
Definition: tetrahedron.hpp:80
void SetRefinementFlag(int rf)
Definition: tetrahedron.hpp:56
void ParseRefinementFlag(int refinement_edges[2], int &type, int &flag)
Definition: tetrahedron.cpp:22
virtual int GetRefinementFlag()
Definition: tetrahedron.hpp:54
Abstract data type element.
Definition: element.hpp:27