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

QuadFacetSet.h

Go to the documentation of this file.
00001 #ifndef QUADFACETSET_H
00002 #define QUADFACETSET_H
00003 
00004 #include "SundanceDefs.h"
00005 
00006 #include "FacetSetBase.h"
00007 #include "Pool.h"
00008 
00009 
00010 namespace Sundance
00011 {
00012 
00013   using namespace TSF;
00014 
00015 
00016   /** \ingroup LowLevelGeometry
00017    * Collect facet numbers for a quad cell
00018    */
00019 
00020   class QuadFacetSet : public FacetSetBase
00021     {
00022     public:
00023       QuadFacetSet() : FacetSetBase() {;}
00024       virtual ~QuadFacetSet(){;}
00025 
00026       virtual int numFacets(int /*facetDim*/) const {return 4;}
00027       virtual int facetIndex(int facetDim, int facetNum) const
00028         {return f_[facetNum+4*facetDim];}
00029       virtual void setFacetIndex(int facetDim, int facetNum, int facetIndex)
00030         {f_[4*facetDim+facetNum] = facetIndex;}
00031 
00032       virtual int byteCount() const {return sizeof(QuadFacetSet);}
00033 #ifndef NO_POOLMEM
00034       static inline void* operator new(size_t s);
00035       static inline void operator delete(void* p, size_t s);
00036 #endif
00037     private:
00038       int f_[8];
00039 #ifndef NO_POOLMEM
00040       static Pool memPool_;
00041 #endif
00042     };
00043 
00044 #ifndef NO_POOLMEM
00045   inline void* QuadFacetSet::operator new(size_t s)
00046     {
00047       if (s != sizeof(QuadFacetSet))
00048         {
00049           return ::operator new(s);
00050         }
00051       return memPool_.alloc();
00052       //return ::operator new(s);
00053     }
00054 
00055   inline void QuadFacetSet::operator delete(void* p, size_t s)
00056     {
00057       if (s != sizeof(QuadFacetSet)) ::operator delete(p);
00058       else memPool_.free(p);
00059       //else ::operator delete(p);
00060     }
00061 #endif
00062 
00063 
00064 }
00065 #endif

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


Documentation generated by