libMesh
face_c0polygon.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2025 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_FACE_C0POLYGON_H
21 #define LIBMESH_FACE_C0POLYGON_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/face_polygon.h"
26 
27 namespace libMesh
28 {
29 
51 class C0Polygon : public Polygon
52 {
53 public:
54 
66  explicit
67  C0Polygon (const unsigned int num_sides, Elem * p=nullptr);
68 
69  C0Polygon (C0Polygon &&) = delete;
70  C0Polygon (const C0Polygon &) = delete;
71  C0Polygon & operator= (const C0Polygon &) = delete;
72  C0Polygon & operator= (C0Polygon &&) = delete;
73  virtual ~C0Polygon() = default;
74 
78  virtual ElemType type () const override final { return C0POLYGON; }
79 
84  virtual unsigned int n_sub_elem() const override { return this->n_sides(); }
85 
91  virtual unsigned int opposite_node(const unsigned int n,
92  const unsigned int s) const override final;
93 
97  virtual bool is_vertex(const unsigned int i) const override;
98 
102  virtual bool is_edge(const unsigned int i) const override;
103 
107  virtual bool is_face(const unsigned int i) const override;
108 
112  virtual unsigned int n_nodes_per_side() const override { return 2;}
113 
118  virtual bool is_node_on_side(const unsigned int n,
119  const unsigned int s) const override;
120 
121  virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;
122 
123  virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;
124 
129  virtual bool is_node_on_edge(const unsigned int n,
130  const unsigned int e) const override
131  { return this->is_node_on_side(n,e); }
132 
137  virtual bool has_affine_map () const override;
138 
142  virtual Order default_order() const override;
143 
147  using Elem::key;
148 
149  virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i) override;
150 
154  virtual void build_side_ptr (std::unique_ptr<Elem> & elem,
155  const unsigned int i) override;
156 
157  // Avoid hiding deprecated version with different signature
158  using Elem::build_side_ptr;
159 
160  virtual void connectivity(const unsigned int sf,
161  const IOPackage iop,
162  std::vector<dof_id_type> & conn) const override;
163 
167  virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const override
168  { return 2; }
169 
173  virtual std::pair<unsigned short int, unsigned short int>
174  second_order_child_vertex (const unsigned int n) const override;
175 
179  virtual Real volume () const override;
180 
184  virtual Point true_centroid () const override;
185 
186  virtual void permute(unsigned int perm_num) override final;
187 
188  virtual void flip(BoundaryInfo *) override final;
189 
190  ElemType side_type (const unsigned int s) const override final;
191 
195  virtual void retriangulate() override final;
196 
197 protected:
198 
199 #ifdef LIBMESH_ENABLE_AMR
200 
204  virtual Real embedding_matrix (const unsigned int /*i*/,
205  const unsigned int /*j*/,
206  const unsigned int /*k*/) const override
207  { libmesh_not_implemented(); return 0; }
208 
209 #endif // LIBMESH_ENABLE_AMR
210 
211 };
212 
213 
214 } // namespace libMesh
215 
216 #endif // LIBMESH_FACE_POLYGON_H
virtual Real volume() const override
An optimized method for calculating the area of a C0Polygon.
ElemType
Defines an enum for geometric element types.
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const override
Element refinement is not implemented for polygons.
virtual void permute(unsigned int perm_num) override final
Permutes the element (by swapping node and neighbor pointers) according to the specified index...
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
virtual Order default_order() const override
virtual bool is_edge(const unsigned int i) const override
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
virtual dof_id_type key() const
Definition: elem.C:753
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 std::vector< unsigned int > nodes_on_edge(const unsigned int e) const override
virtual ElemType type() const override final
The libMesh namespace provides an interface to certain functionality in the library.
ElemType side_type(const unsigned int s) const override final
virtual unsigned int n_sub_elem() const override
virtual bool is_vertex(const unsigned int i) const override
virtual unsigned int opposite_node(const unsigned int n, const unsigned int s) const override final
virtual bool has_affine_map() const override
virtual ~C0Polygon()=default
C0Polygon & operator=(const C0Polygon &)=delete
The Polygon is an element in 2D with an arbitrary (but fixed) number of sides.
Definition: face_polygon.h:39
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
Definition: boundary_info.h:57
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
virtual bool is_face(const unsigned int i) const override
virtual void connectivity(const unsigned int sf, const IOPackage iop, std::vector< dof_id_type > &conn) const override
The C0Polygon is an element in 2D with an arbitrary (but fixed) number of first-order (EDGE2) sides...
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i) override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int) const override
virtual std::vector< unsigned int > nodes_on_side(const unsigned int s) const override
virtual Real embedding_matrix(const unsigned int, const unsigned int, const unsigned int) const override
Matrix used to create the elements children.
virtual unsigned int n_nodes_per_side() const override
C0Polygon elements have only vertex nodes, two per side/edge.
virtual unsigned int n_sides() const override final
Definition: face_polygon.h:84
C0Polygon(const unsigned int num_sides, Elem *p=nullptr)
Constructor.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
virtual void retriangulate() override final
Create a triangulation from the current node locations.
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
virtual Point true_centroid() const override
An optimized method for calculating the centroid of a C0Polygon.