libMesh
Loading...
Searching...
No Matches
node_elem.C
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// Local includes
21#include "libmesh/node_elem.h"
22#include "libmesh/enum_order.h"
23
24namespace libMesh
25{
26
27
28// ------------------------------------------------------------
29// NodeElem class static member initializations
30const int NodeElem::num_nodes;
31const int NodeElem::num_sides;
32
33// ------------------------------------------------------------
34// NodeElem class member functions
35
36// If we're computing on a node, we only need CONSTANT approximation
37// to get the full function space
39{
40 return CONSTANT;
41}
42
43// But we can "support" any order in 0D, really...
48
49
50
51void NodeElem::connectivity(const unsigned int,
52 const IOPackage,
53 std::vector<dof_id_type> &) const
54{
55 libmesh_not_implemented();
56}
57
58bool NodeElem::contains_point(const Point & p, Real tol) const
59{
60 return (this->point(0) - p).norm() < tol;
61}
62
63bool NodeElem::close_to_point(const Point & p, Real tol) const
64{
65 return this->contains_point(p, tol);
66}
67
68
70 const Real eps) const
71{
72 // Debatably `return true;` would make sense here; we shouldn't ever
73 // pass p!=0 in.
74 return (std::abs(p(0)) < eps
75#if LIBMESH_DIM > 1
76 && std::abs(p(1)) < eps
77#endif
78#if LIBMESH_DIM > 2
79 && std::abs(p(2)) < eps
80#endif
81 );
82}
83
84
85#ifdef LIBMESH_ENABLE_AMR
86
87const Real NodeElem::_embedding_matrix[1][1][1] =
88 {
89 // embedding matrix for child 0
90 {
91 // 0
92 {1.0}, // 0
93 }
94 };
95
96#endif
97
98} // namespace libMesh
const Point & point(const unsigned int i) const
Definition elem.h:2462
virtual bool contains_point(const Point &p, Real tol) const override
Definition node_elem.C:58
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
virtual Order supported_nodal_order() const override
Definition node_elem.C:44
static const int num_sides
Definition node_elem.h:64
virtual Order default_order() const override
Definition node_elem.C:38
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition node_elem.C:51
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
static const int num_nodes
Geometric constants for NodeElem;.
Definition node_elem.h:63
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,...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real