libMesh
edge_edge3.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_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
53 
58  virtual Point master_point (const unsigned int i) const libmesh_override
59  {
60  libmesh_assert_less(i, this->n_nodes());
61  if (i < 2)
62  return Point(2.0f*i-1,0,0);
63  return Point(0,0,0);
64  }
65 
69  virtual unsigned int n_nodes() const libmesh_override { return 3; }
70 
74  virtual unsigned int n_sub_elem() const libmesh_override { return 2; }
75 
79  virtual bool is_vertex(const unsigned int i) const libmesh_override;
80 
84  virtual bool is_edge(const unsigned int i) const libmesh_override;
85 
89  virtual bool is_face(const unsigned int i) const libmesh_override;
90 
95  virtual bool is_node_on_side(const unsigned int n,
96  const unsigned int s) const libmesh_override;
97 
102  virtual bool is_node_on_edge(const unsigned int n,
103  const unsigned int e) const libmesh_override;
104 
109  virtual bool has_affine_map () const libmesh_override;
110 
114  virtual ElemType type() const libmesh_override { return EDGE3; }
115 
119  virtual Order default_order() const libmesh_override { return SECOND; }
120 
121  virtual void connectivity(const unsigned int sc,
122  const IOPackage iop,
123  std::vector<dof_id_type> & conn) const libmesh_override;
124 
128  virtual unsigned int n_second_order_adjacent_vertices (const unsigned int) const libmesh_override
129  { return 2; }
130 
135  virtual unsigned short int second_order_adjacent_vertex (const unsigned int,
136  const unsigned int v) const libmesh_override
137  { return static_cast<unsigned short int>(v); }
138 
144  virtual std::pair<unsigned short int, unsigned short int>
145  second_order_child_vertex (const unsigned int n) const libmesh_override;
146 
150  virtual Real volume () const libmesh_override;
151 
156  virtual BoundingBox loose_bounding_box () const libmesh_override;
157 
158 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
159 
163  virtual bool infinite () const libmesh_override { return false; }
164 
165 #endif
166 
170  using Edge::key;
171 
178  virtual dof_id_type key () const libmesh_override;
179 
180 
181 protected:
182 
187 
188 
189 
190 #ifdef LIBMESH_ENABLE_AMR
191 
195  virtual float embedding_matrix (const unsigned int i,
196  const unsigned int j,
197  const unsigned int k) const libmesh_override
198  { return _embedding_matrix[i][j][k]; }
199 
204  static const float _embedding_matrix[2][3][3];
205 
207 
208 #endif // LIBMESH_ENABLE_AMR
209 
210 };
211 
212 } // namespace libMesh
213 
214 
215 #endif // LIBMESH_EDGE_EDGE3_H
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const libmesh_override
Definition: edge_edge3.C:93
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: edge_edge3.h:206
A Node is like a Point, but with more information.
Definition: node.h:52
virtual bool is_face(const unsigned int i) const libmesh_override
Definition: edge_edge3.C:63
Node * _nodelinks_data[3]
Data for links to nodes.
Definition: edge_edge3.h:186
virtual Real volume() const libmesh_override
An optimized method for computing the length of a 3-node edge.
Definition: edge_edge3.C:170
ElemType
Defines an enum for geometric element types.
Edge3(Elem *p=libmesh_nullptr)
Constructor.
Definition: edge_edge3.h:51
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
const class libmesh_nullptr_t libmesh_nullptr
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const libmesh_override
Definition: edge_edge3.C:76
The libMesh namespace provides an interface to certain functionality in the library.
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int) const libmesh_override
Definition: edge_edge3.h:128
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const libmesh_override
Definition: edge_edge3.C:163
virtual unsigned short int second_order_adjacent_vertex(const unsigned int, const unsigned int v) const libmesh_override
Definition: edge_edge3.h:135
virtual dof_id_type key() const
Definition: elem.C:503
virtual bool has_affine_map() const libmesh_override
Definition: edge_edge3.C:85
virtual bool is_edge(const unsigned int i) const libmesh_override
Definition: edge_edge3.C:56
virtual unsigned int n_nodes() const libmesh_override
Definition: edge_edge3.h:69
virtual Order default_order() const libmesh_override
Definition: edge_edge3.h:119
The Edge3 is an element in 1D composed of 3 nodes.
Definition: edge_edge3.h:43
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_edge3.h:195
virtual bool infinite() const libmesh_override
Definition: edge_edge3.h:163
Defines a Cartesian bounding box by the two corner extremum.
Definition: bounding_box.h:40
virtual unsigned int n_sub_elem() const libmesh_override
Definition: edge_edge3.h:74
virtual bool is_vertex(const unsigned int i) const libmesh_override
Definition: edge_edge3.C:49
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const float _embedding_matrix[2][3][3]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition: edge_edge3.h:204
virtual ElemType type() const libmesh_override
Definition: edge_edge3.h:114
virtual dof_id_type key() const libmesh_override
Compute a unique key for this element which is suitable for hashing (not necessarily unique...
Definition: edge_edge3.C:226
Order
defines an enum for polynomial orders.
Definition: enum_order.h:32
virtual Point master_point(const unsigned int i) const libmesh_override
Definition: edge_edge3.h:58
The Edge is an element in 1D.
Definition: edge.h:37
virtual BoundingBox loose_bounding_box() const libmesh_override
Definition: edge_edge3.C:204
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const libmesh_override
Definition: edge_edge3.C:68
uint8_t dof_id_type
Definition: id_types.h:64