cell_tet.h
Go to the documentation of this file.00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2012 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 00020 #ifndef LIBMESH_CELL_TET_H 00021 #define LIBMESH_CELL_TET_H 00022 00023 // Local includes 00024 #include "libmesh/cell.h" 00025 00026 namespace libMesh 00027 { 00028 00029 00030 00031 00036 // ------------------------------------------------------------ 00037 // Tet class definition 00038 class Tet : public Cell 00039 { 00040 public: 00041 00046 Tet (const unsigned int nn, Elem* p, Node** nodelinkdata); 00047 00051 unsigned int n_sides() const { return 4; } 00052 00056 unsigned int n_vertices() const { return 4; } 00057 00061 unsigned int n_edges() const { return 6; } 00062 00066 unsigned int n_faces() const { return 4; } 00067 00071 unsigned int n_children() const { return 8; } 00072 00073 /* 00074 * @returns true iff the specified edge is on the specified side 00075 */ 00076 virtual bool is_edge_on_side(const unsigned int e, 00077 const unsigned int s) const; 00078 00084 dof_id_type key (const unsigned int s) const; 00085 00090 AutoPtr<Elem> side (const unsigned int i) const; 00091 00096 Real quality (const ElemQuality q) const; 00097 00103 std::pair<Real, Real> qual_bounds (const ElemQuality q) const; 00104 00111 enum Diagonal 00112 { 00113 DIAG_02_13=0, // diagonal between edges (0,2) and (1,3) 00114 DIAG_03_12=1, // diagonal between edges (0,3) and (1,2) 00115 DIAG_01_23=2, // diagonal between edges (0,1) and (2,3) 00116 INVALID_DIAG=99 // diagonal not yet selected 00117 }; 00118 00122 Diagonal diagonal_selection () const { return _diagonal_selection; } 00123 00128 void select_diagonal (const Diagonal diag) const; 00129 00130 protected: 00131 00135 Elem* _elemlinks_data[5+(LIBMESH_DIM>3)]; 00136 00141 bool is_child_on_side_helper(const unsigned int c, 00142 const unsigned int s, 00143 const unsigned int checked_nodes[][3] ) const; 00144 00149 mutable Diagonal _diagonal_selection; 00150 00156 void choose_diagonal() const; 00157 00158 }; 00159 00160 00161 00162 // ------------------------------------------------------------ 00163 // Tet class member functions 00164 inline 00165 Tet::Tet(const unsigned int nn, Elem* p, Node** nodelinkdata) : 00166 Cell(nn, Tet::n_sides(), p, _elemlinks_data, nodelinkdata) 00167 , _diagonal_selection(INVALID_DIAG) 00168 { 00169 } 00170 00171 } // namespace libMesh 00172 00173 #endif // LIBMESH_CELL_TET_H
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:45 UTC
Hosted By: