libMesh
node_elem.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_NODE_ELEM_H
21 #define LIBMESH_NODE_ELEM_H
22 
23 // Local includes
24 #include "libmesh/elem.h"
25 
26 namespace libMesh
27 {
28 
37 class NodeElem : public Elem
38 {
39 public:
40 
44  explicit
48  {
49  // Make sure the interior parent isn't undefined
50  if (LIBMESH_DIM > 0)
52  }
53 
58  virtual Point master_point (const unsigned int libmesh_dbg_var(i)) const libmesh_override
59  {
60  libmesh_assert_equal_to (i, 0);
61  return Point(0,0,0);
62  }
63 
67  virtual unsigned int dim () const libmesh_override { return 0; }
68 
72  virtual unsigned int n_nodes() const libmesh_override { return 1; }
73 
77  virtual unsigned int n_sides() const libmesh_override { return 0; }
78 
82  virtual unsigned int n_vertices() const libmesh_override { return 1; }
83 
87  virtual unsigned int n_edges() const libmesh_override { return 0; }
88 
92  virtual unsigned int n_faces() const libmesh_override { return 0; }
93 
97  virtual unsigned int n_children() const libmesh_override { return 1; }
98 
102  using Elem::key;
103 
108  virtual dof_id_type key (const unsigned int) const libmesh_override
109  { libmesh_error_msg("Calling NodeElem::key(side) does not make sense."); return 0; }
110 
114  virtual unsigned int which_node_am_i(unsigned int /*side*/,
115  unsigned int /*side_node*/) const libmesh_override
116  { libmesh_error_msg("Calling NodeElem::which_node_am_i() does not make sense."); return 0; }
117 
121  virtual UniquePtr<Elem> side_ptr (const unsigned int) libmesh_override
122  { libmesh_not_implemented(); return UniquePtr<Elem>(); }
123 
127  virtual UniquePtr<Elem> build_side_ptr (const unsigned int, bool) libmesh_override
128  { libmesh_not_implemented(); return UniquePtr<Elem>(); }
129 
133  virtual UniquePtr<Elem> build_edge_ptr (const unsigned int) libmesh_override
134  { libmesh_not_implemented(); return UniquePtr<Elem>(); }
135 
139  virtual unsigned int n_sub_elem() const libmesh_override { return 1; }
140 
144  virtual bool is_vertex(const unsigned int) const libmesh_override { return true; }
145 
149  virtual bool is_edge(const unsigned int) const libmesh_override { return false; }
150  virtual bool is_face(const unsigned int) const libmesh_override { return false; }
151 
152  virtual bool is_child_on_side(const unsigned int,
153  const unsigned int) const libmesh_override
154  { libmesh_not_implemented(); return false; }
155 
156  virtual bool is_node_on_side(const unsigned int,
157  const unsigned int) const libmesh_override
158  { libmesh_not_implemented(); return false; }
159 
160  virtual bool is_node_on_edge(const unsigned int,
161  const unsigned int) const libmesh_override
162  { libmesh_not_implemented(); return false; }
163 
164  virtual bool is_edge_on_side(const unsigned int,
165  const unsigned int) const libmesh_override
166  { libmesh_not_implemented(); return false; }
167 
172  virtual bool has_affine_map () const libmesh_override { return true; }
173 
178  virtual bool is_linear () const libmesh_override { return true; }
179 
183  virtual ElemType type() const libmesh_override { return NODEELEM; }
184 
188  virtual Order default_order() const libmesh_override { return FIRST; }
189 
190  virtual void connectivity(const unsigned int sc,
191  const IOPackage iop,
192  std::vector<dof_id_type> & conn) const libmesh_override;
193 
194 
195 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
196 
200  virtual bool infinite () const libmesh_override { return false; }
201 
202 #endif
203 
204 
205 protected:
206 
210  Elem * _elemlinks_data[1+(LIBMESH_DIM>0)];
211 
216 
217 
218 #ifdef LIBMESH_ENABLE_AMR
219 
223  virtual float embedding_matrix (const unsigned int i,
224  const unsigned int j,
225  const unsigned int k) const libmesh_override
226  { return _embedding_matrix[i][j][k]; }
227 
232  static const float _embedding_matrix[1][1][1];
233 
237  unsigned int side_children_matrix (const unsigned int,
238  const unsigned int) const
239  { libmesh_not_implemented(); return 0; }
240 
242 
243 #endif // LIBMESH_ENABLE_AMR
244 
245 };
246 
247 } // namespace libMesh
248 
249 #endif // LIBMESH_NODE_ELEM_H
A Node is like a Point, but with more information.
Definition: node.h:52
virtual Point master_point(const unsigned int libmesh_dbg_var(i)) const libmesh_override
Definition: node_elem.h:58
virtual bool has_affine_map() const libmesh_override
Definition: node_elem.h:172
NodeElem(Elem *p=libmesh_nullptr)
Constructor.
Definition: node_elem.h:45
virtual unsigned int n_children() const libmesh_override
Definition: node_elem.h:97
virtual bool is_edge_on_side(const unsigned int, const unsigned int) const libmesh_override
Definition: node_elem.h:164
ElemType
Defines an enum for geometric element types.
virtual unsigned int n_nodes() const libmesh_override
Definition: node_elem.h:72
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
virtual dof_id_type key(const unsigned int) const libmesh_override
Definition: node_elem.h:108
const class libmesh_nullptr_t libmesh_nullptr
virtual unsigned int n_vertices() const libmesh_override
Definition: node_elem.h:82
virtual bool is_edge(const unsigned int) const libmesh_override
NodeElem objects don&#39;t have faces or sides.
Definition: node_elem.h:149
The libMesh namespace provides an interface to certain functionality in the library.
virtual bool is_child_on_side(const unsigned int, const unsigned int) const libmesh_override
Definition: node_elem.h:152
void set_interior_parent(Elem *p)
Sets the pointer to the element&#39;s interior_parent.
Definition: elem.C:1003
virtual bool infinite() const libmesh_override
Definition: node_elem.h:200
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const libmesh_override
Definition: node_elem.C:32
virtual UniquePtr< Elem > build_side_ptr(const unsigned int, bool) libmesh_override
The Elem::build_side_ptr() member makes no sense for nodes.
Definition: node_elem.h:127
virtual Order default_order() const libmesh_override
Definition: node_elem.h:188
virtual float embedding_matrix(const unsigned int i, const unsigned int j, const unsigned int k) const libmesh_override
Matrix used to create the elements children.
Definition: node_elem.h:223
virtual dof_id_type key() const
Definition: elem.C:503
virtual bool is_node_on_edge(const unsigned int, const unsigned int) const libmesh_override
Definition: node_elem.h:160
virtual UniquePtr< Elem > build_edge_ptr(const unsigned int) libmesh_override
The Elem::build_edge_ptr() member makes no sense for nodes.
Definition: node_elem.h:133
virtual bool is_face(const unsigned int) const libmesh_override
Definition: node_elem.h:150
PetscErrorCode Vec Mat libmesh_dbg_var(j)
virtual bool is_vertex(const unsigned int) const libmesh_override
Definition: node_elem.h:144
Node * _nodelinks_data[1]
Data for links to nodes.
Definition: node_elem.h:215
virtual unsigned int which_node_am_i(unsigned int, unsigned int) const libmesh_override
NodeElems don&#39;t have sides, so they can&#39;t have nodes on sides.
Definition: node_elem.h:114
unsigned int side_children_matrix(const unsigned int, const unsigned int) const
Matrix that allows children to inherit boundary conditions.
Definition: node_elem.h:237
The NodeElem is a point element, generally used as a side of a 1D element.
Definition: node_elem.h:37
virtual ElemType type() const libmesh_override
Definition: node_elem.h:183
virtual bool is_linear() const libmesh_override
Definition: node_elem.h:178
static const float _embedding_matrix[1][1][1]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition: node_elem.h:232
virtual UniquePtr< Elem > side_ptr(const unsigned int) libmesh_override
The Elem::side() member makes no sense for nodes.
Definition: node_elem.h:121
virtual unsigned int n_sides() const libmesh_override
Definition: node_elem.h:77
Order
defines an enum for polynomial orders.
Definition: enum_order.h:32
virtual unsigned int n_faces() const libmesh_override
Definition: node_elem.h:92
Elem * _elemlinks_data[1+(LIBMESH_DIM >0)]
Data for links to parent/neighbor/interior_parent elements.
Definition: node_elem.h:210
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
virtual unsigned int n_edges() const libmesh_override
Definition: node_elem.h:87
virtual unsigned int n_sub_elem() const libmesh_override
Definition: node_elem.h:139
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
virtual unsigned int dim() const libmesh_override
Definition: node_elem.h:67
uint8_t dof_id_type
Definition: id_types.h:64
virtual bool is_node_on_side(const unsigned int, const unsigned int) const libmesh_override
Definition: node_elem.h:156