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
00026
00027
00028
00029 class ReferenceCellBase
00030 {
00031 public:
00032
00033 ReferenceCellBase(){;}
00034
00035 virtual ~ReferenceCellBase(){;}
00036
00037
00038
00039
00040
00041 virtual const string& typeName() const = 0 ;
00042
00043 virtual CellTopologyCode topologyCode() const = 0 ;
00044
00045
00046
00047 virtual bool isAffine() const {return false;}
00048
00049
00050 virtual int dim() const = 0 ;
00051
00052 virtual int numNodes() const = 0 ;
00053
00054 virtual int numVertices() const = 0 ;
00055
00056 virtual int numFacets(int d) const = 0 ;
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 virtual const TSFArray<TSFArray<int> >& facetNodePtrs(int facetDim) const = 0 ;
00068
00069
00070 virtual const ReferenceCell& facetReferenceCell(int facetDim,
00071 int facetNumber) const = 0 ;
00072
00073
00074
00075 virtual const TSFArray<TSFArray<int> >& facetFacetPtrs(int d, int facetNum) const=0 ;
00076
00077
00078 virtual FacetSetBase* newFacetSet() const = 0 ;
00079
00080
00081
00082
00083
00084 virtual void jacobian(const Cell& cell,
00085 const TSFArray<Point>& refpts,
00086 TSFArray<CellJacobian>& J) const = 0 ;
00087
00088
00089 virtual void detJacobian(const Cell& cell,
00090 const TSFArray<Point>& refpts,
00091 TSFArray<double>& detJ) const = 0 ;
00092
00093
00094 virtual void constantJacobian(const Cell& cell,
00095 CellJacobian& J) const = 0 ;
00096
00097
00098 virtual void constantDetJacobian(const Cell& cell,
00099 double& detJ) const = 0 ;
00100
00101
00102 virtual void pushFwd(const Cell& cell,
00103 const TSFArray<Point>& ref,
00104 TSFArray<Point>& phys) const = 0 ;
00105
00106
00107 virtual void pullBack(const Cell& cell,
00108 const TSFArray<Point>& phys,
00109 TSFArray<Point>& ref) const = 0 ;
00110
00111
00112
00113
00114 virtual double diameter(const Cell& cell) const = 0 ;
00115
00116
00117 virtual Point normal(const Cell& cell) const ;
00118 private:
00119
00120 };
00121
00122 }
00123 #endif