$extrastylesheet
cell_prism.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_PRISM_H
00021 #define LIBMESH_CELL_PRISM_H
00022 
00023 // Local includes
00024 #include "libmesh/cell.h"
00025 
00026 namespace libMesh
00027 {
00028 
00029 
00030 
00031 
00035 class Prism : public Cell
00036 {
00037 public:
00038 
00043   Prism(const unsigned int nn, Elem* p, Node** nodelinkdata);
00044 
00049   unsigned int n_nodes() const { return 6; }
00050 
00054   unsigned int n_sides() const { return 5; }
00055 
00059   unsigned int n_vertices() const { return 6; }
00060 
00064   unsigned int n_edges() const { return 9; }
00065 
00069   unsigned int n_faces() const { return 5; }
00070 
00074   unsigned int n_children() const { return 8; }
00075 
00076   /*
00077    * @returns true iff the specified child is on the
00078    * specified side
00079    */
00080   virtual bool is_child_on_side(const unsigned int c,
00081                                 const unsigned int s) const;
00082 
00083   /*
00084    * @returns true iff the specified edge is on the specified side
00085    */
00086   virtual bool is_edge_on_side(const unsigned int e,
00087                                const unsigned int s) const;
00088 
00094   dof_id_type key (const unsigned int s) const;
00095 
00100   UniquePtr<Elem> side (const unsigned int i) const;
00101 
00102 
00103 
00104 protected:
00105 
00109   Elem* _elemlinks_data[6+(LIBMESH_DIM>3)];
00110 
00111 
00112 
00119   static const unsigned short int _second_order_adjacent_vertices[9][2];
00120 
00124   static const unsigned short int _second_order_vertex_child_number[18];
00125 
00129   static const unsigned short int _second_order_vertex_child_index[18];
00130 };
00131 
00132 
00133 
00134 // ------------------------------------------------------------
00135 // Prism class member functions
00136 inline
00137 Prism::Prism(const unsigned int nn, Elem* p, Node** nodelinkdata) :
00138   Cell(nn, Prism::n_sides(), p, _elemlinks_data, nodelinkdata)
00139 {
00140 }
00141 
00142 } // namespace libMesh
00143 
00144 #endif // LIBMESH_CELL_PRISM_H