Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

ReferenceCellBase.h

Go to the documentation of this file.
00001 #ifndef REFERENCECELLBASE_H
00002 #define REFERENCECELLBASE_H
00003 
00004 #include "SundanceDefs.h"
00005 
00006 #include "TSFArray.h"
00007 #include "CellJacobian.h"
00008 #include "Point.h"
00009 #include "CellType.h"
00010 #include <math.h>
00011 
00012 namespace Sundance
00013 {
00014 
00015   using namespace TSF;
00016   using std::string;
00017 
00018   using std::ostream;
00019 
00020   class Cell;
00021 
00022   class ReferenceCell;
00023   class FacetSetBase;
00024 
00025   /** \ingroup UserLevelGeometry
00026    * Base class for reference cells. See the handle class, ReferenceCell, for
00027    * more documentation.
00028    */
00029   class ReferenceCellBase
00030     {
00031     public:
00032       /** empty ctor */
00033       ReferenceCellBase(){;}
00034       /** TUVD */
00035       virtual ~ReferenceCellBase(){;}
00036 
00037 
00038       /** \name Introspection */
00039       //@{
00040       /* get a type name */
00041       virtual const string& typeName() const = 0 ;
00042       /* get the specifier for the cell's topology type */
00043       virtual CellTopologyCode topologyCode() const = 0 ;
00044 
00045       /** identify affine cells. Affine cells have constant Jacobians so
00046        * we can do simpler calculations in that case. */
00047       virtual bool isAffine() const {return false;}
00048 
00049       /** get cell dimension */
00050       virtual int dim() const = 0 ;
00051       /**  number of nodes */
00052       virtual int numNodes() const = 0 ;
00053       /** number of vertices (vertices are nodes which correspond to zero-cells)*/
00054       virtual int numVertices() const = 0 ;
00055       /** number of d-facets */
00056       virtual int numFacets(int d) const = 0 ;
00057       //@}
00058 
00059 
00060       /** \name faceting */
00061 
00062       /** facetNodes() returns a list of pointers to nodes for the facets
00063        * of dimension facetDim. They are organized as
00064        * facetNodes[facetNumber][nodeNumber]. The pointers are indices into
00065        * a cell's local array of nodes.
00066        */
00067       virtual const TSFArray<TSFArray<int> >& facetNodePtrs(int facetDim) const = 0 ;
00068 
00069       /** facetReferenceCell returns the reference cell for the given facet. */
00070       virtual const ReferenceCell& facetReferenceCell(int facetDim,
00071                                                       int facetNumber) const = 0 ;
00072 
00073       /** facetFacetPtrs() returns a list of pointers to the facets of
00074        * the facet-num-th facet of dimension d. */
00075       virtual const TSFArray<TSFArray<int> >& facetFacetPtrs(int d, int facetNum) const=0 ;
00076 
00077       /** create a facet set */
00078       virtual FacetSetBase* newFacetSet() const = 0 ;
00079 
00080 
00081       /**\name mappings and jacobians */
00082       //@{
00083       /** Jacobian computation, general non-affine case. */
00084       virtual void jacobian(const Cell& cell,
00085                             const TSFArray<Point>& refpts,
00086                             TSFArray<CellJacobian>& J) const = 0 ;
00087 
00088       /** Jacobian computation on embedded cells */
00089       virtual void detJacobian(const Cell& cell,
00090                                const TSFArray<Point>& refpts,
00091                                TSFArray<double>& detJ) const = 0 ;
00092 
00093       /** constant-Jacobian method, for efficiency on affine cells. */
00094       virtual void constantJacobian(const Cell& cell,
00095                                     CellJacobian& J) const = 0 ;
00096       /** constant-Jacobian, embedded cell computation,
00097        * for efficiency on affine cells. */
00098       virtual void constantDetJacobian(const Cell& cell,
00099                                        double& detJ) const = 0 ;
00100 
00101       /** pushfwd maps ref coords to physical coords. */
00102       virtual void pushFwd(const Cell& cell,
00103                            const TSFArray<Point>& ref,
00104                            TSFArray<Point>& phys) const = 0 ;
00105 
00106       /** pullback maps physical coords to reference coords. */
00107       virtual void pullBack(const Cell& cell,
00108                             const TSFArray<Point>& phys,
00109                             TSFArray<Point>& ref) const = 0 ;
00110 
00111       //@}
00112 
00113       /** compute diameter of cell */
00114       virtual double diameter(const Cell& cell) const = 0 ;
00115 
00116       /** compute outward normal of cell */
00117       virtual Point normal(const Cell& cell) const ;
00118     private:
00119       // no data in base class
00120     };
00121 
00122 }
00123 #endif

Contact:
Kevin Long (krlong@ca.sandia.gov)


Documentation generated by