MFEM v2.0
hexahedron.cpp
Go to the documentation of this file.
00001 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
00002 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
00003 // reserved. See file COPYRIGHT for details.
00004 //
00005 // This file is part of the MFEM library. For more information and source code
00006 // availability see http://mfem.googlecode.com.
00007 //
00008 // MFEM is free software; you can redistribute it and/or modify it under the
00009 // terms of the GNU Lesser General Public License (as published by the Free
00010 // Software Foundation) version 2.1 dated February 1999.
00011 
00012 
00013 #include "mesh_headers.hpp"
00014 
00015 const int Hexahedron::edges[12][2] =
00016 {{0, 1}, {1, 2}, {3, 2}, {0, 3},
00017  {4, 5}, {5, 6}, {7, 6}, {4, 7},
00018  {0, 4}, {1, 5}, {2, 6}, {3, 7}};
00019 
00020 Hexahedron::Hexahedron(const int *ind, int attr)
00021    : Element(Geometry::CUBE)
00022 {
00023    attribute = attr;
00024    for (int i = 0; i < 8; i++)
00025       indices[i] = ind[i];
00026 }
00027 
00028 Hexahedron::Hexahedron(int ind1, int ind2, int ind3, int ind4,
00029                        int ind5, int ind6, int ind7, int ind8,
00030                        int attr) : Element(Geometry::CUBE)
00031 {
00032    attribute  = attr;
00033    indices[0] = ind1;
00034    indices[1] = ind2;
00035    indices[2] = ind3;
00036    indices[3] = ind4;
00037    indices[4] = ind5;
00038    indices[5] = ind6;
00039    indices[6] = ind7;
00040    indices[7] = ind8;
00041 }
00042 
00043 void Hexahedron::GetVertices(Array<int> &v) const
00044 {
00045    v.SetSize(8);
00046    for (int i = 0; i < 8; i++)
00047       v[i] = indices[i];
00048 }
00049 
00050 TriLinear3DFiniteElement HexahedronFE;
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines