libMesh
node_elem.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 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
45  NodeElem (Elem * p=nullptr) :
48  {
49  // Make sure the interior parent isn't undefined
50  if (LIBMESH_DIM > 0)
51  this->set_interior_parent(nullptr);
52  }
53 
54  NodeElem (NodeElem &&) = delete;
55  NodeElem (const NodeElem &) = delete;
56  NodeElem & operator= (const NodeElem &) = delete;
57  NodeElem & operator= (NodeElem &&) = delete;
58  virtual ~NodeElem() = default;
59 
64  virtual Point master_point (const unsigned int libmesh_dbg_var(i)) const override
65  {
66  libmesh_assert_equal_to (i, 0);
67  return Point(0,0,0);
68  }
69 
73  virtual unsigned short dim () const override { return 0; }
74 
78  virtual unsigned int n_nodes() const override { return 1; }
79 
83  virtual unsigned int n_sides() const override { return 0; }
84 
88  virtual unsigned int n_vertices() const override { return 1; }
89 
93  virtual unsigned int n_edges() const override { return 0; }
94 
98  virtual unsigned int n_faces() const override { return 0; }
99 
103  virtual unsigned int n_children() const override { return 1; }
104 
108  using Elem::key;
109 
114  virtual dof_id_type key (const unsigned int) const override
115  { libmesh_error_msg("Calling NodeElem::key(side) does not make sense."); return 0; }
116 
121  virtual dof_id_type low_order_key (const unsigned int) const override
122  { libmesh_error_msg("Calling NodeElem::low_order_key(side) does not make sense."); return 0; }
123 
127  virtual unsigned int local_side_node(unsigned int /*side*/,
128  unsigned int /*side_node*/) const override
129  { libmesh_error_msg("Calling NodeElem::local_side_node() does not make sense."); return 0; }
130 
134  virtual unsigned int local_edge_node(unsigned int /*edge*/,
135  unsigned int /*edge_node*/) const override
136  { libmesh_error_msg("Calling NodeElem::local_edge_node() does not make sense."); return 0; }
137 
141  virtual std::unique_ptr<Elem> side_ptr (const unsigned int) override
142  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
143 
144  virtual void side_ptr (std::unique_ptr<Elem> &, const unsigned int) override
145  { libmesh_not_implemented(); }
146 
150  virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int, bool) override
151  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
152 
153  virtual void build_side_ptr (std::unique_ptr<Elem> &, const unsigned int) override
154  { libmesh_not_implemented(); }
155 
159  virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int) override
160  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
161 
165  virtual void build_edge_ptr (std::unique_ptr<Elem> &, const unsigned int) override
166  { libmesh_not_implemented(); }
167 
171  virtual unsigned int n_sub_elem() const override { return 1; }
172 
176  virtual bool is_vertex(const unsigned int) const override { return true; }
177 
181  virtual bool is_edge(const unsigned int) const override { return false; }
182  virtual bool is_face(const unsigned int) const override { return false; }
183 
184  virtual bool is_child_on_side(const unsigned int,
185  const unsigned int) const override
186  { libmesh_not_implemented(); return false; }
187 
188  virtual bool is_node_on_side(const unsigned int,
189  const unsigned int) const override
190  { libmesh_not_implemented(); return false; }
191 
192  virtual std::vector<unsigned int> nodes_on_side(const unsigned int) const override
193  {
194  libmesh_not_implemented();
195  return {0};
196  }
197 
198  virtual std::vector<unsigned int> nodes_on_edge(const unsigned int) const override
199  {
200  libmesh_not_implemented();
201  return {0};
202  }
203 
204  virtual std::vector<unsigned int> sides_on_edge(const unsigned int) const override
205  {
206  libmesh_not_implemented();
207  return {0};
208  }
209 
210  virtual bool is_node_on_edge(const unsigned int,
211  const unsigned int) const override
212  { libmesh_not_implemented(); return false; }
213 
214  virtual bool is_edge_on_side(const unsigned int,
215  const unsigned int) const override
216  { libmesh_not_implemented(); return false; }
217 
224  virtual Point quasicircumcenter () const override
225  { return this->point(0); }
226 
231  virtual bool has_affine_map () const override { return true; }
232 
236  virtual bool has_invertible_map(Real /*tol*/) const override { return true; }
237 
242  virtual bool is_linear () const override { return true; }
243 
247  virtual ElemType type() const override { return NODEELEM; }
248 
252  virtual Order default_order() const override;
253 
254  virtual void connectivity(const unsigned int sc,
255  const IOPackage iop,
256  std::vector<dof_id_type> & conn) const override;
257 
258 
259 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
260 
264  virtual bool infinite () const override { return false; }
265 
266 #endif
267 
271  virtual unsigned int n_permutations() const override final { return 0; }
272 
273  virtual void permute(unsigned int) override final { libmesh_error(); }
274 
275  virtual void flip(BoundaryInfo *) override final { libmesh_error(); }
276  virtual bool is_flipped() const override final { return false; }
277 
278  virtual ElemType side_type (const unsigned int) const override
279  {
280  libmesh_not_implemented();
281  return INVALID_ELEM;
282  }
283 
295  virtual bool contains_point(const Point & p, Real tol) const override;
296 
300  virtual bool close_to_point(const Point & p, Real tol) const override;
301 
302 protected:
303 
307  Elem * _elemlinks_data[1+(LIBMESH_DIM>0)];
308 
313 
314 
315 #ifdef LIBMESH_ENABLE_AMR
316 
320  virtual Real embedding_matrix (const unsigned int i,
321  const unsigned int j,
322  const unsigned int k) const override
323  { return _embedding_matrix[i][j][k]; }
324 
329  static const Real _embedding_matrix[1][1][1];
330 
334  unsigned int side_children_matrix (const unsigned int,
335  const unsigned int) const
336  { libmesh_not_implemented(); return 0; }
337 
339 
340 #endif // LIBMESH_ENABLE_AMR
341 
342 };
343 
344 } // namespace libMesh
345 
346 #endif // LIBMESH_NODE_ELEM_H
static const Real _embedding_matrix[1][1][1]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition: node_elem.h:329
virtual unsigned int n_faces() const override
Definition: node_elem.h:98
unsigned int side_children_matrix(const unsigned int, const unsigned int) const
Matrix that allows children to inherit boundary conditions.
Definition: node_elem.h:334
virtual bool close_to_point(const Point &p, Real tol) const override
Definition: node_elem.C:47
ElemType
Defines an enum for geometric element types.
virtual void build_edge_ptr(std::unique_ptr< Elem > &, const unsigned int) override
The Elem::build_edge_ptr() member makes no sense for nodes.
Definition: node_elem.h:165
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
virtual unsigned int n_vertices() const override
Definition: node_elem.h:88
A Node is like a Point, but with more information.
Definition: node.h:52
virtual void side_ptr(std::unique_ptr< Elem > &, const unsigned int) override
Resets the loose element side, which may currently point to a different side than i or even a differe...
Definition: node_elem.h:144
virtual Point master_point(const unsigned int libmesh_dbg_var(i)) const override
Definition: node_elem.h:64
NodeElem & operator=(const NodeElem &)=delete
virtual dof_id_type key() const
Definition: elem.C:563
virtual bool is_node_on_edge(const unsigned int, const unsigned int) const override
Definition: node_elem.h:210
virtual unsigned int local_edge_node(unsigned int, unsigned int) const override
NodeElems don&#39;t have edges, so they can&#39;t have nodes on edges.
Definition: node_elem.h:134
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
virtual void build_side_ptr(std::unique_ptr< Elem > &, const unsigned int) override
Resets the loose element side, which may currently point to a different side than i or even a differe...
Definition: node_elem.h:153
virtual dof_id_type low_order_key(const unsigned int) const override
Definition: node_elem.h:121
virtual bool contains_point(const Point &p, Real tol) const override
Definition: node_elem.C:42
virtual bool is_child_on_side(const unsigned int, const unsigned int) const override
Definition: node_elem.h:184
virtual bool is_edge_on_side(const unsigned int, const unsigned int) const override
Definition: node_elem.h:214
The libMesh namespace provides an interface to certain functionality in the library.
virtual unsigned int n_children() const override
Definition: node_elem.h:103
virtual unsigned int n_sides() const override
Definition: node_elem.h:83
void set_interior_parent(Elem *p)
Sets the pointer to the element&#39;s interior_parent.
Definition: elem.C:1056
virtual bool is_face(const unsigned int) const override
Definition: node_elem.h:182
NodeElem(Elem *p=nullptr)
Constructor.
Definition: node_elem.h:45
virtual bool infinite() const override
Definition: node_elem.h:264
virtual Order default_order() const override
Definition: node_elem.C:28
virtual std::unique_ptr< Elem > side_ptr(const unsigned int) override
The Elem::side_ptr() member makes no sense for nodes.
Definition: node_elem.h:141
virtual bool has_affine_map() const override
Definition: node_elem.h:231
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int) const override
Definition: node_elem.h:198
virtual ElemType side_type(const unsigned int) const override
Definition: node_elem.h:278
virtual std::vector< unsigned int > sides_on_edge(const unsigned int) const override
Definition: node_elem.h:204
virtual bool is_node_on_side(const unsigned int, const unsigned int) const override
Definition: node_elem.h:188
virtual unsigned int n_permutations() const override final
No way to reorient a single node.
Definition: node_elem.h:271
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
Definition: boundary_info.h:57
virtual bool is_flipped() const override final
Definition: node_elem.h:276
virtual unsigned int local_side_node(unsigned int, unsigned int) const override
NodeElems don&#39;t have sides, so they can&#39;t have nodes on sides.
Definition: node_elem.h:127
Node * _nodelinks_data[1]
Data for links to nodes.
Definition: node_elem.h:312
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition: node_elem.C:35
virtual unsigned int n_nodes() const override
Definition: node_elem.h:78
The NodeElem is a point element, generally used as a side of a 1D element.
Definition: node_elem.h:37
virtual Real embedding_matrix(const unsigned int i, const unsigned int j, const unsigned int k) const override
Matrix used to create the elements children.
Definition: node_elem.h:320
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int, bool) override
The Elem::build_side_ptr() member makes no sense for nodes.
Definition: node_elem.h:150
virtual Point quasicircumcenter() const override
Definition: node_elem.h:224
virtual bool is_edge(const unsigned int) const override
NodeElem objects don&#39;t have faces or sides.
Definition: node_elem.h:181
virtual unsigned int n_edges() const override
Definition: node_elem.h:93
virtual unsigned short dim() const override
Definition: node_elem.h:73
virtual dof_id_type key(const unsigned int) const override
Definition: node_elem.h:114
virtual ElemType type() const override
Definition: node_elem.h:247
virtual bool is_linear() const override
Definition: node_elem.h:242
virtual ~NodeElem()=default
Elem * _elemlinks_data[1+(LIBMESH_DIM >0)]
Data for links to parent/neighbor/interior_parent elements.
Definition: node_elem.h:307
virtual void permute(unsigned int) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index...
Definition: node_elem.h:273
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
Definition: node_elem.h:275
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
const Point & point(const unsigned int i) const
Definition: elem.h:2277
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const override
Definition: node_elem.h:192
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int) override
The Elem::build_edge_ptr() member makes no sense for nodes.
Definition: node_elem.h:159
virtual unsigned int n_sub_elem() const override
Definition: node_elem.h:171
uint8_t dof_id_type
Definition: id_types.h:67
virtual bool is_vertex(const unsigned int) const override
Definition: node_elem.h:176
virtual bool has_invertible_map(Real) const override
Definition: node_elem.h:236