$extrastylesheet
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_HEX_H 00021 #define LIBMESH_CELL_HEX_H 00022 00023 // Local includes 00024 #include "libmesh/cell.h" 00025 00026 namespace libMesh 00027 { 00028 00029 00030 00031 00035 class Hex : public Cell 00036 { 00037 public: 00038 00043 Hex(const unsigned int nn, Elem* p, Node** nodelinkdata); 00044 00048 unsigned int n_sides() const { return 6; } 00049 00053 unsigned int n_vertices() const { return 8; } 00054 00058 unsigned int n_edges() const { return 12; } 00059 00063 unsigned int n_faces() const { return 6; } 00064 00068 unsigned int n_children() const { return 8; } 00069 00070 /* 00071 * @returns true iff the specified child is on the 00072 * specified side 00073 */ 00074 virtual bool is_child_on_side(const unsigned int c, 00075 const unsigned int s) const; 00076 00077 /* 00078 * @returns true iff the specified edge is on the specified side 00079 */ 00080 virtual bool is_edge_on_side(const unsigned int e, 00081 const unsigned int s) const; 00082 00087 virtual unsigned int opposite_side(const unsigned int s) const; 00088 00094 virtual unsigned int opposite_node(const unsigned int n, 00095 const unsigned int s) const; 00096 00102 dof_id_type key (const unsigned int s) const; 00103 00108 UniquePtr<Elem> side (const unsigned int i) const; 00109 00114 Real quality (const ElemQuality q) const; 00115 00121 std::pair<Real, Real> qual_bounds (const ElemQuality q) const; 00122 00123 00124 00125 protected: 00126 00130 Elem* _elemlinks_data[7+(LIBMESH_DIM>3)]; 00131 00139 static const unsigned short int _second_order_adjacent_vertices[12][2]; 00140 00144 static const unsigned short int _second_order_vertex_child_number[27]; 00145 00149 static const unsigned short int _second_order_vertex_child_index[27]; 00150 }; 00151 00152 00153 00154 // ------------------------------------------------------------ 00155 // Hex class member functions 00156 inline 00157 Hex::Hex(const unsigned int nn, Elem* p, Node** nodelinkdata) : 00158 Cell(nn, Hex::n_sides(), p, _elemlinks_data, nodelinkdata) 00159 { 00160 } 00161 00162 } // namespace libMesh 00163 00164 #endif // LIBMESH_CELL_HEX_H