MFEM  v3.3
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
hexahedron.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_HEXAHEDRON
13 #define MFEM_HEXAHEDRON
14 
15 #include "../config/config.hpp"
16 #include "element.hpp"
17 
18 namespace mfem
19 {
20 
21 /// Data type hexahedron element
22 class Hexahedron : public Element
23 {
24 protected:
25  int indices[8];
26 
27 public:
29 
30  Hexahedron() : Element(Geometry::CUBE) { }
31 
32  /// Constructs hexahedron by specifying the indices and the attribute.
33  Hexahedron(const int *ind, int attr = 1);
34 
35  /// Constructs hexahedron by specifying the indices and the attribute.
36  Hexahedron(int ind1, int ind2, int ind3, int ind4,
37  int ind5, int ind6, int ind7, int ind8, int attr = 1);
38 
39  /// Return element's type
40  int GetType() const { return Element::HEXAHEDRON; }
41 
42  /// Returns the indices of the element's vertices.
43  virtual void GetVertices(Array<int> &v) const;
44 
45  virtual int *GetVertices() { return indices; }
46 
47  virtual int GetNVertices() const { return 8; }
48 
49  virtual int GetNEdges() const { return 12; }
50 
51  virtual const int *GetEdgeVertices(int ei) const
52  { return geom_t::Edges[ei]; }
53 
54  virtual int GetNFaces(int &nFaceVertices) const
55  { nFaceVertices = 4; return 6; }
56 
57  virtual const int *GetFaceVertices(int fi) const
58  { return geom_t::FaceVert[fi]; }
59 
60  virtual Element *Duplicate(Mesh *m) const
61  { return new Hexahedron(indices, attribute); }
62 
63  virtual ~Hexahedron() { }
64 };
65 
66 extern TriLinear3DFiniteElement HexahedronFE;
67 
68 }
69 
70 #endif
virtual int GetNVertices() const
Definition: hexahedron.hpp:47
virtual const int * GetFaceVertices(int fi) const
Definition: hexahedron.hpp:57
virtual Element * Duplicate(Mesh *m) const
Definition: hexahedron.hpp:60
virtual int GetNEdges() const
Definition: hexahedron.hpp:49
virtual ~Hexahedron()
Definition: hexahedron.hpp:63
Data type hexahedron element.
Definition: hexahedron.hpp:22
TriLinear3DFiniteElement HexahedronFE
Definition: hexahedron.cpp:52
int GetType() const
Return element&#39;s type.
Definition: hexahedron.hpp:40
virtual const int * GetEdgeVertices(int ei) const
Definition: hexahedron.hpp:51
Geometry::Constants< Geometry::CUBE > geom_t
Definition: hexahedron.hpp:28
virtual int * GetVertices()
Definition: hexahedron.hpp:45
int attribute
Element&#39;s attribute (specifying material property, etc).
Definition: element.hpp:32
static const int FaceVert[NumFaces][MaxFaceVert]
Definition: geom.hpp:175
static const int Edges[NumEdges][2]
Definition: geom.hpp:171
virtual int GetNFaces(int &nFaceVertices) const
Definition: hexahedron.hpp:54
Abstract data type element.
Definition: element.hpp:27