libMesh
Loading...
Searching...
No Matches
node_elem.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 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
26namespace libMesh
27{
28
37class NodeElem : public Elem
38{
39public:
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;
58 virtual ~NodeElem() = default;
59
63 static const int num_nodes = 1;
64 static const int num_sides = 0;
65
70 virtual Point master_point (const unsigned int libmesh_dbg_var(i)) const override
71 {
72 libmesh_assert_equal_to (i, 0);
73 return Point(0,0,0);
74 }
75
79 virtual unsigned short dim () const override { return 0; }
80
84 virtual unsigned int n_nodes() const override { return 1; }
85
89 virtual unsigned int n_sides() const override { return 0; }
90
94 virtual unsigned int n_vertices() const override { return 1; }
95
99 virtual unsigned int n_edges() const override { return 0; }
100
104 virtual unsigned int n_faces() const override { return 0; }
105
109 virtual unsigned int n_children() const override { return 1; }
110
114 using Elem::key;
115
120 virtual dof_id_type key (const unsigned int) const override
121 { libmesh_error_msg("Calling NodeElem::key(side) does not make sense."); return 0; }
122
127 virtual dof_id_type low_order_key (const unsigned int) const override
128 { libmesh_error_msg("Calling NodeElem::low_order_key(side) does not make sense."); return 0; }
129
133 virtual unsigned int local_side_node(unsigned int /*side*/,
134 unsigned int /*side_node*/) const override
135 { libmesh_error_msg("Calling NodeElem::local_side_node() does not make sense."); return 0; }
136
140 virtual unsigned int local_edge_node(unsigned int /*edge*/,
141 unsigned int /*edge_node*/) const override
142 { libmesh_error_msg("Calling NodeElem::local_edge_node() does not make sense."); return 0; }
143
147 virtual std::unique_ptr<Elem> side_ptr (const unsigned int) override
148 { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
149
150 virtual void side_ptr (std::unique_ptr<Elem> &, const unsigned int) override
151 { libmesh_not_implemented(); }
152
156 virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int) override
157 { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
158
159 virtual void build_side_ptr (std::unique_ptr<Elem> &, const unsigned int) override
160 { libmesh_not_implemented(); }
161
162 // Avoid hiding deprecated version with different signature
164
168 virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int) override
169 { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
170
174 virtual void build_edge_ptr (std::unique_ptr<Elem> &, const unsigned int) override
175 { libmesh_not_implemented(); }
176
180 virtual unsigned int n_sub_elem() const override { return 1; }
181
185 virtual bool is_vertex(const unsigned int libmesh_dbg_var(n)) const override
186 { libmesh_assert_not_equal_to (n, invalid_uint); return true; }
187
191 virtual bool is_edge(const unsigned int) const override { return false; }
192 virtual bool is_face(const unsigned int) const override { return false; }
193
194 virtual bool is_child_on_side(const unsigned int,
195 const unsigned int) const override
196 { libmesh_not_implemented(); return false; }
197
198 virtual bool is_node_on_side(const unsigned int,
199 const unsigned int) const override
200 { libmesh_not_implemented(); return false; }
201
202 virtual std::vector<unsigned int> nodes_on_side(const unsigned int) const override
203 {
204 libmesh_not_implemented();
205 return {0};
206 }
207
208 virtual std::vector<unsigned int> nodes_on_edge(const unsigned int) const override
209 {
210 libmesh_not_implemented();
211 return {0};
212 }
213
214 virtual std::vector<unsigned int> edges_adjacent_to_node(const unsigned int) const override
215 {
216 return {};
217 }
218
219 virtual std::vector<unsigned int> sides_on_edge(const unsigned int) const override
220 {
221 libmesh_not_implemented();
222 return {0};
223 }
224
225 virtual bool is_node_on_edge(const unsigned int,
226 const unsigned int) const override
227 { libmesh_not_implemented(); return false; }
228
229 virtual bool is_edge_on_side(const unsigned int,
230 const unsigned int) const override
231 { libmesh_not_implemented(); return false; }
232
239 virtual Point quasicircumcenter () const override
240 { return this->point(0); }
241
246 virtual bool has_affine_map () const override { return true; }
247
251 virtual bool has_invertible_map(Real /*tol*/) const override { return true; }
252
257 virtual bool is_linear () const override { return true; }
258
262 virtual ElemType type() const override { return NODEELEM; }
263
267 virtual Order default_order() const override;
268
272 virtual Order supported_nodal_order() const override;
273
280 virtual Real volume () const override { return Real(1); }
281
282 virtual void connectivity(const unsigned int sc,
283 const IOPackage iop,
284 std::vector<dof_id_type> & conn) const override;
285
286
287#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
288
292 virtual bool infinite () const override { return false; }
293
294#endif
295
299 virtual unsigned int n_permutations() const override final { return 0; }
300
301 virtual void permute(unsigned int) override final { libmesh_error(); }
302
303 virtual void flip(BoundaryInfo *) override final { return; /* no-op */ }
304 virtual bool is_flipped() const override final { return false; }
305
306 virtual ElemType side_type (const unsigned int) const override
307 {
308 libmesh_not_implemented();
309 return INVALID_ELEM;
310 }
311
323 virtual bool contains_point(const Point & p, Real tol) const override;
324
328 virtual bool close_to_point(const Point & p, Real tol) const override;
329
330 virtual bool on_reference_element(const Point & p,
331 const Real eps = TOLERANCE) const override final;
332
333protected:
334
338 Elem * _elemlinks_data[1+(LIBMESH_DIM>0)];
339
344
345
346#ifdef LIBMESH_ENABLE_AMR
347
351 virtual Real embedding_matrix (const unsigned int i,
352 const unsigned int j,
353 const unsigned int k) const override
354 { return _embedding_matrix[i][j][k]; }
355
360 static const Real _embedding_matrix[1][1][1];
361
365 unsigned int side_children_matrix (const unsigned int,
366 const unsigned int) const
367 { libmesh_not_implemented(); return 0; }
368
370
371#endif // LIBMESH_ENABLE_AMR
372
373};
374
375} // namespace libMesh
376
377#endif // LIBMESH_NODE_ELEM_H
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
This is the base class from which all geometric element types are derived.
Definition elem.h:96
const Point & point(const unsigned int i) const
Definition elem.h:2462
void set_interior_parent(Elem *p)
Sets the pointer to the element's interior_parent.
Definition elem.C:1222
virtual dof_id_type key(const unsigned int s) const =0
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
The NodeElem is a point element, generally used as a side of a 1D element.
Definition node_elem.h:38
virtual unsigned int n_sub_elem() const override
Definition node_elem.h:180
virtual bool is_vertex(const unsigned int libmesh_dbg_var(n)) const override
Definition node_elem.h:185
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:174
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:351
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int) const override
Definition node_elem.h:214
Elem * _elemlinks_data[1+(LIBMESH_DIM >0)]
Data for links to parent/neighbor/interior_parent elements.
Definition node_elem.h:338
virtual dof_id_type low_order_key(const unsigned int) const override
Definition node_elem.h:127
virtual bool contains_point(const Point &p, Real tol) const override
Definition node_elem.C:58
virtual unsigned int n_sides() const override
Definition node_elem.h:89
static const Real _embedding_matrix[1][1][1]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition node_elem.h:360
NodeElem & operator=(const NodeElem &)=delete
virtual Order supported_nodal_order() const override
Definition node_elem.C:44
virtual bool is_edge(const unsigned int) const override
NodeElem objects don't have faces or sides.
Definition node_elem.h:191
virtual bool is_face(const unsigned int) const override
Definition node_elem.h:192
virtual std::vector< unsigned int > sides_on_edge(const unsigned int) const override
Definition node_elem.h:219
static const int num_sides
Definition node_elem.h:64
virtual unsigned int n_faces() const override
Definition node_elem.h:104
virtual unsigned int n_permutations() const override final
No way to reorient a single node.
Definition node_elem.h:299
virtual bool is_node_on_side(const unsigned int, const unsigned int) const override
Definition node_elem.h:198
virtual ElemType side_type(const unsigned int) const override
Definition node_elem.h:306
virtual bool has_invertible_map(Real) const override
Definition node_elem.h:251
NodeElem(NodeElem &&)=delete
unsigned int side_children_matrix(const unsigned int, const unsigned int) const
Matrix that allows children to inherit boundary conditions.
Definition node_elem.h:365
virtual bool is_edge_on_side(const unsigned int, const unsigned int) const override
Definition node_elem.h:229
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:168
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int) override
The Elem::build_side_ptr() member makes no sense for nodes.
Definition node_elem.h:156
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:303
virtual unsigned int n_vertices() const override
Definition node_elem.h:94
virtual unsigned int local_side_node(unsigned int, unsigned int) const override
NodeElems don't have sides, so they can't have nodes on sides.
Definition node_elem.h:133
virtual Real volume() const override
Elem::volume() returns the N-dimensional measure of an N-dimensional element.
Definition node_elem.h:280
virtual Order default_order() const override
Definition node_elem.C:38
virtual bool is_flipped() const override final
Definition node_elem.h:304
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition node_elem.C:51
virtual unsigned int n_children() const override
Definition node_elem.h:109
virtual Point master_point(const unsigned int libmesh_dbg_var(i)) const override
Definition node_elem.h:70
Node * _nodelinks_data[1]
Data for links to nodes.
Definition node_elem.h:343
virtual bool is_node_on_edge(const unsigned int, const unsigned int) const override
Definition node_elem.h:225
virtual ElemType type() const override
Definition node_elem.h:262
virtual dof_id_type key(const unsigned int) const override
Definition node_elem.h:120
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:150
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:147
virtual bool is_child_on_side(const unsigned int, const unsigned int) const override
Definition node_elem.h:194
virtual bool close_to_point(const Point &p, Real tol) const override
Definition node_elem.C:63
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const override final
Definition node_elem.C:69
virtual bool infinite() const override
Definition node_elem.h:292
virtual bool has_affine_map() const override
Definition node_elem.h:246
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:301
virtual unsigned int n_nodes() const override
Definition node_elem.h:84
virtual bool is_linear() const override
Definition node_elem.h:257
NodeElem(const NodeElem &)=delete
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const override
Definition node_elem.h:202
virtual unsigned int local_edge_node(unsigned int, unsigned int) const override
NodeElems don't have edges, so they can't have nodes on edges.
Definition node_elem.h:140
static const int num_nodes
Geometric constants for NodeElem;.
Definition node_elem.h:63
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int) const override
Definition node_elem.h:208
virtual ~NodeElem()=default
virtual unsigned int n_edges() const override
Definition node_elem.h:99
virtual Point quasicircumcenter() const override
Definition node_elem.h:239
virtual unsigned short dim() const override
Definition node_elem.h:79
NodeElem(Elem *p=nullptr)
Constructor.
Definition node_elem.h:45
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:159
A Node is like a Point, but with more information.
Definition node.h:55
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition point.h:40
The libMesh namespace provides an interface to certain functionality in the library.
IOPackage
libMesh interfaces with several different software packages for the purposes of creating,...
ElemType
Defines an enum for geometric element types.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition libmesh.h:303
static constexpr Real TOLERANCE
uint8_t dof_id_type
Definition id_types.h:67
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real