$extrastylesheet
cell_hex8.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 #ifndef LIBMESH_CELL_HEX8_H
00021 #define LIBMESH_CELL_HEX8_H
00022 
00023 // Local includes
00024 #include "libmesh/cell_hex.h"
00025 
00026 // C++ includes
00027 #include <cstddef>
00028 
00029 namespace libMesh
00030 {
00031 
00032 
00033 
00034 
00054 class Hex8 : public Hex
00055 {
00056 public:
00057 
00061   explicit
00062   Hex8  (Elem* p=NULL);
00063 
00067   ElemType type () const { return HEX8; }
00068 
00072   unsigned int n_nodes() const { return 8; }
00073 
00077   unsigned int n_sub_elem() const { return 1; }
00078 
00082   virtual bool is_vertex(const unsigned int i) const;
00083 
00087   virtual bool is_edge(const unsigned int i) const;
00088 
00092   virtual bool is_face(const unsigned int i) const;
00093 
00094   /*
00095    * @returns true iff the specified (local) node number is on the
00096    * specified side
00097    */
00098   virtual bool is_node_on_side(const unsigned int n,
00099                                const unsigned int s) const;
00100 
00101   /*
00102    * @returns true iff the specified (local) node number is on the
00103    * specified edge
00104    */
00105   virtual bool is_node_on_edge(const unsigned int n,
00106                                const unsigned int e) const;
00107 
00108   /*
00109    * @returns true iff the element map is definitely affine within
00110    * numerical tolerances
00111    */
00112   virtual bool has_affine_map () const;
00113 
00117   Order default_order() const { return FIRST; }
00118 
00123   UniquePtr<Elem> build_side (const unsigned int i,
00124                               bool proxy) const;
00125 
00130   UniquePtr<Elem> build_edge (const unsigned int i) const;
00131 
00132   virtual void connectivity(const unsigned int sc,
00133                             const IOPackage iop,
00134                             std::vector<dof_id_type>& conn) const;
00135 
00140   static const unsigned int side_nodes_map[6][4];
00141 
00146   static const unsigned int edge_nodes_map[12][2];
00147 
00152   virtual Real volume () const;
00153 
00154 
00155 protected:
00156 
00160   Node* _nodelinks_data[8];
00161 
00162 
00163 
00164 #ifdef LIBMESH_ENABLE_AMR
00165 
00169   float embedding_matrix (const unsigned int i,
00170                           const unsigned int j,
00171                           const unsigned int k) const
00172   { return _embedding_matrix[i][j][k]; }
00173 
00178   static const float _embedding_matrix[8][8][8];
00179 
00180 #endif
00181 
00182 };
00183 
00184 
00185 
00186 // ------------------------------------------------------------
00187 // Hex8 class member functions
00188 inline
00189 Hex8::Hex8(Elem* p) :
00190   Hex(Hex8::n_nodes(), p, _nodelinks_data)
00191 {
00192 }
00193 
00194 
00195 } // namespace libMesh
00196 
00197 #endif // LIBMESH_CELL_HEX8_H