MFEM  v3.1
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
hexahedron.cpp
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 
13 #include "mesh_headers.hpp"
14 
15 namespace mfem
16 {
17 
18 const int Hexahedron::edges[12][2] =
19 {
20  {0, 1}, {1, 2}, {3, 2}, {0, 3},
21  {4, 5}, {5, 6}, {7, 6}, {4, 7},
22  {0, 4}, {1, 5}, {2, 6}, {3, 7}
23 };
24 
25 // same as Mesh::hex_faces
26 const int Hexahedron::faces[6][4] =
27 {
28  {3, 2, 1, 0}, {0, 1, 5, 4},
29  {1, 2, 6, 5}, {2, 3, 7, 6},
30  {3, 0, 4, 7}, {4, 5, 6, 7}
31 };
32 
33 
34 Hexahedron::Hexahedron(const int *ind, int attr)
35  : Element(Geometry::CUBE)
36 {
37  attribute = attr;
38  for (int i = 0; i < 8; i++)
39  {
40  indices[i] = ind[i];
41  }
42 }
43 
44 Hexahedron::Hexahedron(int ind1, int ind2, int ind3, int ind4,
45  int ind5, int ind6, int ind7, int ind8,
46  int attr) : Element(Geometry::CUBE)
47 {
48  attribute = attr;
49  indices[0] = ind1;
50  indices[1] = ind2;
51  indices[2] = ind3;
52  indices[3] = ind4;
53  indices[4] = ind5;
54  indices[5] = ind6;
55  indices[6] = ind7;
56  indices[7] = ind8;
57 }
58 
60 {
61  v.SetSize(8);
62  for (int i = 0; i < 8; i++)
63  {
64  v[i] = indices[i];
65  }
66 }
67 
69 
70 }
TriLinear3DFiniteElement HexahedronFE
Definition: hexahedron.cpp:68
virtual int * GetVertices()
Definition: hexahedron.hpp:46
int attribute
Element&#39;s attribute (specifying material property, etc).
Definition: element.hpp:32
Class for tri-linear FE on cube.
Definition: fe.hpp:693
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
Definition: array.hpp:323
static const int edges[12][2]
Definition: hexahedron.hpp:28
static const int faces[6][4]
Definition: hexahedron.hpp:29
Abstract data type element.
Definition: element.hpp:27