00001 #ifndef CELLSETBASE_H
00002 #define CELLSETBASE_H
00003
00004 #include "SundanceDefs.h"
00005 #include "TSFSmartPtr.h"
00006 #include "Cell.h"
00007 #include "CellBlock.h"
00008 #include "XMLObject.h"
00009 #include "TSFArray.h"
00010 #include "TSFNonDupArray.h"
00011 #include "TSFHashtable.h"
00012
00013
00014 namespace Sundance
00015 {
00016
00017 using namespace TSF;
00018 using std::string;
00019
00020 using std::ostream;
00021
00022 class CellSet;
00023
00024
00025
00026
00027
00028
00029
00030 class CellSetBase
00031 {
00032 public:
00033
00034 CellSetBase();
00035
00036 virtual ~CellSetBase();
00037
00038
00039 virtual bool contains(const Cell& cell) const = 0 ;
00040
00041
00042
00043
00044 TSFHashtable<CellTopologyCode, TSFSmartPtr<TSFArray<CellBlock> > >
00045 getCellBlocks(const Mesh& mesh, TSFNonDupArray<CellTopologyCode>& cellType) const ;
00046
00047
00048
00049
00050
00051 TSFSmartPtr<TSFArray<Cell> > getOrderedCells(const Mesh& mesh) const ;
00052
00053
00054
00055 virtual XMLObject toXML() const = 0 ;
00056
00057
00058
00059 virtual int dimension(const Mesh& mesh) const = 0 ;
00060
00061
00062 virtual bool equals(const CellSet& other) const = 0 ;
00063
00064
00065 virtual bool lessThan(const CellSet& other) const = 0 ;
00066
00067
00068 TSFSmartPtr<TSFArray<int> > getCellOrdering(const Mesh& mesh) const ;
00069
00070
00071 static bool& verbose() {static bool rtn = false; return rtn;}
00072 protected:
00073
00074
00075 virtual TSFHashtable<CellTopologyCode, TSFSmartPtr<TSFArray<CellBlock> > >
00076 innerGetCellBlocks(const Mesh& mesh,
00077 TSFNonDupArray<CellTopologyCode>& cellType) const ;
00078
00079
00080 virtual TSFSmartPtr<TSFArray<Cell> >
00081 innerGetOrderedCells(const Mesh& mesh) const ;
00082
00083
00084 mutable TSFHashtable<int, TSFHashtable<CellTopologyCode, TSFSmartPtr<TSFArray<CellBlock> > > > cellBlockList_;
00085
00086
00087 mutable TSFHashtable<int, TSFNonDupArray<CellTopologyCode> > cellTypeList_;
00088
00089
00090 mutable TSFHashtable<int, TSFSmartPtr<TSFArray<Cell> > > orderedCellList_;
00091 };
00092
00093
00094
00095 }
00096 #endif