edge_edge4.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_EDGE4_H
21 #define LIBMESH_EDGE_EDGE4_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/edge.h"
26 
27 namespace libMesh
28 {
29 
44 class Edge4 final : public Edge
45 {
46 public:
47 
51  explicit
52  Edge4 (Elem * p=nullptr) :
54 
55  Edge4 (Edge4 &&) = delete;
56  Edge4 (const Edge4 &) = delete;
57  Edge4 & operator= (const Edge4 &) = delete;
58  Edge4 & operator= (Edge4 &&) = delete;
59  virtual ~Edge4() = default;
60 
65  virtual Point master_point (const unsigned int i) const override
66  {
67  libmesh_assert_less(i, this->n_nodes());
68  if (i < 2)
69  return Point(2.0f*Real(i)-1.0f,0,0);
70  return Point((Real(2)*Real(i)-5)/3,0,0);
71  }
72 
76  virtual unsigned int n_nodes() const override { return num_nodes; }
77 
81  virtual unsigned int n_sub_elem() const override { return 2; }
82 
86  virtual bool is_vertex(const unsigned int i) const override;
87 
91  virtual bool is_edge(const unsigned int i) const override;
92 
96  virtual bool is_face(const unsigned int i) const override;
97 
102  virtual bool is_node_on_side(const unsigned int n,
103  const unsigned int s) const override;
104 
109  virtual bool is_node_on_edge(const unsigned int n,
110  const unsigned int e) const override;
111 
116  virtual bool has_affine_map () const override;
117 
121  virtual ElemType type() const override { return EDGE4; }
122 
126  virtual Order default_order() const override;
127 
128  virtual void connectivity(const unsigned int sc,
129  const IOPackage iop,
130  std::vector<dof_id_type> & conn) const override;
131 
135  virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const override
136  { libmesh_not_implemented(); return 0; }
137 
141  virtual unsigned short int second_order_adjacent_vertex (const unsigned int,
142  const unsigned int) const override
143  { libmesh_not_implemented(); return 0; }
144 
149  virtual BoundingBox loose_bounding_box () const override;
150 
151 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
152 
156  virtual bool infinite () const override { return false; }
157 
158 #endif
159 
163  using Edge::key;
164 
170  virtual dof_id_type key () const override;
171 
176  virtual Real volume () const override;
177 
181  static const int num_nodes = 4;
182  static const int num_children = 2;
183 
184 protected:
185 
190 
191 
192 
193 #ifdef LIBMESH_ENABLE_AMR
194 
198  virtual float embedding_matrix (const unsigned int i,
199  const unsigned int j,
200  const unsigned int k) const override
201  { return _embedding_matrix[i][j][k]; }
202 
208 
210 
211 #endif // LIBMESH_ENABLE_AMR
212 
213 };
214 
215 } // namespace libMesh
216 
217 
218 #endif // LIBMESH_EDGE_EDGE4_H
static const int num_children
Definition: edge_edge4.h:182
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
Definition: edge_edge4.C:73
virtual unsigned int n_nodes() const override
Definition: edge_edge4.h:76
A geometric point in (x,y,z) space associated with a DOF.
Definition: node.h:52
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition: edge_edge4.C:110
virtual BoundingBox loose_bounding_box() const override
Definition: edge_edge4.C:180
virtual dof_id_type key() const
Definition: elem.C:401
virtual bool is_edge(const unsigned int i) const override
Definition: edge_edge4.C:63
static const int num_nodes
Definition: edge_edge4.h:181
virtual float embedding_matrix(const unsigned int i, const unsigned int j, const unsigned int k) const override
Definition: edge_edge4.h:198
virtual dof_id_type key() const override
Definition: edge_edge4.C:205
The base class for all geometric element types.
Definition: elem.h:100
virtual bool is_face(const unsigned int i) const override
Definition: edge_edge4.C:68
virtual ElemType type() const override
Definition: edge_edge4.h:121
Node * _nodelinks_data[num_nodes]
Definition: edge_edge4.h:189
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int) const override
Definition: edge_edge4.h:135
virtual ~Edge4()=default
Edge4 & operator=(const Edge4 &)=delete
virtual unsigned int n_sub_elem() const override
Definition: edge_edge4.h:81
virtual Real volume() const override
Definition: edge_edge4.C:215
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool is_vertex(const unsigned int i) const override
Definition: edge_edge4.C:58
virtual Point master_point(const unsigned int i) const override
Definition: edge_edge4.h:65
virtual bool infinite() const override
Definition: edge_edge4.h:156
A 1D geometric element with 4 nodes.
Definition: edge_edge4.h:44
The base class for all 1D geometric element types.
Definition: edge.h:37
virtual bool has_affine_map() const override
Definition: edge_edge4.C:90
virtual Order default_order() const override
Definition: edge_edge4.C:103
Edge4(Elem *p=nullptr)
Definition: edge_edge4.h:52
static const float _embedding_matrix[num_children][num_nodes][num_nodes]
Definition: edge_edge4.h:207
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
Definition: edge_edge4.C:81
A geometric point in (x,y,z) space.
Definition: point.h:38
virtual unsigned short int second_order_adjacent_vertex(const unsigned int, const unsigned int) const override
Definition: edge_edge4.h:141
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: edge_edge4.h:209
uint8_t dof_id_type
Definition: id_types.h:64