MFEM  v3.0
 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.googlecode.com.
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 {{0, 1}, {1, 2}, {3, 2}, {0, 3},
20  {4, 5}, {5, 6}, {7, 6}, {4, 7},
21  {0, 4}, {1, 5}, {2, 6}, {3, 7}};
22 
23 // same as Mesh::hex_faces
24 const int Hexahedron::faces[6][4] =
25 {{3, 2, 1, 0}, {0, 1, 5, 4},
26  {1, 2, 6, 5}, {2, 3, 7, 6},
27  {3, 0, 4, 7}, {4, 5, 6, 7}};
28 
29 
30 Hexahedron::Hexahedron(const int *ind, int attr)
31  : Element(Geometry::CUBE)
32 {
33  attribute = attr;
34  for (int i = 0; i < 8; i++)
35  indices[i] = ind[i];
36 }
37 
38 Hexahedron::Hexahedron(int ind1, int ind2, int ind3, int ind4,
39  int ind5, int ind6, int ind7, int ind8,
40  int attr) : Element(Geometry::CUBE)
41 {
42  attribute = attr;
43  indices[0] = ind1;
44  indices[1] = ind2;
45  indices[2] = ind3;
46  indices[3] = ind4;
47  indices[4] = ind5;
48  indices[5] = ind6;
49  indices[6] = ind7;
50  indices[7] = ind8;
51 }
52 
54 {
55  v.SetSize(8);
56  for (int i = 0; i < 8; i++)
57  v[i] = indices[i];
58 }
59 
61 
62 }
TriLinear3DFiniteElement HexahedronFE
Definition: hexahedron.cpp:60
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:681
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
Definition: array.hpp:293
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