libMesh
edge_edge4.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_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
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::Edge4::volume
virtual Real volume() const override
An optimized method for approximating the length of an EDGE4 using quadrature.
Definition: edge_edge4.C:215
libMesh::EDGE4
Definition: enum_elem_type.h:37
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::Edge4::n_sub_elem
virtual unsigned int n_sub_elem() const override
Definition: edge_edge4.h:81
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::Edge4::is_vertex
virtual bool is_vertex(const unsigned int i) const override
Definition: edge_edge4.C:58
libMesh::Edge4::has_affine_map
virtual bool has_affine_map() const override
Definition: edge_edge4.C:90
libMesh::Edge4::master_point
virtual Point master_point(const unsigned int i) const override
Definition: edge_edge4.h:65
libMesh::Edge4::infinite
virtual bool infinite() const override
Definition: edge_edge4.h:156
libMesh::Edge4::Edge4
Edge4(Elem *p=nullptr)
Constructor.
Definition: edge_edge4.h:52
libMesh::Edge
The Edge is an element in 1D.
Definition: edge.h:37
libMesh::Edge4::default_order
virtual Order default_order() const override
Definition: edge_edge4.C:103
libMesh::Edge4::second_order_adjacent_vertex
virtual unsigned short int second_order_adjacent_vertex(const unsigned int, const unsigned int) const override
FIXME: This function could be generalized to work for Edges.
Definition: edge_edge4.h:141
libMesh::Edge4::_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_edge4.h:207
libMesh::Edge4::num_children
static const int num_children
Definition: edge_edge4.h:182
libMesh::Edge4::is_node_on_edge
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const override
Definition: edge_edge4.C:81
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::Edge4::n_nodes
virtual unsigned int n_nodes() const override
Definition: edge_edge4.h:76
libMesh::Edge4::is_node_on_side
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const override
Definition: edge_edge4.C:73
libMesh::Edge4::LIBMESH_ENABLE_TOPOLOGY_CACHES
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: edge_edge4.h:209
libMesh::Node
A Node is like a Point, but with more information.
Definition: node.h:52
libMesh::Edge4::loose_bounding_box
virtual BoundingBox loose_bounding_box() const override
Definition: edge_edge4.C:180
libMesh::Edge4::num_nodes
static const int num_nodes
Geometric constants for Edge4.
Definition: edge_edge4.h:181
libMesh::Edge4::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_edge4.h:198
libMesh::Edge4::key
virtual dof_id_type key() const override
Definition: edge_edge4.C:205
libMesh::Edge4::connectivity
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const override
Definition: edge_edge4.C:110
libMesh::Edge4::is_face
virtual bool is_face(const unsigned int i) const override
Definition: edge_edge4.C:68
libMesh::Edge4::is_edge
virtual bool is_edge(const unsigned int i) const override
Definition: edge_edge4.C:63
libMesh::Edge4::_nodelinks_data
Node * _nodelinks_data[num_nodes]
Data for links to nodes.
Definition: edge_edge4.h:189
libMesh::Edge4::type
virtual ElemType type() const override
Definition: edge_edge4.h:121
libMesh::Elem
This is the base class from which all geometric element types are derived.
Definition: elem.h:100
libMesh::Edge4
The Edge4 is an element in 1D composed of 4 nodes.
Definition: edge_edge4.h:44
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::Edge4::~Edge4
virtual ~Edge4()=default
libMesh::Edge4::n_second_order_adjacent_vertices
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int) const override
FIXME: This function could be generalized to work for Edges.
Definition: edge_edge4.h:135
libMesh::Edge4::operator=
Edge4 & operator=(const Edge4 &)=delete
libMesh::ElemType
ElemType
Defines an enum for geometric element types.
Definition: enum_elem_type.h:33