MFEM v2.0
hexahedron.hpp
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 #ifndef MFEM_HEXAHEDRON
00013 #define MFEM_HEXAHEDRON
00014 
00016 class Hexahedron : public Element
00017 {
00018 protected:
00019    int indices[8];
00020    static const int edges[12][2];
00021 
00022 public:
00023 
00024    Hexahedron() : Element(Geometry::CUBE) { }
00025 
00027    Hexahedron(const int *ind, int attr = 1);
00028 
00030    Hexahedron(int ind1, int ind2, int ind3, int ind4,
00031               int ind5, int ind6, int ind7, int ind8, int attr = 1);
00032 
00034    int GetType() const { return Element::HEXAHEDRON; }
00035 
00037    virtual void GetVertices(Array<int> &v) const;
00038 
00039    virtual int *GetVertices() { return indices; }
00040 
00041    virtual int GetNVertices() const { return 8; }
00042 
00043    virtual int GetNEdges() const { return(12); }
00044 
00045    virtual const int *GetEdgeVertices(int ei) const
00046    { return(edges[ei]); }
00047 
00048    virtual Element *Duplicate(Mesh *m) const
00049    { return new Hexahedron(indices, attribute); }
00050 
00051    virtual ~Hexahedron() { }
00052 };
00053 
00054 extern TriLinear3DFiniteElement HexahedronFE;
00055 
00056 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines