libMesh
edge.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_H
21 #define LIBMESH_EDGE_H
22 
23 // Local includes
24 #include "libmesh/elem.h"
25 
26 namespace libMesh
27 {
28 
37 class Edge : public Elem
38 {
39 public:
40 
45  Edge (const unsigned int nn,
46  Elem * p,
47  Node ** nodelinkdata) :
48  Elem(nn, Edge::n_sides(), p, _elemlinks_data, nodelinkdata)
49  {
50  // Make sure the interior parent isn't undefined
51  if (LIBMESH_DIM > 1)
53  }
54 
58  virtual unsigned int dim () const libmesh_override { return 1; }
59 
63  virtual unsigned int n_nodes() const libmesh_override { return 2; }
64 
68  virtual unsigned int n_sides() const libmesh_override { return 2; }
69 
73  virtual unsigned int n_vertices() const libmesh_override { return 2; }
74 
78  virtual unsigned int n_edges() const libmesh_override { return 0; }
79 
83  virtual unsigned int n_faces() const libmesh_override { return 0; }
84 
88  virtual unsigned int n_children() const libmesh_override { return 2; }
89 
93  virtual bool is_child_on_side(const unsigned int c,
94  const unsigned int s) const libmesh_override;
95 
99  virtual bool is_edge_on_side(const unsigned int,
100  const unsigned int) const libmesh_override
101  { return false; }
102 
107  virtual unsigned int opposite_side(const unsigned int s) const libmesh_override;
108 
114  virtual unsigned int opposite_node(const unsigned int n,
115  const unsigned int s) const libmesh_override;
116 
120  using Elem::key;
121 
127  virtual dof_id_type key (const unsigned int s) const libmesh_override
128  { return this->compute_key(this->node_id(s)); }
129 
133  virtual unsigned int which_node_am_i(unsigned int side,
134  unsigned int /*side_node*/) const libmesh_override;
135 
139  virtual UniquePtr<Elem> side_ptr (const unsigned int i) libmesh_override;
140 
144  virtual UniquePtr<Elem> build_side_ptr (const unsigned int i,
145  bool proxy) libmesh_override;
146 
150  virtual UniquePtr<Elem> build_edge_ptr (const unsigned int) libmesh_override
151  { libmesh_not_implemented(); return UniquePtr<Elem>(); }
152 
153 
154 protected:
155 
159  Elem * _elemlinks_data[3+(LIBMESH_DIM>1)];
160 
161 #ifdef LIBMESH_ENABLE_AMR
162 
166  unsigned int side_children_matrix (const unsigned int,
167  const unsigned int) const
168  { libmesh_not_implemented(); return 0; }
169 
170 #endif
171 
172 };
173 
174 } // namespace libMesh
175 
176 #endif // LIBMESH_EDGE_H
virtual unsigned int n_children() const libmesh_override
Definition: edge.h:88
unsigned int side_children_matrix(const unsigned int, const unsigned int) const
Matrix that allows children to inherit boundary conditions.
Definition: edge.h:166
A Node is like a Point, but with more information.
Definition: node.h:52
Edge(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default line element, takes number of nodes and parent.
Definition: edge.h:45
Elem * _elemlinks_data[3+(LIBMESH_DIM >1)]
Data for links to parent/neighbor/interior_parent elements.
Definition: edge.h:159
virtual unsigned int n_nodes() const libmesh_override
Definition: edge.h:63
virtual unsigned int n_faces() const libmesh_override
Definition: edge.h:83
UniquePtr< Elem > side(const unsigned int i) const
Definition: elem.h:2105
virtual dof_id_type key(const unsigned int s) const libmesh_override
Definition: edge.h:127
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
virtual UniquePtr< Elem > side_ptr(const unsigned int i) libmesh_override
Definition: edge.C:36
const class libmesh_nullptr_t libmesh_nullptr
virtual unsigned int n_sides() const libmesh_override
Definition: edge.h:68
virtual UniquePtr< Elem > build_edge_ptr(const unsigned int) libmesh_override
The Elem::build_edge_ptr() member makes no sense for edges.
Definition: edge.h:150
The libMesh namespace provides an interface to certain functionality in the library.
virtual unsigned int which_node_am_i(unsigned int side, unsigned int) const libmesh_override
Definition: edge.C:27
void set_interior_parent(Elem *p)
Sets the pointer to the element&#39;s interior_parent.
Definition: elem.C:1003
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual unsigned int opposite_node(const unsigned int n, const unsigned int s) const libmesh_override
Definition: edge.C:75
virtual bool is_edge_on_side(const unsigned int, const unsigned int) const libmesh_override
Definition: edge.h:99
virtual dof_id_type key() const
Definition: elem.C:503
virtual unsigned int n_vertices() const libmesh_override
Definition: edge.h:73
virtual unsigned int dim() const libmesh_override
Definition: edge.h:58
virtual UniquePtr< Elem > build_side_ptr(const unsigned int i, bool proxy) libmesh_override
Definition: edge.C:46
The Edge is an element in 1D.
Definition: edge.h:37
virtual unsigned int opposite_side(const unsigned int s) const libmesh_override
Definition: edge.C:67
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1831
virtual unsigned int n_edges() const libmesh_override
Definition: edge.h:78
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:2621
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const libmesh_override
Definition: edge.C:56
uint8_t dof_id_type
Definition: id_types.h:64