00001 #ifndef AFFINETRIANGLEREFERENCECELL_H 00002 #define AFFINETRIANGLEREFERENCECELL_H 00003 00004 #include "SundanceDefs.h" 00005 00006 #include "AffineReferenceCell.h" 00007 #include "ReferenceCell.h" 00008 #include "TriangleFacetSet.h" 00009 00010 00011 namespace Sundance 00012 { 00013 00014 using namespace TSF; 00015 using std::string; 00016 00017 using std::ostream; 00018 00019 /** \ingroup LowLevelGeometry 00020 * Reference cell for affine triangles 00021 */ 00022 00023 class AffineTriangleReferenceCell : public AffineReferenceCell 00024 { 00025 public: 00026 /** empty ctor */ 00027 AffineTriangleReferenceCell(); 00028 /** dtor */ 00029 virtual ~AffineTriangleReferenceCell(){;} 00030 00031 /** type identification */ 00032 virtual const string& typeName() const {return typeName_;} 00033 /** return topology code (TriangleCell) */ 00034 virtual CellTopologyCode topologyCode() const {return TriangleCell;} 00035 00036 /** return cell dimension */ 00037 virtual int dim() const {return 2;} 00038 /** return number of nodes */ 00039 virtual int numNodes() const {return 3;} 00040 /** number of vertices (vertices are nodes which correspond to zero-cells) */ 00041 virtual int numVertices() const {return 3;} 00042 /** number of d-facets */ 00043 virtual int numFacets(int d) const ; 00044 00045 // faceting 00046 /** */ 00047 virtual const TSFArray<TSFArray<int> >& facetNodePtrs(int facetDim) const ; 00048 /** */ 00049 virtual const ReferenceCell& facetReferenceCell(int facetDim, 00050 int facetNumber) const ; 00051 /** */ 00052 virtual const TSFArray<TSFArray<int> >& facetFacetPtrs(int cellDim, 00053 int facetNumber) const ; 00054 /** */ 00055 virtual FacetSetBase* newFacetSet() const {return new TriangleFacetSet();} 00056 00057 00058 /** compute the jacobian for this cell */ 00059 virtual void constantJacobian(const Cell& cell, 00060 CellJacobian& J) const ; 00061 00062 /** compute determinant of the jacobian for this cell */ 00063 virtual void constantDetJacobian(const Cell& cell, 00064 double& detJ) const ; 00065 00066 /** do push-forward map (reference to physical coordinates) */ 00067 virtual void pushFwd(const Cell& cell, 00068 const TSFArray<Point>& ref, 00069 TSFArray<Point>& phys) const ; 00070 00071 /** compute diameter of cell */ 00072 virtual double diameter(const Cell& cell) const ; 00073 00074 friend class AffineLineReferenceCell; 00075 private: 00076 /** */ 00077 void initFacets(); 00078 00079 static string typeName_; 00080 static ReferenceCell pointFacetReferenceCell_; 00081 static ReferenceCell lineFacetReferenceCell_; 00082 static TSFArray<TSFArray<TSFArray<int> > > facetNodePtrs_; 00083 static TSFArray<TSFArray<TSFArray<int> > > facetFacetPtrs_; 00084 }; 00085 00086 } 00087 #endif 00088 00089 00090 00091