patchindexhandler.h

Go to the documentation of this file.
00001 #ifndef  __PatchIndexHandler_h
00002 #define  __PatchIndexHandler_h
00003 
00004 #include  "gascoigne.h"
00005 
00006 /*-----------------------------------------*/
00007 
00008 namespace Gascoigne
00009 {
00010 class PatchIndexHandler
00011 {
00012 protected:
00013 
00014   bool                    haspatch,hasq4patch;
00015   nvector<IntVector>      indexofpatch,indexofq4patch;
00016   nvector<IntVector>      patch2cell,q4patch2cell;
00017   
00018   int dim;
00019 
00020 public:
00021   PatchIndexHandler() : haspatch(false), hasq4patch(false) { }
00022   ~PatchIndexHandler() { }
00023 
00024   int&                       GetDim()          { return dim;}
00025   bool&                      GetHasPatch()     { return haspatch;}
00026   bool&                      GetHasQ4Patch()   { return hasq4patch;}
00027   nvector<IntVector>&        GetIndex()        { return indexofpatch;}
00028   const nvector<IntVector>&  GetIndex()const   { return indexofpatch;}
00029   nvector<IntVector>&        GetIndexQ4()      { return indexofq4patch;}
00030   const nvector<IntVector>&  GetIndexQ4()const { assert(hasq4patch); return indexofq4patch;}
00031 
00032   IntVector&          GetPatch2Cell(int i)
00033     { assert(i<patch2cell.size()); return patch2cell[i];}
00034   const IntVector&    GetPatch2Cell(int i) const
00035     { assert(i<patch2cell.size()); return patch2cell[i];}
00036   IntVector&          GetQ4Patch2Cell(int i)
00037     { assert(i<q4patch2cell.size()); return q4patch2cell[i];}
00038   const IntVector&    GetQ4Patch2Cell(int i) const
00039     { assert(hasq4patch && i<q4patch2cell.size()); return q4patch2cell[i];}
00040   
00041         nvector<IntVector>& GetAllPatch2Cell()         { return patch2cell; }
00042   const nvector<IntVector>& GetAllPatch2Cell() const   { return patch2cell; }
00043         nvector<IntVector>& GetAllQ4Patch2Cell()       { return q4patch2cell; }
00044   const nvector<IntVector>& GetAllQ4Patch2Cell() const { assert(hasq4patch); return q4patch2cell; }
00045   
00046   int npatches()    const { return indexofpatch.size();}
00047   int nq4patches()  const { return indexofq4patch.size();}
00048   bool HasPatch()   const { return haspatch;}
00049   bool HasQ4Patch() const { return hasq4patch;}
00050   int  Dim()        const { return dim; }
00051   
00052   const IntVector& IndicesOfPatch(int i)   const { return indexofpatch[i];}
00053   const IntVector& IndicesOfQ4Patch(int i) const { assert(hasq4patch); return indexofq4patch[i];}
00054   IntVector Q2IndicesOfQ4Patch(int i) const;
00055   IntVector CoarseIndices(int iq) const;
00056   IntVector CoarseIndicesQ4(int iq) const;
00057 
00058   int nodes_per_patch() const
00059     { 
00060       if (dim==2) return 9;
00061       return 27;
00062     }
00063   int nodes_per_q4patch() const
00064     { 
00065       if (dim==2) return 25;
00066       return 125;
00067     }
00068 };
00069 }
00070 
00071 #endif

Generated on Thu Sep 14 10:34:37 2006 for Gascoigne by  doxygen 1.4.7