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

CellSetBase.h

Go to the documentation of this file.
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   /** \ingroup LowLevelGeometry
00026    * Base class for cell sets. CellSetBase objects are always used wrapped
00027    * in a CellSet handle class.
00028    */
00029 
00030   class CellSetBase
00031     {
00032     public:
00033       /** empty ctor */
00034       CellSetBase();
00035       /** TUVD */
00036       virtual ~CellSetBase();
00037 
00038       /** determine if a given cell is contained in this set */
00039       virtual bool contains(const Cell& cell) const = 0 ;
00040 
00041       /**  Get lists of cells organized into blocks of identical cell types.
00042        * This is for use in assembling work sets. When building a DOF map,
00043        * use getOrderedCells() instead so that reordering is used. */
00044       TSFHashtable<CellTopologyCode, TSFSmartPtr<TSFArray<CellBlock> > >
00045         getCellBlocks(const Mesh& mesh, TSFNonDupArray<CellTopologyCode>& cellType) const ;
00046 
00047       /** Get a list of cells, ordered according to the
00048        * current reordering scheme. For use in the DOF map builder.
00049        * When building work sets, use getCellBlocks() instead because work sets
00050        * require a list of cells of identical type. */
00051       TSFSmartPtr<TSFArray<Cell> > getOrderedCells(const Mesh& mesh) const ;
00052 
00053 
00054       /** write as XML */
00055       virtual XMLObject toXML() const = 0 ;
00056 
00057       /** find the cell dimensions that should be searched to find cells
00058        * in this set */
00059       virtual int dimension(const Mesh& mesh) const = 0 ;
00060 
00061       /** test equality */
00062       virtual bool equals(const CellSet& other) const = 0 ;
00063 
00064       /** test ordering */
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       /** low-level routine to find a list of cell blocks */
00075       virtual TSFHashtable<CellTopologyCode, TSFSmartPtr<TSFArray<CellBlock> > >
00076         innerGetCellBlocks(const Mesh& mesh,
00077                            TSFNonDupArray<CellTopologyCode>& cellType) const ;
00078 
00079       /** low-level routine to find an ordered list of cells */
00080       virtual TSFSmartPtr<TSFArray<Cell> >
00081         innerGetOrderedCells(const Mesh& mesh) const ;
00082 
00083       /** cache of cell blocks */
00084       mutable TSFHashtable<int, TSFHashtable<CellTopologyCode, TSFSmartPtr<TSFArray<CellBlock> > > > cellBlockList_;
00085 
00086       /** cache of cell types */
00087       mutable TSFHashtable<int, TSFNonDupArray<CellTopologyCode> > cellTypeList_;
00088 
00089       /** cache of cell lists */
00090       mutable TSFHashtable<int, TSFSmartPtr<TSFArray<Cell> > > orderedCellList_;
00091     };
00092 
00093 
00094 
00095 }
00096 #endif

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


Documentation generated by