libMesh
edge_edge2.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 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_EDGE_EDGE2_H
21 #define LIBMESH_EDGE_EDGE2_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/edge.h"
26 
27 namespace libMesh
28 {
29 
46 class Edge2 : public Edge
47 {
48 public:
49 
53  explicit
54  Edge2 (Elem * p=nullptr) :
56 
57  Edge2 (Edge2 &&) = delete;
58  Edge2 (const Edge2 &) = delete;
59  Edge2 & operator= (const Edge2 &) = delete;
60  Edge2 & operator= (Edge2 &&) = delete;
61  virtual ~Edge2() = default;
62 
67  virtual Point master_point (const unsigned int i) const override
68  {
69  libmesh_assert_less(i, this->n_nodes());
70  return Point(2.0f*Real(i)-1.0f,0,0);
71  }
72 
76  virtual unsigned int n_sub_elem() const override { return 1; }
77 
81  virtual bool is_vertex(const unsigned int i) const override;
82 
86  virtual bool is_edge(const unsigned int i) const override;
87 
91  virtual bool is_face(const unsigned int i) const override;
92 
97  virtual bool is_node_on_side(const unsigned int n,
98  const unsigned int s) const override;
99 
104  virtual bool is_node_on_edge(const unsigned int n,
105  const unsigned int e) const override;
106 
111  virtual bool has_affine_map () const override { return true; }
112 
116  virtual bool has_invertible_map(Real tol) const override;
117 
122  virtual bool is_linear () const override { return true; }
123 
127  virtual ElemType type() const override { return EDGE2; }
128 
132  virtual Order default_order() const override;
133 
134  virtual void connectivity(const unsigned int sc,
135  const IOPackage iop,
136  std::vector<dof_id_type> & conn) const override;
137 
142  virtual Point true_centroid () const override;
143 
147  virtual Real volume () const override;
148 
149 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
150 
154  virtual bool infinite () const override { return false; }
155 
156 #endif
157 
161  using Edge::key;
162 
168  virtual dof_id_type key () const override;
169 
173  static const int num_nodes = 2;
174  static const int num_sides = 2;
175  static const int num_edges = 0;
176  static const int num_children = 2;
177  static const int nodes_per_side = 1;
178  static const int nodes_per_edge = invalid_int;
179 
180  virtual void flip(BoundaryInfo *) override final;
181 
182 protected:
183 
188 
189 
190 
191 #ifdef LIBMESH_ENABLE_AMR
192 
196  virtual Real embedding_matrix (const unsigned int i,
197  const unsigned int j,
198  const unsigned int k) const override
199  { return _embedding_matrix[i][j][k]; }
200 
206 
208 
209 #endif // LIBMESH_ENABLE_AMR
210 
211 };
212 
213 } // namespace libMesh
214 
215 
216 #endif // LIBMESH_EDGE_EDGE2_H
virtual bool has_affine_map() const override
Definition: edge_edge2.h:111
ElemType
Defines an enum for geometric element types.
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
A Node is like a Point, but with more information.
Definition: node.h:52
static const int num_children
Definition: edge_edge2.h:176
static const int nodes_per_side
Definition: edge_edge2.h:177
virtual dof_id_type key() const
Definition: elem.C:563
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: edge_edge2.h:196
virtual Point master_point(const unsigned int i) const override
Definition: edge_edge2.h:67
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 ~Edge2()=default
static const int num_sides
Definition: edge_edge2.h:174
Node * _nodelinks_data[num_nodes]
Data for links to nodes.
Definition: edge_edge2.h:187
The libMesh namespace provides an interface to certain functionality in the library.
virtual dof_id_type key() const override
Definition: edge_edge2.C:150
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: edge_edge2.h:207
Edge2(Elem *p=nullptr)
Constructor.
Definition: edge_edge2.h:54
const int invalid_int
A number which is used quite often to represent an invalid or uninitialized value for an integer...
Definition: libmesh.h:292
static const int num_edges
Definition: edge_edge2.h:175
virtual bool is_face(const unsigned int i) const override
Definition: edge_edge2.C:68
virtual Point true_centroid() const override
An optimized method for computing the centroid of a 2-node edge.
Definition: edge_edge2.C:136
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
Definition: boundary_info.h:57
static const Real _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition: edge_edge2.h:205
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
Definition: edge_edge2.C:73
Edge2 & operator=(const Edge2 &)=delete
virtual bool is_vertex(const unsigned int i) const override
Definition: edge_edge2.C:58
static const int num_nodes
Geometric constants for Edge2.
Definition: edge_edge2.h:173
virtual bool has_invertible_map(Real tol) const override
Definition: edge_edge2.C:96
virtual bool is_edge(const unsigned int i) const override
Definition: edge_edge2.C:63
virtual Order default_order() const override
Definition: edge_edge2.C:89
virtual bool is_linear() const override
Definition: edge_edge2.h:122
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition: edge_edge2.C:103
virtual unsigned int n_sub_elem() const override
Definition: edge_edge2.h:76
The Edge2 is an element in 1D composed of 2 nodes.
Definition: edge_edge2.h:46
The Edge is an element in 1D.
Definition: edge.h:37
virtual bool infinite() const override
Definition: edge_edge2.h:154
static const int nodes_per_edge
Definition: edge_edge2.h:178
virtual Real volume() const override
An optimized method for computing the length of a 2-node edge.
Definition: edge_edge2.C:141
virtual ElemType type() const override
Definition: edge_edge2.h:127
virtual void flip(BoundaryInfo *) override final
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
Definition: edge_edge2.C:157
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
virtual unsigned int n_nodes() const override
Definition: edge.h:69
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
Definition: edge_edge2.C:80
uint8_t dof_id_type
Definition: id_types.h:67