libMesh
edge_edge2.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_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 
43 class Edge2 : public Edge
44 {
45 public:
46 
50  explicit
51  Edge2 (Elem * p=nullptr) :
53 
54  Edge2 (Edge2 &&) = delete;
55  Edge2 (const Edge2 &) = delete;
56  Edge2 & operator= (const Edge2 &) = delete;
57  Edge2 & operator= (Edge2 &&) = delete;
58  virtual ~Edge2() = default;
59 
64  virtual Point master_point (const unsigned int i) const override
65  {
66  libmesh_assert_less(i, this->n_nodes());
67  return Point(2.0f*Real(i)-1.0f,0,0);
68  }
69 
73  virtual unsigned int n_sub_elem() const override { return 1; }
74 
78  virtual bool is_vertex(const unsigned int i) const override;
79 
83  virtual bool is_edge(const unsigned int i) const override;
84 
88  virtual bool is_face(const unsigned int i) const override;
89 
94  virtual bool is_node_on_side(const unsigned int n,
95  const unsigned int s) const override;
96 
101  virtual bool is_node_on_edge(const unsigned int n,
102  const unsigned int e) const override;
103 
108  virtual bool has_affine_map () const override { return true; }
109 
114  virtual bool is_linear () const override { return true; }
115 
119  virtual ElemType type() const override { return EDGE2; }
120 
124  virtual Order default_order() const override;
125 
126  virtual void connectivity(const unsigned int sc,
127  const IOPackage iop,
128  std::vector<dof_id_type> & conn) const override;
129 
133  virtual Real volume () const override;
134 
135 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
136 
140  virtual bool infinite () const override { return false; }
141 
142 #endif
143 
147  using Edge::key;
148 
154  virtual dof_id_type key () const override;
155 
159  static const int num_nodes = 2;
160  static const int num_children = 2;
161 
162 protected:
163 
168 
169 
170 
171 #ifdef LIBMESH_ENABLE_AMR
172 
176  virtual float embedding_matrix (const unsigned int i,
177  const unsigned int j,
178  const unsigned int k) const override
179  { return _embedding_matrix[i][j][k]; }
180 
186 
188 
189 #endif // LIBMESH_ENABLE_AMR
190 
191 };
192 
193 } // namespace libMesh
194 
195 
196 #endif // LIBMESH_EDGE_EDGE2_H
libMesh::Edge2::Edge2
Edge2(Elem *p=nullptr)
Constructor.
Definition: edge_edge2.h:51
libMesh::Edge2::num_nodes
static const int num_nodes
Geometric constants for Edge2.
Definition: edge_edge2.h:159
libMesh::Edge2::operator=
Edge2 & operator=(const Edge2 &)=delete
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::Edge2::default_order
virtual Order default_order() const override
Definition: edge_edge2.C:85
libMesh::Edge2::is_node_on_side
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
Definition: edge_edge2.C:69
libMesh::Edge2::is_edge
virtual bool is_edge(const unsigned int i) const override
Definition: edge_edge2.C:59
libMesh::Edge2::is_vertex
virtual bool is_vertex(const unsigned int i) const override
Definition: edge_edge2.C:54
libMesh::IOPackage
IOPackage
libMesh interfaces with several different software packages for the purposes of creating,...
Definition: enum_io_package.h:37
libMesh::Edge2::is_linear
virtual bool is_linear() const override
Definition: edge_edge2.h:114
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::Edge2::n_sub_elem
virtual unsigned int n_sub_elem() const override
Definition: edge_edge2.h:73
libMesh::Order
Order
Definition: enum_order.h:40
libMesh::Edge2::connectivity
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition: edge_edge2.C:92
libMesh::Edge
The Edge is an element in 1D.
Definition: edge.h:37
libMesh::Edge2::infinite
virtual bool infinite() const override
Definition: edge_edge2.h:140
libMesh::Edge2::has_affine_map
virtual bool has_affine_map() const override
Definition: edge_edge2.h:108
libMesh::Edge2::volume
virtual Real volume() const override
An optimized method for computing the length of a 2-node edge.
Definition: edge_edge2.C:125
libMesh::Edge2::type
virtual ElemType type() const override
Definition: edge_edge2.h:119
libMesh::Edge2::embedding_matrix
virtual float 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:176
libMesh::Point
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
libMesh::Elem::key
virtual dof_id_type key() const
Definition: elem.C:410
libMesh::Edge2::is_node_on_edge
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
Definition: edge_edge2.C:76
libMesh::Node
A Node is like a Point, but with more information.
Definition: node.h:52
libMesh::Edge2::num_children
static const int num_children
Definition: edge_edge2.h:160
libMesh::Edge2::_nodelinks_data
Node * _nodelinks_data[num_nodes]
Data for links to nodes.
Definition: edge_edge2.h:167
libMesh::Edge2::~Edge2
virtual ~Edge2()=default
libMesh::Edge2::key
virtual dof_id_type key() const override
Definition: edge_edge2.C:134
libMesh::Edge::n_nodes
virtual unsigned int n_nodes() const override
Definition: edge.h:69
libMesh::Edge2::_embedding_matrix
static const float _embedding_matrix[num_children][num_nodes][num_nodes]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition: edge_edge2.h:185
libMesh::Edge2::master_point
virtual Point master_point(const unsigned int i) const override
Definition: edge_edge2.h:64
libMesh::Edge2
The Edge2 is an element in 1D composed of 2 nodes.
Definition: edge_edge2.h:43
libMesh::Elem
This is the base class from which all geometric element types are derived.
Definition: elem.h:100
libMesh::Edge2::LIBMESH_ENABLE_TOPOLOGY_CACHES
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: edge_edge2.h:187
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::EDGE2
Definition: enum_elem_type.h:35
libMesh::ElemType
ElemType
Defines an enum for geometric element types.
Definition: enum_elem_type.h:33
libMesh::Edge2::is_face
virtual bool is_face(const unsigned int i) const override
Definition: edge_edge2.C:64