libMesh
cell_prism.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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_PRISM_H
21 #define LIBMESH_CELL_PRISM_H
22 
23 // Local includes
24 #include "libmesh/cell.h"
25 
26 namespace libMesh
27 {
28 
36 class Prism : public Cell
37 {
38 public:
39 
44  Prism(const unsigned int nn, Elem * p, Node ** nodelinkdata) :
45  Cell(nn, Prism::n_sides(), p, _elemlinks_data, nodelinkdata)
46  {
47  // Make sure the interior parent isn't undefined
48  if (LIBMESH_DIM > 3)
50  }
51 
56  virtual Point master_point (const unsigned int i) const libmesh_override
57  {
58  libmesh_assert_less(i, this->n_nodes());
59  return Point(_master_points[i][0],
60  _master_points[i][1],
61  _master_points[i][2]);
62  }
63 
68  virtual unsigned int n_nodes() const libmesh_override { return 6; }
69 
73  virtual unsigned int n_sides() const libmesh_override { return 5; }
74 
78  virtual unsigned int n_vertices() const libmesh_override { return 6; }
79 
83  virtual unsigned int n_edges() const libmesh_override { return 9; }
84 
88  virtual unsigned int n_faces() const libmesh_override { return 5; }
89 
93  virtual unsigned int n_children() const libmesh_override { return 8; }
94 
98  virtual bool is_child_on_side(const unsigned int c,
99  const unsigned int s) const libmesh_override;
100 
104  virtual bool is_edge_on_side(const unsigned int e,
105  const unsigned int s) const libmesh_override;
106 
110  using Elem::key;
111 
117  virtual dof_id_type key (const unsigned int s) const libmesh_override;
118 
122  virtual unsigned int which_node_am_i(unsigned int side,
123  unsigned int side_node) const libmesh_override;
124 
129  virtual UniquePtr<Elem> side_ptr (const unsigned int i) libmesh_override;
130 
131 
132 protected:
133 
137  Elem * _elemlinks_data[6+(LIBMESH_DIM>3)];
138 
145  static const unsigned short int _second_order_adjacent_vertices[9][2];
146 
150  static const unsigned short int _second_order_vertex_child_number[18];
151 
155  static const unsigned short int _second_order_vertex_child_index[18];
156 
160  static const Real _master_points[18][3];
161 };
162 
163 } // namespace libMesh
164 
165 #endif // LIBMESH_CELL_PRISM_H
Prism(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default prismatic element, takes number of nodes and parent.
Definition: cell_prism.h:44
Elem * _elemlinks_data[6+(LIBMESH_DIM >3)]
Data for links to parent/neighbor/interior_parent elements.
Definition: cell_prism.h:137
A Node is like a Point, but with more information.
Definition: node.h:52
virtual Point master_point(const unsigned int i) const libmesh_override
Definition: cell_prism.h:56
virtual unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const libmesh_override
Definition: cell_prism.C:93
virtual UniquePtr< Elem > side_ptr(const unsigned int i) libmesh_override
Definition: cell_prism.C:109
UniquePtr< Elem > side(const unsigned int i) const
Definition: elem.h:2105
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
const class libmesh_nullptr_t libmesh_nullptr
The libMesh namespace provides an interface to certain functionality in the library.
void set_interior_parent(Elem *p)
Sets the pointer to the element&#39;s interior_parent.
Definition: elem.C:1003
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
static const unsigned short int _second_order_adjacent_vertices[9][2]
Matrix that tells which vertices define the location of mid-side (or second-order) nodes...
Definition: cell_prism.h:145
static const Real _master_points[18][3]
Master element node locations.
Definition: cell_prism.h:160
virtual dof_id_type key() const
Definition: elem.C:503
virtual unsigned int n_vertices() const libmesh_override
Definition: cell_prism.h:78
static const unsigned short int _second_order_vertex_child_index[18]
Vector that names the child vertex index for each second order node.
Definition: cell_prism.h:155
The Cell is an abstract element type that lives in three dimensions.
Definition: cell.h:38
virtual unsigned int n_children() const libmesh_override
Definition: cell_prism.h:93
The Prism is an element in 3D with 5 sides.
Definition: cell_prism.h:36
static const unsigned short int _second_order_vertex_child_number[18]
Vector that names a child sharing each second order node.
Definition: cell_prism.h:150
virtual unsigned int n_nodes() const libmesh_override
Definition: cell_prism.h:68
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const libmesh_override
Definition: cell_prism.C:144
virtual unsigned int n_sides() const libmesh_override
Definition: cell_prism.h:73
virtual unsigned int n_edges() const libmesh_override
Definition: cell_prism.h:83
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
virtual unsigned int n_faces() const libmesh_override
Definition: cell_prism.h:88
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const libmesh_override
Definition: cell_prism.C:158
uint8_t dof_id_type
Definition: id_types.h:64