libMesh
edge_edge2.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_EDGE2_H
21 #define LIBMESH_EDGE_EDGE2_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/edge.h"
26 
27 namespace libMesh
28 {
29 
43 class Edge2 : 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  return Point(2.0f*i-1,0,0);
62  }
63 
67  virtual unsigned int n_sub_elem() const libmesh_override { return 1; }
68 
72  virtual bool is_vertex(const unsigned int i) const libmesh_override;
73 
77  virtual bool is_edge(const unsigned int i) const libmesh_override;
78 
82  virtual bool is_face(const unsigned int i) const libmesh_override;
83 
88  virtual bool is_node_on_side(const unsigned int n,
89  const unsigned int s) const libmesh_override;
90 
95  virtual bool is_node_on_edge(const unsigned int n,
96  const unsigned int e) const libmesh_override;
97 
102  virtual bool has_affine_map () const libmesh_override { return true; }
103 
108  virtual bool is_linear () const libmesh_override { return true; }
109 
113  virtual ElemType type() const libmesh_override { return EDGE2; }
114 
118  virtual Order default_order() const libmesh_override { return FIRST; }
119 
120  virtual void connectivity(const unsigned int sc,
121  const IOPackage iop,
122  std::vector<dof_id_type> & conn) const libmesh_override;
123 
127  virtual Real volume () const libmesh_override;
128 
129 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
130 
134  virtual bool infinite () const libmesh_override { return false; }
135 
136 #endif
137 
141  using Edge::key;
142 
148  virtual dof_id_type key () const libmesh_override;
149 
150 protected:
151 
156 
157 
158 
159 #ifdef LIBMESH_ENABLE_AMR
160 
164  virtual float embedding_matrix (const unsigned int i,
165  const unsigned int j,
166  const unsigned int k) const libmesh_override
167  { return _embedding_matrix[i][j][k]; }
168 
173  static const float _embedding_matrix[2][2][2];
174 
176 
177 #endif // LIBMESH_ENABLE_AMR
178 
179 };
180 
181 } // namespace libMesh
182 
183 
184 #endif // LIBMESH_EDGE_EDGE2_H
A Node is like a Point, but with more information.
Definition: node.h:52
virtual Order default_order() const libmesh_override
Definition: edge_edge2.h:118
virtual unsigned int n_nodes() const libmesh_override
Definition: edge.h:63
virtual bool is_face(const unsigned int i) const libmesh_override
Definition: edge_edge2.C:58
virtual unsigned int n_sub_elem() const libmesh_override
Definition: edge_edge2.h:67
ElemType
Defines an enum for geometric element types.
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const libmesh_override
Definition: edge_edge2.C:70
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
virtual bool is_edge(const unsigned int i) const libmesh_override
Definition: edge_edge2.C:53
virtual dof_id_type key() const libmesh_override
Definition: edge_edge2.C:119
const class libmesh_nullptr_t libmesh_nullptr
virtual bool infinite() const libmesh_override
Definition: edge_edge2.h:134
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_edge2.h:164
The libMesh namespace provides an interface to certain functionality in the library.
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const libmesh_override
Definition: edge_edge2.C:63
LIBMESH_ENABLE_TOPOLOGY_CACHES
Definition: edge_edge2.h:175
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const libmesh_override
Definition: edge_edge2.C:77
virtual bool is_linear() const libmesh_override
Definition: edge_edge2.h:108
Node * _nodelinks_data[2]
Data for links to nodes.
Definition: edge_edge2.h:155
virtual dof_id_type key() const
Definition: elem.C:503
static const float _embedding_matrix[2][2][2]
Matrix that computes new nodal locations/solution values from current nodes/solution.
Definition: edge_edge2.h:173
virtual bool is_vertex(const unsigned int i) const libmesh_override
Definition: edge_edge2.C:48
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Point master_point(const unsigned int i) const libmesh_override
Definition: edge_edge2.h:58
Order
defines an enum for polynomial orders.
Definition: enum_order.h:32
The Edge2 is an element in 1D composed of 2 nodes.
Definition: edge_edge2.h:43
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.
Edge2(Elem *p=libmesh_nullptr)
Constructor.
Definition: edge_edge2.h:51
virtual bool has_affine_map() const libmesh_override
Definition: edge_edge2.h:102
virtual Real volume() const libmesh_override
An optimized method for computing the length of a 2-node edge.
Definition: edge_edge2.C:110
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
virtual ElemType type() const libmesh_override
Definition: edge_edge2.h:113
uint8_t dof_id_type
Definition: id_types.h:64