edge_edge2.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_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
virtual bool has_affine_map() const override
Definition: edge_edge2.h:108
A geometric point in (x,y,z) space associated with a DOF.
Definition: node.h:52
static const int num_children
Definition: edge_edge2.h:160
virtual dof_id_type key() const
Definition: elem.C:401
virtual Point master_point(const unsigned int i) const override
Definition: edge_edge2.h:64
The base class for all geometric element types.
Definition: elem.h:100
virtual ~Edge2()=default
static const float _embedding_matrix[num_children][num_nodes][num_nodes]
Definition: edge_edge2.h:185
Node * _nodelinks_data[num_nodes]
Definition: edge_edge2.h:167
virtual dof_id_type key() const override
Definition: edge_edge2.C:134
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: edge_edge2.h:187
Edge2(Elem *p=nullptr)
Definition: edge_edge2.h:51
virtual bool is_face(const unsigned int i) const override
Definition: edge_edge2.C:64
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
Definition: edge_edge2.C:69
Edge2 & operator=(const Edge2 &)=delete
virtual bool is_vertex(const unsigned int i) const override
Definition: edge_edge2.C:54
static const int num_nodes
Definition: edge_edge2.h:159
virtual bool is_edge(const unsigned int i) const override
Definition: edge_edge2.C:59
virtual Order default_order() const override
Definition: edge_edge2.C:85
virtual bool is_linear() const override
Definition: edge_edge2.h:114
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:92
virtual unsigned int n_sub_elem() const override
Definition: edge_edge2.h:73
A 1D geometric element with 2 nodes.
Definition: edge_edge2.h:43
The base class for all 1D geometric element types.
Definition: edge.h:37
virtual bool infinite() const override
Definition: edge_edge2.h:140
virtual Real volume() const override
Definition: edge_edge2.C:125
virtual float embedding_matrix(const unsigned int i, const unsigned int j, const unsigned int k) const override
Definition: edge_edge2.h:176
virtual ElemType type() const override
Definition: edge_edge2.h:119
A geometric point in (x,y,z) space.
Definition: point.h:38
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:76
uint8_t dof_id_type
Definition: id_types.h:64