cell_hex27.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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_HEX27_H
21 #define LIBMESH_CELL_HEX27_H
22 
23 // Local includes
24 #include "libmesh/cell_hex.h"
25 
26 namespace libMesh
27 {
28 
68 class Hex27 final : public Hex
69 {
70 public:
71 
75  explicit
76  Hex27 (Elem * p=nullptr) :
78  {}
79 
80  Hex27 (Hex27 &&) = delete;
81  Hex27 (const Hex27 &) = delete;
82  Hex27 & operator= (const Hex27 &) = delete;
83  Hex27 & operator= (Hex27 &&) = delete;
84  virtual ~Hex27() = default;
85 
89  virtual ElemType type () const override { return HEX27; }
90 
94  virtual unsigned int n_nodes() const override { return num_nodes; }
95 
99  virtual unsigned int n_sub_elem() const override { return 8; }
100 
104  virtual bool is_vertex(const unsigned int i) const override;
105 
109  virtual bool is_edge(const unsigned int i) const override;
110 
114  virtual bool is_face(const unsigned int i) const override;
115 
120  virtual bool is_node_on_side(const unsigned int n,
121  const unsigned int s) const override;
122 
123  virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;
124 
129  virtual bool is_node_on_edge(const unsigned int n,
130  const unsigned int e) const override;
131 
136  virtual bool has_affine_map () const override;
137 
141  virtual Order default_order() const override;
142 
146  using Elem::key;
147 
157  virtual dof_id_type key (const unsigned int s) const override;
158 
162  virtual unsigned int which_node_am_i(unsigned int side,
163  unsigned int side_node) const override;
164 
169  virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i,
170  bool proxy) override;
171 
175  virtual void build_side_ptr (std::unique_ptr<Elem> & elem,
176  const unsigned int i) override;
177 
182  virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int i) override;
183 
184  virtual void connectivity(const unsigned int sc,
185  const IOPackage iop,
186  std::vector<dof_id_type> & conn) const override;
187 
192  virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const override;
193 
200  virtual unsigned short int second_order_adjacent_vertex (const unsigned int n,
201  const unsigned int v) const override;
202 
208  virtual std::pair<unsigned short int, unsigned short int>
209  second_order_child_vertex (const unsigned int n) const override;
210 
214  static const int num_nodes = 27;
215  static const int num_sides = 6;
216  static const int num_edges = 12;
217  static const int num_children = 8;
218  static const int nodes_per_side = 9;
219  static const int nodes_per_edge = 3;
220 
225  static const unsigned int side_nodes_map[num_sides][nodes_per_side];
226 
231  static const unsigned int edge_nodes_map[num_edges][nodes_per_edge];
232 
236  virtual Real volume () const override;
237 
238 protected:
239 
240 
245 
246 
247 #ifdef LIBMESH_ENABLE_AMR
248 
252  virtual float embedding_matrix (const unsigned int i,
253  const unsigned int j,
254  const unsigned int k) const override
255  { return _embedding_matrix[i][j][k]; }
256 
262 
264 
265 #endif // LIBMESH_ENABLE_AMR
266 
267 
268 private:
269 
282  static const unsigned short int _remaining_second_order_adjacent_vertices[6][4];
283 
284 };
285 
286 } // namespace libMesh
287 
288 #endif // LIBMESH_CELL_HEX27_H
static const int num_children
Definition: cell_hex27.h:217
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition: cell_hex27.C:271
A geometric point in (x,y,z) space associated with a DOF.
Definition: node.h:52
virtual unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const override
Definition: cell_hex27.C:221
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const override
Definition: cell_hex27.C:654
virtual unsigned int n_nodes() const override
Definition: cell_hex27.h:94
static const int num_sides
Definition: cell_hex27.h:215
virtual bool has_affine_map() const override
Definition: cell_hex27.C:124
virtual Order default_order() const override
Definition: cell_hex27.C:170
virtual dof_id_type key() const
Definition: elem.C:401
static const int num_nodes
Definition: cell_hex27.h:214
The base class for all hexahedral element types.
Definition: cell_hex.h:36
virtual bool is_vertex(const unsigned int i) const override
Definition: cell_hex27.C:72
The base class for all geometric element types.
Definition: elem.h:100
virtual ~Hex27()=default
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
Definition: cell_hex27.C:97
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int) const override
Definition: cell_hex27.C:553
virtual float embedding_matrix(const unsigned int i, const unsigned int j, const unsigned int k) const override
Definition: cell_hex27.h:252
virtual ElemType type() const override
Definition: cell_hex27.h:89
Hex27(Elem *p=nullptr)
Definition: cell_hex27.h:76
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
Definition: cell_hex27.C:113
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge]
Definition: cell_hex27.h:231
static const float _embedding_matrix[num_children][num_nodes][num_nodes]
Definition: cell_hex27.h:261
Hex27 & operator=(const Hex27 &)=delete
virtual Real volume() const override
Definition: cell_hex27.C:670
static const int num_edges
Definition: cell_hex27.h:216
static const int nodes_per_side
Definition: cell_hex27.h:218
static const int nodes_per_edge
Definition: cell_hex27.h:219
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: cell_hex27.h:263
static const unsigned short int _remaining_second_order_adjacent_vertices[6][4]
Definition: cell_hex27.h:282
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
Definition: cell_hex27.C:107
A 3D hexahedral element with 27 nodes.
Definition: cell_hex27.h:68
virtual bool is_face(const unsigned int i) const override
Definition: cell_hex27.C:88
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const override
Definition: cell_hex27.C:589
virtual unsigned int n_sub_elem() const override
Definition: cell_hex27.h:99
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i) override
Definition: cell_hex27.C:262
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
Definition: cell_hex27.h:225
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy) override
Definition: cell_hex27.C:232
virtual bool is_edge(const unsigned int i) const override
Definition: cell_hex27.C:79
Node * _nodelinks_data[num_nodes]
Definition: cell_hex27.h:244
std::unique_ptr< Elem > side(const unsigned int i) const
Definition: elem.h:2202
uint8_t dof_id_type
Definition: id_types.h:64