cell_hex.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_CELL_HEX_H
21 #define LIBMESH_CELL_HEX_H
22 
23 // Local includes
24 #include "libmesh/cell.h"
25 
26 namespace libMesh
27 {
28 
29 
30 
31 
36 // ------------------------------------------------------------
37 // Hex class definition
38 class Hex : public Cell
39 {
40 public:
41 
46  Hex(const unsigned int nn, Elem* p, Node** nodelinkdata);
47 
51  unsigned int n_sides() const { return 6; }
52 
56  unsigned int n_vertices() const { return 8; }
57 
61  unsigned int n_edges() const { return 12; }
62 
66  unsigned int n_faces() const { return 6; }
67 
71  unsigned int n_children() const { return 8; }
72 
73  /*
74  * @returns true iff the specified child is on the
75  * specified side
76  */
77  virtual bool is_child_on_side(const unsigned int c,
78  const unsigned int s) const;
79 
80  /*
81  * @returns true iff the specified edge is on the specified side
82  */
83  virtual bool is_edge_on_side(const unsigned int e,
84  const unsigned int s) const;
85 
90  virtual unsigned int opposite_side(const unsigned int s) const;
91 
97  virtual unsigned int opposite_node(const unsigned int n,
98  const unsigned int s) const;
99 
105  dof_id_type key (const unsigned int s) const;
106 
111  AutoPtr<Elem> side (const unsigned int i) const;
112 
117  Real quality (const ElemQuality q) const;
118 
124  std::pair<Real, Real> qual_bounds (const ElemQuality q) const;
125 
126 
127 
128 protected:
129 
133  Elem* _elemlinks_data[7+(LIBMESH_DIM>3)];
134 
142  static const unsigned short int _second_order_adjacent_vertices[12][2];
143 
147  static const unsigned short int _second_order_vertex_child_number[27];
148 
152  static const unsigned short int _second_order_vertex_child_index[27];
153 };
154 
155 
156 
157 // ------------------------------------------------------------
158 // Hex class member functions
159 inline
160 Hex::Hex(const unsigned int nn, Elem* p, Node** nodelinkdata) :
161  Cell(nn, Hex::n_sides(), p, _elemlinks_data, nodelinkdata)
162 {
163 }
164 
165 } // namespace libMesh
166 
167 #endif // LIBMESH_CELL_HEX_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:04 UTC

Hosted By:
SourceForge.net Logo