node_elem.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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 
120  virtual unsigned int which_node_am_i(unsigned int /*side*/,
121  unsigned int /*side_node*/) const override
122  { libmesh_error_msg("Calling NodeElem::which_node_am_i() does not make sense."); return 0; }
123 
127  virtual std::unique_ptr<Elem> side_ptr (const unsigned int) override
128  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
129 
130  virtual void side_ptr (std::unique_ptr<Elem> &, const unsigned int) override
131  { libmesh_not_implemented(); }
132 
136  virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int, bool) override
137  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
138 
139  virtual void build_side_ptr (std::unique_ptr<Elem> &, const unsigned int) override
140  { libmesh_not_implemented(); }
141 
145  virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int) override
146  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
147 
151  virtual unsigned int n_sub_elem() const override { return 1; }
152 
156  virtual bool is_vertex(const unsigned int) const override { return true; }
157 
161  virtual bool is_edge(const unsigned int) const override { return false; }
162  virtual bool is_face(const unsigned int) const override { return false; }
163 
164  virtual bool is_child_on_side(const unsigned int,
165  const unsigned int) const override
166  { libmesh_not_implemented(); return false; }
167 
168  virtual bool is_node_on_side(const unsigned int,
169  const unsigned int) const override
170  { libmesh_not_implemented(); return false; }
171 
172  virtual std::vector<unsigned int> nodes_on_side(const unsigned int) const override
173  {
174  libmesh_not_implemented();
175  return {0};
176  }
177 
178  virtual bool is_node_on_edge(const unsigned int,
179  const unsigned int) const override
180  { libmesh_not_implemented(); return false; }
181 
182  virtual bool is_edge_on_side(const unsigned int,
183  const unsigned int) const override
184  { libmesh_not_implemented(); return false; }
185 
190  virtual bool has_affine_map () const override { return true; }
191 
196  virtual bool is_linear () const override { return true; }
197 
201  virtual ElemType type() const override { return NODEELEM; }
202 
206  virtual Order default_order() const override;
207 
208  virtual void connectivity(const unsigned int sc,
209  const IOPackage iop,
210  std::vector<dof_id_type> & conn) const override;
211 
212 
213 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
214 
218  virtual bool infinite () const override { return false; }
219 
220 #endif
221 
222 
223 protected:
224 
228  Elem * _elemlinks_data[1+(LIBMESH_DIM>0)];
229 
234 
235 
236 #ifdef LIBMESH_ENABLE_AMR
237 
241  virtual float embedding_matrix (const unsigned int i,
242  const unsigned int j,
243  const unsigned int k) const override
244  { return _embedding_matrix[i][j][k]; }
245 
250  static const float _embedding_matrix[1][1][1];
251 
255  unsigned int side_children_matrix (const unsigned int,
256  const unsigned int) const
257  { libmesh_not_implemented(); return 0; }
258 
260 
261 #endif // LIBMESH_ENABLE_AMR
262 
263 };
264 
265 } // namespace libMesh
266 
267 #endif // LIBMESH_NODE_ELEM_H
virtual unsigned int n_faces() const override
Definition: node_elem.h:98
unsigned int side_children_matrix(const unsigned int, const unsigned int) const
Definition: node_elem.h:255
virtual unsigned int n_vertices() const override
Definition: node_elem.h:88
A geometric point in (x,y,z) space associated with a DOF.
Definition: node.h:52
virtual void side_ptr(std::unique_ptr< Elem > &, const unsigned int) override
Definition: node_elem.h:130
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:401
virtual bool is_node_on_edge(const unsigned int, const unsigned int) const override
Definition: node_elem.h:178
The base class for all geometric element types.
Definition: elem.h:100
virtual void build_side_ptr(std::unique_ptr< Elem > &, const unsigned int) override
Definition: node_elem.h:139
virtual bool is_child_on_side(const unsigned int, const unsigned int) const override
Definition: node_elem.h:164
virtual bool is_edge_on_side(const unsigned int, const unsigned int) const override
Definition: node_elem.h:182
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)
Definition: elem.C:856
virtual bool is_face(const unsigned int) const override
Definition: node_elem.h:162
NodeElem(Elem *p=nullptr)
Definition: node_elem.h:45
virtual bool infinite() const override
Definition: node_elem.h:218
virtual Order default_order() const override
Definition: node_elem.C:28
virtual std::unique_ptr< Elem > side_ptr(const unsigned int) override
Definition: node_elem.h:127
virtual bool has_affine_map() const override
Definition: node_elem.h:190
virtual bool is_node_on_side(const unsigned int, const unsigned int) const override
Definition: node_elem.h:168
Node * _nodelinks_data[1]
Definition: node_elem.h:233
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
A zero-dimensional geometric entity implementing the Elem interface.
Definition: node_elem.h:37
virtual float embedding_matrix(const unsigned int i, const unsigned int j, const unsigned int k) const override
Definition: node_elem.h:241
static const float _embedding_matrix[1][1][1]
Definition: node_elem.h:250
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int, bool) override
Definition: node_elem.h:136
virtual bool is_edge(const unsigned int) const override
Definition: node_elem.h:161
virtual unsigned int n_edges() const override
Definition: node_elem.h:93
virtual unsigned short dim() const override
Definition: node_elem.h:73
virtual unsigned int which_node_am_i(unsigned int, unsigned int) const override
Definition: node_elem.h:120
virtual dof_id_type key(const unsigned int) const override
Definition: node_elem.h:114
virtual ElemType type() const override
Definition: node_elem.h:201
virtual bool is_linear() const override
Definition: node_elem.h:196
virtual ~NodeElem()=default
Elem * _elemlinks_data[1+(LIBMESH_DIM >0)]
Definition: node_elem.h:228
A geometric point in (x,y,z) space.
Definition: point.h:38
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const override
Definition: node_elem.h:172
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int) override
Definition: node_elem.h:145
virtual unsigned int n_sub_elem() const override
Definition: node_elem.h:151
uint8_t dof_id_type
Definition: id_types.h:64
virtual bool is_vertex(const unsigned int) const override
Definition: node_elem.h:156