libMesh
face_tri.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 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_FACE_TRI_H
21 #define LIBMESH_FACE_TRI_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/face.h"
26 
27 namespace libMesh
28 {
29 
47 class Tri : public Face
48 {
49 public:
50 
55  Tri (const unsigned int nn,
56  Elem * p,
57  Node ** nodelinkdata) :
58  Face(nn, Tri::n_sides(), p, _elemlinks_data, nodelinkdata)
59  {
60  // Make sure the interior parent isn't undefined
61  if (LIBMESH_DIM > 2)
62  this->set_interior_parent(nullptr);
63  }
64 
65  Tri (Tri &&) = delete;
66  Tri (const Tri &) = delete;
67  Tri & operator= (const Tri &) = delete;
68  Tri & operator= (Tri &&) = delete;
69  virtual ~Tri() = default;
70 
75  virtual Point master_point (const unsigned int i) const override final
76  {
77  libmesh_assert_less(i, this->n_nodes());
78  return Point(_master_points[i][0],
79  _master_points[i][1],
80  _master_points[i][2]);
81  }
82 
87  virtual unsigned int n_nodes() const override { return 3; }
88 
92  virtual unsigned int n_sides() const override final { return 3; }
93 
97  virtual unsigned int n_vertices() const override final { return 3; }
98 
102  virtual unsigned int n_edges() const override final { return 3; }
103 
107  virtual unsigned int n_children() const override final { return 4; }
108 
113  virtual bool is_child_on_side(const unsigned int c,
114  const unsigned int s) const override final;
115 
119  using Elem::key;
120 
126  virtual dof_id_type key () const override final;
127 
132  virtual dof_id_type key (const unsigned int s) const override;
133 
140  virtual dof_id_type low_order_key (const unsigned int s) const override;
141 
145  virtual unsigned int local_side_node(unsigned int side,
146  unsigned int side_node) const override;
147 
153  virtual unsigned int local_edge_node(unsigned int edge,
154  unsigned int edge_node) const override;
155 
159  virtual std::unique_ptr<Elem> side_ptr (const unsigned int i) override final;
160 
164  virtual void side_ptr (std::unique_ptr<Elem> & elem,
165  const unsigned int i) override final;
166 
171  virtual Real quality (const ElemQuality q) const override;
172 
178  virtual std::pair<Real, Real> qual_bounds (const ElemQuality q) const override;
179 
183  virtual unsigned int n_permutations() const override final { return 3; }
184 
185  virtual bool is_flipped() const override final;
186 
187 protected:
188 
192  Elem * _elemlinks_data[4+(LIBMESH_DIM>2)];
193 
197  static const Real _master_points[6][3];
198 };
199 
200 } // namespace libMesh
201 
202 #endif // LIBMESH_FACE_TRI_H
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override final
Definition: face_tri.C:102
static const Real _master_points[6][3]
Master element node locations.
Definition: face_tri.h:197
Tri(const unsigned int nn, Elem *p, Node **nodelinkdata)
Default triangular element, takes number of nodes and parent.
Definition: face_tri.h:55
A Node is like a Point, but with more information.
Definition: node.h:52
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const override
Calls local_side_node(edge, edge_node).
Definition: face_tri.C:85
The Face is an abstract element type that lives in two dimensions.
Definition: face.h:37
virtual dof_id_type key() const
Definition: elem.C:563
virtual bool is_flipped() const override final
Definition: face_tri.C:134
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
The Tri is an element in 2D composed of 3 sides.
Definition: face_tri.h:47
virtual unsigned int n_vertices() const override final
Definition: face_tri.h:97
virtual unsigned int n_permutations() const override final
Three sides, one orientation each.
Definition: face_tri.h:183
virtual ~Tri()=default
The libMesh namespace provides an interface to certain functionality in the library.
void set_interior_parent(Elem *p)
Sets the pointer to the element&#39;s interior_parent.
Definition: elem.C:1056
virtual unsigned int n_sides() const override final
Definition: face_tri.h:92
Tri & operator=(const Tri &)=delete
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override final
Definition: face_tri.C:124
virtual dof_id_type key() const override final
Definition: face_tri.C:93
virtual dof_id_type low_order_key(const unsigned int s) const override
Definition: face_tri.C:64
ElemQuality
Defines an enum for element quality metrics.
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const override
Definition: face_tri.C:74
virtual Point master_point(const unsigned int i) const override final
Definition: face_tri.h:75
virtual unsigned int n_nodes() const override
Definition: face_tri.h:87
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::pair< Real, Real > qual_bounds(const ElemQuality q) const override
Definition: face_tri.C:240
virtual unsigned int n_children() const override final
Definition: face_tri.h:107
Elem * _elemlinks_data[4+(LIBMESH_DIM >2)]
Data for links to parent/neighbor/interior_parent elements.
Definition: face_tri.h:192
virtual Real quality(const ElemQuality q) const override
Definition: face_tri.C:150
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
virtual unsigned int n_edges() const override final
Definition: face_tri.h:102
uint8_t dof_id_type
Definition: id_types.h:67