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

TetFacetSet.h

Go to the documentation of this file.
00001 #ifndef TETFACETSET_H
00002 #define TETFACETSET_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    * FacetSet for tetrahedral cells
00018    */
00019 
00020   class TetFacetSet : public FacetSetBase
00021     {
00022     public:
00023       TetFacetSet() : FacetSetBase() {;}
00024       virtual ~TetFacetSet(){;}
00025 
00026       virtual int numFacets(int facetDim) const {return n_[facetDim];}
00027       virtual int facetIndex(int facetDim, int facetNum) const
00028         {return f_[p_[facetDim]+facetNum];}
00029       virtual void setFacetIndex(int facetDim, int facetNum, int facetIndex)
00030         {f_[p_[facetDim]+facetNum] = facetIndex;}
00031 
00032       virtual int byteCount() const {return sizeof(TetFacetSet);}
00033 
00034 #ifndef NO_POOLMEM
00035       static inline void* operator new(size_t s);
00036       static inline void operator delete(void* p, size_t s);
00037 #endif
00038     private:
00039       static int p_[3];
00040       static int n_[3];
00041       int f_[14];
00042 #ifndef NO_POOLMEM
00043       static Pool memPool_;
00044 #endif
00045     };
00046 
00047 #ifndef NO_POOLMEM
00048   inline void* TetFacetSet::operator new(size_t s)
00049     {
00050       if (s != sizeof(TetFacetSet))
00051         {
00052           return ::operator new(s);
00053         }
00054       return memPool_.alloc();
00055       //return ::operator new(s);
00056     }
00057 
00058   inline void TetFacetSet::operator delete(void* p, size_t s)
00059     {
00060       if (s != sizeof(TetFacetSet)) ::operator delete(p);
00061       else memPool_.free(p);
00062       //else ::operator delete(p);
00063     }
00064 #endif
00065 
00066 
00067 }
00068 #endif

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


Documentation generated by