face_tri.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override final
Definition: face_tri.C:81
static const Real _master_points[6][3]
Definition: face_tri.h:176
Tri(const unsigned int nn, Elem *p, Node **nodelinkdata)
Definition: face_tri.h:55
A geometric point in (x,y,z) space associated with a DOF.
Definition: node.h:52
The base class for all 2D geometric element types.
Definition: face.h:37
virtual dof_id_type key() const
Definition: elem.C:401
The base class for all geometric element types.
Definition: elem.h:100
The base class for all triangular element types.
Definition: face_tri.h:47
virtual unsigned int n_vertices() const override final
Definition: face_tri.h:97
virtual ~Tri()=default
virtual unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const override
Definition: face_tri.C:61
void set_interior_parent(Elem *p)
Definition: elem.C:856
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:103
virtual dof_id_type key() const override final
Definition: face_tri.C:72
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:166
virtual unsigned int n_children() const override final
Definition: face_tri.h:107
Elem * _elemlinks_data[4+(LIBMESH_DIM >2)]
Definition: face_tri.h:171
virtual Real quality(const ElemQuality q) const override
Definition: face_tri.C:114
A geometric point in (x,y,z) space.
Definition: point.h:38
virtual unsigned int n_edges() const override final
Definition: face_tri.h:102
std::unique_ptr< Elem > side(const unsigned int i) const
Definition: elem.h:2202
uint8_t dof_id_type
Definition: id_types.h:64