libMesh
remote_elem.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 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_REMOTE_ELEM_H
21 #define LIBMESH_REMOTE_ELEM_H
22 
23 // Local includes
24 #include "libmesh/elem.h"
25 #include "libmesh/libmesh_singleton.h"
26 
27 // C++ includes
28 #include <limits>
29 
30 namespace libMesh
31 {
32 
44 class RemoteElem : public Elem,
45  public Singleton
46 {
47 public:
48 
52  static const dof_id_type remote_elem_id = static_cast<dof_id_type>(-2);
53 
57 private:
58  RemoteElem () : Elem(0,
59  0,
60  nullptr,
62  nullptr)
63  { this->set_id(remote_elem_id); }
64 
65 public:
66 
67  RemoteElem (RemoteElem &&) = delete;
68  RemoteElem (const RemoteElem &) = delete;
69  RemoteElem & operator= (const RemoteElem &) = delete;
70  RemoteElem & operator= (RemoteElem &&) = delete;
71 
75  virtual ~RemoteElem();
76 
81  static const Elem & create ();
82 
83  virtual Point master_point (const unsigned int /*i*/) const override
84  { libmesh_not_implemented(); return Point(); }
85 
86  virtual Node * & set_node (const unsigned int i) override
87  { libmesh_not_implemented(); return Elem::set_node(i); }
88 
92  using Elem::key;
93 
94  virtual dof_id_type key (const unsigned int) const override
95  { libmesh_not_implemented(); return 0; }
96 
97  virtual unsigned int which_node_am_i(unsigned int /*side*/,
98  unsigned int /*side_node*/) const override
99  { libmesh_not_implemented(); return 0; }
100 
101  virtual bool is_remote () const override
102  { return true; }
103 
104  virtual void connectivity(const unsigned int,
105  const IOPackage,
106  std::vector<dof_id_type> &) const override
107  { libmesh_not_implemented(); }
108 
109  virtual ElemType type () const override
110  { return REMOTEELEM; }
111 
112  virtual unsigned short dim () const override
113  { libmesh_not_implemented(); return 0; }
114 
115  virtual unsigned int n_nodes () const override
116  { libmesh_not_implemented(); return 0; }
117 
118  virtual unsigned int n_sides () const override
119  { libmesh_not_implemented(); return 0; }
120 
121  virtual unsigned int n_vertices () const override
122  { libmesh_not_implemented(); return 0; }
123 
124  virtual unsigned int n_edges () const override
125  { libmesh_not_implemented(); return 0; }
126 
127  virtual unsigned int n_faces () const override
128  { libmesh_not_implemented(); return 0; }
129 
130  virtual unsigned int n_children () const override
131  { libmesh_not_implemented(); return 0; }
132 
133  virtual bool is_vertex(const unsigned int) const override
134  { libmesh_not_implemented(); return false; }
135 
136  virtual bool is_edge(const unsigned int) const override
137  { libmesh_not_implemented(); return false; }
138 
139  virtual bool is_face(const unsigned int) const override
140  { libmesh_not_implemented(); return false; }
141 
142  virtual bool is_node_on_side(const unsigned int,
143  const unsigned int) const override
144  { libmesh_not_implemented(); return false; }
145 
146  virtual std::vector<unsigned int> nodes_on_side(const unsigned int) const override
147  {
148  libmesh_not_implemented();
149  return {0};
150  }
151 
152  virtual bool is_child_on_side(const unsigned int,
153  const unsigned int) const override
154  { libmesh_not_implemented(); return false; }
155 
156  virtual bool is_edge_on_side(const unsigned int,
157  const unsigned int) const override
158  { libmesh_not_implemented(); return false; }
159 
160  virtual bool is_node_on_edge(const unsigned int,
161  const unsigned int) const override
162  { libmesh_not_implemented(); return false; }
163 
164  virtual unsigned int n_sub_elem () const override
165  { libmesh_not_implemented(); return 0; }
166 
167  virtual std::unique_ptr<Elem> side_ptr (const unsigned int) override
168  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
169 
170  virtual void side_ptr (std::unique_ptr<Elem> &,
171  const unsigned int) override
172  { libmesh_not_implemented(); }
173 
174  virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int,
175  bool) override
176  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
177 
178  virtual void build_side_ptr (std::unique_ptr<Elem> &,
179  const unsigned int) override
180  { libmesh_not_implemented(); }
181 
182  virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int) override
183  { libmesh_not_implemented(); return std::unique_ptr<Elem>(); }
184 
185  virtual Order default_order () const override
186  { libmesh_not_implemented(); return static_cast<Order>(1); }
187 
188 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
189 
190  virtual bool infinite () const override
191  { libmesh_not_implemented(); return false; }
192 
193 #endif
194 
195 #ifdef LIBMESH_ENABLE_AMR
196 
201  virtual float embedding_matrix (const unsigned int,
202  const unsigned int,
203  const unsigned int) const override
204  { libmesh_not_implemented(); return 0.; }
205 
207 
208 #endif // LIBMESH_ENABLE_AMR
209 
210 
211 protected:
212 
217 };
218 
219 // Singleton RemoteElem
220 extern const RemoteElem * remote_elem;
221 
222 } // namespace libMesh
223 
224 #endif // LIBMESH_REMOTE_ELEM_H
static const dof_id_type remote_elem_id
A unique id to distinguish remote element links.
Definition: remote_elem.h:52
Base class for all library singleton objects.
ElemType
Defines an enum for geometric element types.
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int) override
Definition: remote_elem.h:182
virtual dof_id_type key(const unsigned int) const override
Definition: remote_elem.h:94
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
In parallel meshes where a ghost element has neighbors which do not exist on the local processor...
Definition: remote_elem.h:44
virtual Node *& set_node(const unsigned int i)
Definition: elem.h:2024
A Node is like a Point, but with more information.
Definition: node.h:52
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const override
Definition: remote_elem.h:146
RemoteElem()
Constructor.
Definition: remote_elem.h:58
virtual unsigned int n_nodes() const override
Definition: remote_elem.h:115
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
virtual dof_id_type key() const
This is the base class from which all geometric element types are derived.
Definition: elem.h:101
Elem * _elemlinks_data[1]
Data for link to (nullptr!) parent.
Definition: remote_elem.h:216
The libMesh namespace provides an interface to certain functionality in the library.
virtual unsigned int which_node_am_i(unsigned int, unsigned int) const override
Definition: remote_elem.h:97
virtual unsigned int n_sides() const override
Definition: remote_elem.h:118
dof_id_type & set_id()
Definition: dof_object.h:747
virtual unsigned int n_vertices() const override
Definition: remote_elem.h:121
virtual bool is_node_on_edge(const unsigned int, const unsigned int) const override
Definition: remote_elem.h:160
virtual Point master_point(const unsigned int) const override
Definition: remote_elem.h:83
virtual bool is_remote() const override
Definition: remote_elem.h:101
RemoteElem & operator=(const RemoteElem &)=delete
virtual void connectivity(const unsigned int, const IOPackage, std::vector< dof_id_type > &) const override
Definition: remote_elem.h:104
virtual ElemType type() const override
Definition: remote_elem.h:109
virtual ~RemoteElem()
Sets remote_elem to nullptr.
virtual bool is_face(const unsigned int) const override
Definition: remote_elem.h:139
virtual unsigned int n_faces() const override
Definition: remote_elem.h:127
virtual unsigned int n_sub_elem() const override
Definition: remote_elem.h:164
virtual bool is_node_on_side(const unsigned int, const unsigned int) const override
Definition: remote_elem.h:142
const RemoteElem * remote_elem
virtual bool is_edge_on_side(const unsigned int, const unsigned int) const override
Definition: remote_elem.h:156
virtual unsigned short dim() const override
Definition: remote_elem.h:112
virtual bool is_edge(const unsigned int) const override
Definition: remote_elem.h:136
virtual std::unique_ptr< Elem > side_ptr(const unsigned int) override
Definition: remote_elem.h:167
virtual bool is_vertex(const unsigned int) const override
Definition: remote_elem.h:133
static const Elem & create()
Return a reference to the global RemoteElem singleton object.
virtual float embedding_matrix(const unsigned int, const unsigned int, const unsigned int) const override
Matrix that transforms the parents nodes into the children&#39;s nodes.
Definition: remote_elem.h:201
virtual Node *& set_node(const unsigned int i) override
Definition: remote_elem.h:86
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int, bool) override
Definition: remote_elem.h:174
virtual unsigned int n_edges() const override
Definition: remote_elem.h:124
virtual unsigned int n_children() const override
Definition: remote_elem.h:130
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: remote_elem.h:178
virtual Order default_order() const override
Definition: remote_elem.h:185
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: remote_elem.h:170
virtual bool infinite() const override
Definition: remote_elem.h:190
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
virtual bool is_child_on_side(const unsigned int, const unsigned int) const override
Definition: remote_elem.h:152
uint8_t dof_id_type
Definition: id_types.h:67