libMesh
edge_edge4.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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 libmesh_final : public Edge
45 {
46 public:
47 
51  explicit
53  Edge(Edge4::n_nodes(), p, _nodelinks_data) {}
54 
59  virtual Point master_point (const unsigned int i) const libmesh_override
60  {
61  libmesh_assert_less(i, this->n_nodes());
62  if (i < 2)
63  return Point(2.0f*i-1,0,0);
64  return Point((Real(2)*i-5)/3,0,0);
65  }
66 
70  virtual unsigned int n_nodes() const libmesh_override { return 4; }
71 
75  virtual unsigned int n_sub_elem() const libmesh_override { return 2; }
76 
80  virtual bool is_vertex(const unsigned int i) const libmesh_override;
81 
85  virtual bool is_edge(const unsigned int i) const libmesh_override;
86 
90  virtual bool is_face(const unsigned int i) const libmesh_override;
91 
96  virtual bool is_node_on_side(const unsigned int n,
97  const unsigned int s) const libmesh_override;
98 
103  virtual bool is_node_on_edge(const unsigned int n,
104  const unsigned int e) const libmesh_override;
105 
110  virtual bool has_affine_map () const libmesh_override;
111 
115  virtual ElemType type() const libmesh_override { return EDGE4; }
116 
120  virtual Order default_order() const libmesh_override { return THIRD; }
121 
122  virtual void connectivity(const unsigned int sc,
123  const IOPackage iop,
124  std::vector<dof_id_type> & conn) const libmesh_override;
125 
129  virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const libmesh_override
130  { libmesh_not_implemented(); return 0; }
131 
135  virtual unsigned short int second_order_adjacent_vertex (const unsigned int,
136  const unsigned int) const libmesh_override
137  { libmesh_not_implemented(); return 0; }
138 
143  virtual BoundingBox loose_bounding_box () const libmesh_override;
144 
145 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
146 
150  virtual bool infinite () const libmesh_override { return false; }
151 
152 #endif
153 
157  using Edge::key;
158 
164  virtual dof_id_type key () const libmesh_override;
165 
170  virtual Real volume () const libmesh_override;
171 
172 protected:
173 
177  Node * _nodelinks_data[4];
178 
179 
180 
181 #ifdef LIBMESH_ENABLE_AMR
182 
186  virtual float embedding_matrix (const unsigned int i,
187  const unsigned int j,
188  const unsigned int k) const libmesh_override
189  { return _embedding_matrix[i][j][k]; }
190 
195  static const float _embedding_matrix[2][4][4];
196 
197  LIBMESH_ENABLE_TOPOLOGY_CACHES;
198 
199 #endif // LIBMESH_ENABLE_AMR
200 
201 };
202 
203 } // namespace libMesh
204 
205 
206 #endif // LIBMESH_EDGE_EDGE4_H
virtual float embedding_matrix(const unsigned int i, const unsigned int j, const unsigned int k) const libmesh_override
Matrix used to create the elements children.
Definition: edge_edge4.h:186
A Node is like a Point, but with more information.
Definition: node.h:52
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int) const libmesh_override
FIXME: This function could be generalized to work for Edges.
Definition: edge_edge4.h:129
ElemType
Defines an enum for geometric element types.
virtual Point master_point(const unsigned int i) const libmesh_override
Definition: edge_edge4.h:59
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
const class libmesh_nullptr_t libmesh_nullptr
The libMesh namespace provides an interface to certain functionality in the library.
virtual unsigned int n_nodes() const libmesh_override
Definition: edge_edge4.h:70
const dof_id_type n_nodes
Definition: tecplot_io.C:67
virtual dof_id_type key() const
Definition: elem.C:503
virtual ElemType type() const libmesh_override
Definition: edge_edge4.h:115
virtual unsigned short int second_order_adjacent_vertex(const unsigned int, const unsigned int) const libmesh_override
FIXME: This function could be generalized to work for Edges.
Definition: edge_edge4.h:135
Defines a Cartesian bounding box by the two corner extremum.
Definition: bounding_box.h:40
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Order default_order() const libmesh_override
Definition: edge_edge4.h:120
Order
defines an enum for polynomial orders.
Definition: enum_order.h:32
The Edge is an element in 1D.
Definition: edge.h:37
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
virtual bool infinite() const libmesh_override
Definition: edge_edge4.h:150
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
Edge4(Elem *p=libmesh_nullptr)
Constructor.
Definition: edge_edge4.h:52
virtual unsigned int n_sub_elem() const libmesh_override
Definition: edge_edge4.h:75
uint8_t dof_id_type
Definition: id_types.h:64