libMesh
face_tri.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 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 unsigned int s) const override;
127 
133  virtual dof_id_type key () const override final;
134 
138  virtual unsigned int which_node_am_i(unsigned int side,
139  unsigned int side_node) const override;
140 
144  virtual std::unique_ptr<Elem> side_ptr (const unsigned int i) override final;
145 
149  virtual void side_ptr (std::unique_ptr<Elem> & elem,
150  const unsigned int i) override final;
151 
156  virtual Real quality (const ElemQuality q) const override;
157 
163  virtual std::pair<Real, Real> qual_bounds (const ElemQuality q) const override;
164 
165 
166 protected:
167 
171  Elem * _elemlinks_data[4+(LIBMESH_DIM>2)];
172 
176  static const Real _master_points[6][3];
177 };
178 
179 } // namespace libMesh
180 
181 #endif // LIBMESH_FACE_TRI_H
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
The Face is an abstract element type that lives in two dimensions.
Definition: face.h:37
virtual dof_id_type key() const
This is the base class from which all geometric element types are derived.
Definition: elem.h:101
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 which_node_am_i(unsigned int side, unsigned int side_node) const override
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.
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override final
virtual unsigned int n_sides() const override final
Definition: face_tri.h:92
Tri & operator=(const Tri &)=delete
virtual Real quality(const ElemQuality q) const override
virtual dof_id_type key() const override final
ElemQuality
Defines an enum for element quality metrics.
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
virtual std::pair< Real, Real > qual_bounds(const ElemQuality q) const override
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const override final
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const Real _master_points[6][3]
Master element node locations.
Definition: face_tri.h:176
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:171
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
virtual unsigned int n_edges() const override final
Definition: face_tri.h:102
uint8_t dof_id_type
Definition: id_types.h:67