libMesh
edge_edge3.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_EDGE3_H
21 #define LIBMESH_EDGE_EDGE3_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/edge.h"
26 
27 namespace libMesh
28 {
29 
43 class Edge3 : public Edge
44 {
45 public:
46 
50  explicit
51  Edge3 (Elem * p=nullptr) :
53 
54  Edge3 (Edge3 &&) = delete;
55  Edge3 (const Edge3 &) = delete;
56  Edge3 & operator= (const Edge3 &) = delete;
57  Edge3 & operator= (Edge3 &&) = delete;
58  virtual ~Edge3() = default;
59 
64  virtual Point master_point (const unsigned int i) const override
65  {
66  libmesh_assert_less(i, this->n_nodes());
67  if (i < 2)
68  return Point(2.0f*Real(i)-1.0f,0,0);
69  return Point(0,0,0);
70  }
71 
75  virtual unsigned int n_nodes() const override { return num_nodes; }
76 
80  virtual unsigned int n_sub_elem() const override { return 2; }
81 
85  virtual bool is_vertex(const unsigned int i) const override;
86 
90  virtual bool is_edge(const unsigned int i) const override;
91 
95  virtual bool is_face(const unsigned int i) const override;
96 
101  virtual bool is_node_on_side(const unsigned int n,
102  const unsigned int s) const override;
103 
108  virtual bool is_node_on_edge(const unsigned int n,
109  const unsigned int e) const override;
110 
115  virtual bool has_affine_map () const override;
116 
120  virtual ElemType type() const override { return EDGE3; }
121 
125  virtual Order default_order() const override;
126 
127  virtual void connectivity(const unsigned int sc,
128  const IOPackage iop,
129  std::vector<dof_id_type> & conn) const override;
130 
134  virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const override
135  { return 2; }
136 
141  virtual unsigned short int second_order_adjacent_vertex (const unsigned int,
142  const unsigned int v) const override
143  { return static_cast<unsigned short int>(v); }
144 
150  virtual std::pair<unsigned short int, unsigned short int>
151  second_order_child_vertex (const unsigned int n) const override;
152 
156  virtual Real volume () const override;
157 
162  virtual BoundingBox loose_bounding_box () const override;
163 
164 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
165 
169  virtual bool infinite () const override { return false; }
170 
171 #endif
172 
176  using Edge::key;
177 
184  virtual dof_id_type key () const override;
185 
189  static const int num_nodes = 3;
190  static const int num_children = 2;
191 
192 protected:
193 
198 
199 
200 
201 #ifdef LIBMESH_ENABLE_AMR
202 
206  virtual float embedding_matrix (const unsigned int i,
207  const unsigned int j,
208  const unsigned int k) const override
209  { return _embedding_matrix[i][j][k]; }
210 
216 
218 
219 #endif // LIBMESH_ENABLE_AMR
220 
221 };
222 
223 } // namespace libMesh
224 
225 
226 #endif // LIBMESH_EDGE_EDGE3_H
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::Edge3::is_edge
virtual bool is_edge(const unsigned int i) const override
Definition: edge_edge3.C:62
libMesh::IOPackage
IOPackage
libMesh interfaces with several different software packages for the purposes of creating,...
Definition: enum_io_package.h:37
libMesh::BoundingBox
Defines a Cartesian bounding box by the two corner extremum.
Definition: bounding_box.h:40
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::Order
Order
Definition: enum_order.h:40
libMesh::Edge3::~Edge3
virtual ~Edge3()=default
libMesh::Edge3::num_nodes
static const int num_nodes
Geometric constants for Edge3.
Definition: edge_edge3.h:189
libMesh::Edge
The Edge is an element in 1D.
Definition: edge.h:37
libMesh::Edge3::type
virtual ElemType type() const override
Definition: edge_edge3.h:120
libMesh::Edge3::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_edge3.h:206
libMesh::Edge3::key
virtual dof_id_type key() const override
Compute a unique key for this element which is suitable for hashing (not necessarily unique,...
Definition: edge_edge3.C:239
libMesh::Edge3::infinite
virtual bool infinite() const override
Definition: edge_edge3.h:169
libMesh::Edge3::LIBMESH_ENABLE_TOPOLOGY_CACHES
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: edge_edge3.h:217
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::Edge3::has_affine_map
virtual bool has_affine_map() const override
Definition: edge_edge3.C:91
libMesh::Node
A Node is like a Point, but with more information.
Definition: node.h:52
libMesh::Edge3::is_face
virtual bool is_face(const unsigned int i) const override
Definition: edge_edge3.C:69
libMesh::Edge3::is_vertex
virtual bool is_vertex(const unsigned int i) const override
Definition: edge_edge3.C:55
libMesh::Edge3::master_point
virtual Point master_point(const unsigned int i) const override
Definition: edge_edge3.h:64
libMesh::Edge3
The Edge3 is an element in 1D composed of 3 nodes.
Definition: edge_edge3.h:43
libMesh::Edge3::operator=
Edge3 & operator=(const Edge3 &)=delete
libMesh::Edge3::second_order_child_vertex
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const override
Definition: edge_edge3.C:176
libMesh::Edge3::loose_bounding_box
virtual BoundingBox loose_bounding_box() const override
Definition: edge_edge3.C:217
libMesh::Edge3::second_order_adjacent_vertex
virtual unsigned short int second_order_adjacent_vertex(const unsigned int, const unsigned int v) const override
Definition: edge_edge3.h:141
libMesh::Edge3::Edge3
Edge3(Elem *p=nullptr)
Constructor.
Definition: edge_edge3.h:51
libMesh::Edge3::n_second_order_adjacent_vertices
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int) const override
Definition: edge_edge3.h:134
libMesh::EDGE3
Definition: enum_elem_type.h:36
libMesh::Edge3::_nodelinks_data
Node * _nodelinks_data[num_nodes]
Data for links to nodes.
Definition: edge_edge3.h:197
libMesh::Edge3::is_node_on_edge
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
Definition: edge_edge3.C:82
libMesh::Edge3::is_node_on_side
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
Definition: edge_edge3.C:74
libMesh::Edge3::default_order
virtual Order default_order() const override
Definition: edge_edge3.C:99
libMesh::Edge3::n_sub_elem
virtual unsigned int n_sub_elem() const override
Definition: edge_edge3.h:80
libMesh::Elem
This is the base class from which all geometric element types are derived.
Definition: elem.h:100
libMesh::Edge3::num_children
static const int num_children
Definition: edge_edge3.h:190
libMesh::Edge3::volume
virtual Real volume() const override
An optimized method for computing the length of a 3-node edge.
Definition: edge_edge3.C:183
libMesh::Edge3::connectivity
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition: edge_edge3.C:106
libMesh::Edge3::n_nodes
virtual unsigned int n_nodes() const override
Definition: edge_edge3.h:75
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::Edge3::_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_edge3.h:215
libMesh::ElemType
ElemType
Defines an enum for geometric element types.
Definition: enum_elem_type.h:33