MFEM  v3.1
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 
22 class Hexahedron : public Element
23 {
24 protected:
25  int indices[8];
26 
27 public:
28  static const int edges[12][2];
29  static const int faces[6][4]; // same as Mesh::hex_faces
30 
31  Hexahedron() : Element(Geometry::CUBE) { }
32 
34  Hexahedron(const int *ind, int attr = 1);
35 
37  Hexahedron(int ind1, int ind2, int ind3, int ind4,
38  int ind5, int ind6, int ind7, int ind8, int attr = 1);
39 
41  int GetType() const { return Element::HEXAHEDRON; }
42 
44  virtual void GetVertices(Array<int> &v) const;
45 
46  virtual int *GetVertices() { return indices; }
47 
48  virtual int GetNVertices() const { return 8; }
49 
50  virtual int GetNEdges() const { return 12; }
51 
52  virtual const int *GetEdgeVertices(int ei) const
53  { return edges[ei]; }
54 
55  virtual int GetNFaces(int &nFaceVertices) const
56  { nFaceVertices = 4; return 6; }
57 
58  virtual const int *GetFaceVertices(int fi) const
59  { return faces[fi]; }
60 
61  virtual Element *Duplicate(Mesh *m) const
62  { return new Hexahedron(indices, attribute); }
63 
64  virtual ~Hexahedron() { }
65 };
66 
67 extern TriLinear3DFiniteElement HexahedronFE;
68 
69 }
70 
71 #endif
virtual int GetNVertices() const
Definition: hexahedron.hpp:48
virtual const int * GetFaceVertices(int fi) const
Definition: hexahedron.hpp:58
virtual Element * Duplicate(Mesh *m) const
Definition: hexahedron.hpp:61
virtual int GetNEdges() const
Definition: hexahedron.hpp:50
virtual ~Hexahedron()
Definition: hexahedron.hpp:64
Data type hexahedron element.
Definition: hexahedron.hpp:22
TriLinear3DFiniteElement HexahedronFE
Definition: hexahedron.cpp:68
int GetType() const
Return element&#39;s type.
Definition: hexahedron.hpp:41
virtual const int * GetEdgeVertices(int ei) const
Definition: hexahedron.hpp:52
virtual int * GetVertices()
Definition: hexahedron.hpp:46
int attribute
Element&#39;s attribute (specifying material property, etc).
Definition: element.hpp:32
static const int edges[12][2]
Definition: hexahedron.hpp:28
static const int faces[6][4]
Definition: hexahedron.hpp:29
virtual int GetNFaces(int &nFaceVertices) const
Definition: hexahedron.hpp:55
Abstract data type element.
Definition: element.hpp:27