$extrastylesheet
cell_prism18.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 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_PRISM18_H
00021 #define LIBMESH_CELL_PRISM18_H
00022 
00023 // Local includes
00024 #include "libmesh/cell_prism.h"
00025 
00026 // C++ includes
00027 #include <cstddef>
00028 
00029 namespace libMesh
00030 {
00031 
00032 
00033 
00034 
00070 class Prism18 : public Prism
00071 {
00072 public:
00073 
00077   explicit
00078   Prism18  (Elem* p=NULL);
00079 
00083   ElemType     type () const   { return PRISM18; }
00084 
00088   unsigned int n_nodes() const { return 18; }
00089 
00093   unsigned int n_sub_elem() const { return 8; }
00094 
00098   virtual bool is_vertex(const unsigned int i) const;
00099 
00103   virtual bool is_edge(const unsigned int i) const;
00104 
00108   virtual bool is_face(const unsigned int i) const;
00109 
00110   /*
00111    * @returns true iff the specified (local) node number is on the
00112    * specified side
00113    */
00114   virtual bool is_node_on_side(const unsigned int n,
00115                                const unsigned int s) const;
00116 
00117   /*
00118    * @returns true iff the specified (local) node number is on the
00119    * specified edge
00120    */
00121   virtual bool is_node_on_edge(const unsigned int n,
00122                                const unsigned int e) const;
00123 
00124   /*
00125    * @returns true iff the element map is definitely affine within
00126    * numerical tolerances
00127    */
00128   virtual bool has_affine_map () const;
00129 
00133   Order default_order() const { return SECOND; }
00134 
00144   dof_id_type key (const unsigned int s) const;
00145 
00150   UniquePtr<Elem> build_side (const unsigned int i,
00151                               bool proxy) const;
00152 
00157   UniquePtr<Elem> build_edge (const unsigned int i) const;
00158 
00159   virtual void connectivity(const unsigned int sc,
00160                             const IOPackage iop,
00161                             std::vector<dof_id_type>& conn) const;
00162 
00166   unsigned int n_second_order_adjacent_vertices (const unsigned int) const;
00167 
00173   unsigned short int second_order_adjacent_vertex (const unsigned int n,
00174                                                    const unsigned int v) const;
00175 
00185   virtual std::pair<unsigned short int, unsigned short int>
00186   second_order_child_vertex (const unsigned int n) const;
00187 
00192   static const unsigned int side_nodes_map[5][9];
00193 
00198   static const unsigned int edge_nodes_map[9][3];
00199 
00200 
00201 
00202 protected:
00203 
00207   Node* _nodelinks_data[18];
00208 
00209 
00210 
00211 #ifdef LIBMESH_ENABLE_AMR
00212 
00216   float embedding_matrix (const unsigned int i,
00217                           const unsigned int j,
00218                           const unsigned int k) const
00219   { return _embedding_matrix[i][j][k]; }
00220 
00225   static const float _embedding_matrix[8][18][18];
00226 
00227 #endif
00228 
00237   static const unsigned short int _remaining_second_order_adjacent_vertices[3][4];
00238 
00239 };
00240 
00241 
00242 
00243 // ------------------------------------------------------------
00244 // Prism18 class member functions
00245 inline
00246 Prism18::Prism18(Elem* p) :
00247   Prism(Prism18::n_nodes(), p, _nodelinks_data)
00248 {
00249 }
00250 
00251 
00252 } // namespace libMesh
00253 
00254 #endif // LIBMESH_CELL_PRISM18_H