cell_tet.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 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_CELL_TET_H
21 #define LIBMESH_CELL_TET_H
22 
23 // Local includes
24 #include "libmesh/cell.h"
25 
26 namespace libMesh
27 {
28 
29 
30 
31 
36 // ------------------------------------------------------------
37 // Tet class definition
38 class Tet : public Cell
39 {
40 public:
41 
46  Tet (const unsigned int nn, Elem* p, Node** nodelinkdata);
47 
51  unsigned int n_sides() const { return 4; }
52 
56  unsigned int n_vertices() const { return 4; }
57 
61  unsigned int n_edges() const { return 6; }
62 
66  unsigned int n_faces() const { return 4; }
67 
71  unsigned int n_children() const { return 8; }
72 
73  /*
74  * @returns true iff the specified edge is on the specified side
75  */
76  virtual bool is_edge_on_side(const unsigned int e,
77  const unsigned int s) const;
78 
84  dof_id_type key (const unsigned int s) const;
85 
90  AutoPtr<Elem> side (const unsigned int i) const;
91 
96  Real quality (const ElemQuality q) const;
97 
103  std::pair<Real, Real> qual_bounds (const ElemQuality q) const;
104 
111  enum Diagonal
112  {
113  DIAG_02_13=0, // diagonal between edges (0,2) and (1,3)
114  DIAG_03_12=1, // diagonal between edges (0,3) and (1,2)
115  DIAG_01_23=2, // diagonal between edges (0,1) and (2,3)
116  INVALID_DIAG=99 // diagonal not yet selected
117  };
118 
123 
128  void select_diagonal (const Diagonal diag) const;
129 
130 protected:
131 
135  Elem* _elemlinks_data[5+(LIBMESH_DIM>3)];
136 
141  bool is_child_on_side_helper(const unsigned int c,
142  const unsigned int s,
143  const unsigned int checked_nodes[][3] ) const;
144 
150 
156  void choose_diagonal() const;
157 
158 };
159 
160 
161 
162 // ------------------------------------------------------------
163 // Tet class member functions
164 inline
165 Tet::Tet(const unsigned int nn, Elem* p, Node** nodelinkdata) :
166  Cell(nn, Tet::n_sides(), p, _elemlinks_data, nodelinkdata)
167  , _diagonal_selection(INVALID_DIAG)
168 {
169 }
170 
171 } // namespace libMesh
172 
173 #endif // LIBMESH_CELL_TET_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:04 UTC

Hosted By:
SourceForge.net Logo