libMesh
cell_pyramid.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_PYRAMID_H
21 #define LIBMESH_CELL_PYRAMID_H
22 
23 // Local includes
24 #include "libmesh/cell.h"
25 
26 namespace libMesh
27 {
28 
29 
30 
31 
39 class Pyramid : public Cell
40 {
41 public:
42 
48  Pyramid(const unsigned int nn, Elem * p, Node ** nodelinkdata) :
49  Cell(nn, Pyramid::n_sides(), p, _elemlinks_data, nodelinkdata)
50  {
51  // Make sure the interior parent isn't undefined
52  if (LIBMESH_DIM > 3)
54  }
55 
60  virtual Point master_point (const unsigned int i) const libmesh_override
61  {
62  libmesh_assert_less(i, this->n_nodes());
63  return Point(_master_points[i][0],
64  _master_points[i][1],
65  _master_points[i][2]);
66  }
67 
72  virtual unsigned int n_nodes() const libmesh_override { return 5; }
73 
77  virtual unsigned int n_sides() const libmesh_override { return 5; }
78 
82  virtual unsigned int n_vertices() const libmesh_override { return 5; }
83 
87  virtual unsigned int n_edges() const libmesh_override { return 8; }
88 
92  virtual unsigned int n_faces() const libmesh_override { return 5; }
93 
97  virtual unsigned int n_children() const libmesh_override { return 10; }
98 
103  virtual bool is_child_on_side(const unsigned int c,
104  const unsigned int s) const libmesh_override;
105 
109  virtual bool is_edge_on_side(const unsigned int e,
110  const unsigned int s) const libmesh_override;
111 
115  using Elem::key;
116 
122  virtual dof_id_type key (const unsigned int s) const libmesh_override;
123 
127  virtual unsigned int which_node_am_i(unsigned int side,
128  unsigned int side_node) const libmesh_override;
129 
134  virtual UniquePtr<Elem> side_ptr (const unsigned int i) libmesh_override;
135 
136 
137 protected:
138 
142  Elem * _elemlinks_data[6+(LIBMESH_DIM>3)];
143 
147  static const Real _master_points[14][3];
148 
149 #ifdef LIBMESH_ENABLE_AMR
150 
154  unsigned int side_children_matrix (const unsigned int,
155  const unsigned int) const
156  { libmesh_not_implemented(); return 0; }
157 
158 #endif
159 
160 };
161 
162 } // namespace libMesh
163 
164 #endif // LIBMESH_CELL_PYRAMID_H
The Pyramid is an element in 3D with 5 sides.
Definition: cell_pyramid.h:39
unsigned int side_children_matrix(const unsigned int, const unsigned int) const
Matrix that allows children to inherit boundary conditions.
Definition: cell_pyramid.h:154
A Node is like a Point, but with more information.
Definition: node.h:52
virtual unsigned int n_faces() const libmesh_override
Definition: cell_pyramid.h:92
UniquePtr< Elem > side(const unsigned int i) const
Definition: elem.h:2105
virtual unsigned int n_sides() const libmesh_override
Definition: cell_pyramid.h:77
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.
virtual UniquePtr< Elem > side_ptr(const unsigned int i) libmesh_override
Definition: cell_pyramid.C:103
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
virtual unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const libmesh_override
Definition: cell_pyramid.C:87
virtual Point master_point(const unsigned int i) const libmesh_override
Definition: cell_pyramid.h:60
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const libmesh_override
Definition: cell_pyramid.C:139
virtual dof_id_type key() const
Definition: elem.C:503
The Cell is an abstract element type that lives in three dimensions.
Definition: cell.h:38
virtual unsigned int n_vertices() const libmesh_override
Definition: cell_pyramid.h:82
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const libmesh_override
Definition: cell_pyramid.C:153
virtual unsigned int n_edges() const libmesh_override
Definition: cell_pyramid.h:87
Elem * _elemlinks_data[6+(LIBMESH_DIM >3)]
Data for links to parent/neighbor/interior_parent elements.
Definition: cell_pyramid.h:142
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Pyramid(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default pyramid, one quad face, four triangular faces, takes number of nodes and parent.
Definition: cell_pyramid.h:48
static const Real _master_points[14][3]
Master element node locations.
Definition: cell_pyramid.h:147
virtual unsigned int n_children() const libmesh_override
Definition: cell_pyramid.h:97
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
uint8_t dof_id_type
Definition: id_types.h:64
virtual unsigned int n_nodes() const libmesh_override
Definition: cell_pyramid.h:72