$extrastylesheet
cell_pyramid.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_PYRAMID_H
00021 #define LIBMESH_CELL_PYRAMID_H
00022 
00023 // Local includes
00024 #include "libmesh/cell.h"
00025 
00026 namespace libMesh
00027 {
00028 
00029 
00030 
00031 
00035 class Pyramid : public Cell
00036 {
00037 public:
00038 
00044   Pyramid(const unsigned int nn, Elem* p, Node** nodelinkdata);
00045 
00050   unsigned int n_nodes() const { return 5; }
00051 
00055   unsigned int n_sides() const { return 5; }
00056 
00060   unsigned int n_vertices() const { return 5; }
00061 
00065   unsigned int n_edges() const { return 8; }
00066 
00070   unsigned int n_faces() const { return 5; }
00071 
00075   unsigned int n_children() const { return 10; }
00076 
00077   /*
00078    * @returns true iff the specified child is on the
00079    * specified side
00080    */
00081   virtual bool is_child_on_side(const unsigned int c,
00082                                 const unsigned int s) const;
00083 
00084   /*
00085    * @returns true iff the specified edge is on the specified side
00086    */
00087   virtual bool is_edge_on_side(const unsigned int e,
00088                                const unsigned int s) const;
00089 
00095   dof_id_type key (const unsigned int s) const;
00096 
00101   UniquePtr<Elem> side (const unsigned int i) const;
00102 
00103 
00104 protected:
00105 
00109   Elem* _elemlinks_data[6+(LIBMESH_DIM>3)];
00110 
00111 
00112 #ifdef LIBMESH_ENABLE_AMR
00113 
00117   unsigned int side_children_matrix (const unsigned int,
00118                                      const unsigned int) const
00119   { libmesh_not_implemented(); return 0; }
00120 
00121 #endif
00122 
00123 };
00124 
00125 
00126 
00127 // ------------------------------------------------------------
00128 // Pyramid class member functions
00129 inline
00130 Pyramid::Pyramid(const unsigned int nn, Elem* p, Node** nodelinkdata) :
00131   Cell(nn, Pyramid::n_sides(), p, _elemlinks_data, nodelinkdata)
00132 {
00133 }
00134 
00135 } // namespace libMesh
00136 
00137 #endif // LIBMESH_CELL_PYRAMID_H