combinedgrapedisplay.hh

Go to the documentation of this file.
00001 #ifndef DUNE_COMBINEDGRAPEDISPLAY_HH
00002 #define DUNE_COMBINEDGRAPEDISPLAY_HH
00003 
00004 //- System includes 
00005 #include <list>
00006 #include <vector>
00007 
00008 //- Dune includes
00009 
00010 //- Local includes
00011 #include "grapedatadisplay.hh"
00012 
00018 namespace Dune 
00019 {
00020  
00025 template<class DisplayType>
00026 class CombinedGrapeDisplay 
00027 {
00028   typedef CombinedGrapeDisplay < DisplayType > MyDisplayType;
00029 
00030   typedef typename DisplayType :: MyGridType GridType; 
00031   enum { dim      = GridType :: dimension };
00032   enum { dimworld = GridType :: dimensionworld };
00033   
00034   // defined in griddisplay.hh 
00035   typedef typename GrapeInterface<dim,dimworld>::DUNE_ELEM  DUNE_ELEM;
00036   typedef typename GrapeInterface<dim,dimworld>::DUNE_FDATA DUNE_FDATA;
00037   typedef typename GrapeInterface<dim,dimworld>::DUNE_DAT   DUNE_DAT;
00038   typedef typename GrapeInterface<dim,dimworld>::F_DATA     F_DATA;
00039   typedef typename GrapeInterface<dim,dimworld>::STACKENTRY STACKENTRY; 
00040   
00041 protected:
00042   typedef typename std::list< DisplayType * > DisplayListType;
00043   DisplayListType dispList_;
00044 
00045   typedef typename DisplayListType :: iterator DisplayListIteratorType;
00046   DisplayListIteratorType grditer_;
00047   DisplayListIteratorType enditer_;
00048 
00049   typedef typename std::list< void * > GridPartListType;
00050   GridPartListType gridPartList_; 
00051   typedef typename GridPartListType :: iterator GridPartListIteratorType;
00052   GridPartListIteratorType partEnd_;
00053   GridPartListIteratorType partIter_;
00054 
00055   
00056   // pointer to actual display
00057   DisplayType * disp_;
00058   
00059   DUNE_ELEM * dhel_;
00060  
00061   // actual element data 
00062   DUNE_ELEM hel_;
00063 
00064   // actual dat struct
00065   DUNE_DAT dune_;
00066   
00067 public:
00068   // no better way than this canot export HMESH structure to here
00070   void *hmesh_;
00071 
00072 public:
00074   inline CombinedGrapeDisplay();
00075 
00077   inline ~CombinedGrapeDisplay();
00078 
00080   void addDisplay ( DisplayType & disp );
00081 
00084   inline void display();
00085 
00087   inline void * getHmesh();
00088 
00089   inline void addMyMeshToGlobalTimeScene(double time, int proc);
00090  
00091 private:  
00092   // generate hmesh 
00093   inline void * setupHmesh();
00094 
00095   typedef typename DisplayType :: StackEntryType StackEntryType; 
00096   StackEntryType stackEntry_;
00097 
00098 protected:
00099   std::vector < DUNE_FDATA * > vecFdata_;
00100 //****************************************************************  
00101 //
00102 // --GrapeGridDisplay, Some Subroutines needed for display with GRAPE
00103 // 
00104 //****************************************************************  
00105   inline int callFirstMacro(DUNE_ELEM * he) ;
00106   // first and next macro element via LevelIterator level 0 
00107   inline int first_leaf (DUNE_ELEM * he) ;
00108   inline int next_leaf (DUNE_ELEM * he) ;
00109   
00110   // first and next macro element via LevelIterator level 0 
00111   inline int first_macro (DUNE_ELEM * he) ;
00112   inline int next_macro (DUNE_ELEM * he) ;
00113 
00114   // first and next child via HierarchicIterator with given maxlevel in Grape
00115   inline int first_child (DUNE_ELEM * he) ;
00116   inline int next_child (DUNE_ELEM * he) ;
00117 
00118   inline static void * copy_iterator (const void * i) ;
00119 
00120   // local to world 
00121   inline void local_to_world (DUNE_ELEM * he, const double * c, double * w);
00122 
00123   // world to local 
00124   inline int world_to_local (DUNE_ELEM * he, const double * w, double * c);
00125  
00126   // check inside reference element 
00127   inline int checkInside (DUNE_ELEM * he, const double * w);
00128 
00129   // local to world 
00130   inline static void ctow (DUNE_ELEM * he, const double * c, double * w);
00131 
00132   // world to local 
00133   inline static int wtoc (DUNE_ELEM * he, const double * w, double * c);
00134  
00135   // check inside reference element 
00136   inline static int check_inside (DUNE_ELEM * he, const double * w);
00137 
00138   // wrapper methods for first_child and next_child
00139   inline static int first_mac (DUNE_ELEM * he);
00140   inline static int next_mac (DUNE_ELEM * he);
00141   
00142   // wrapper methods for first_child and next_child
00143   inline static int fst_leaf (DUNE_ELEM * he);
00144   inline static int nxt_leaf (DUNE_ELEM * he);
00145   
00146   // wrapper methods for first_child and next_child
00147   inline static int fst_child (DUNE_ELEM * he);
00148   inline static int nxt_child (DUNE_ELEM * he);
00149 
00151   inline void evalCoord (DUNE_ELEM *he, DUNE_FDATA *df,
00152                   const double *coord, double * val);
00154   inline void evalDof (DUNE_ELEM *he, DUNE_FDATA *df, int localNum, double * val);
00155  
00158   inline static void evalCoordWrap (DUNE_ELEM *he, DUNE_FDATA *df,
00159                   const double *coord, double * val);
00162   inline static void evalDofWrap (DUNE_ELEM *he, DUNE_FDATA *df, int localNum, double * val);
00163   
00164   // function to evaluate data 
00165   inline static void func_real (DUNE_ELEM *he , DUNE_FDATA * fe,int ind,
00166                                 const double *coord, double *val);
00167 
00168   inline void setIterationMethods(DUNE_DAT *, DUNE_FDATA *); 
00169   static inline void setIterationModus(DUNE_DAT *, DUNE_FDATA *); 
00170 
00171   static void * getStackEn(DUNE_DAT *);
00172   static void freeStackEn(DUNE_DAT *, void *);
00173   
00174 }; // end class GrapeGridDisplay
00175 
00176 } // end namespace Dune
00177 
00178 #include "grape/combinedgrapedisplay.cc"
00179 #endif

Generated on 6 Nov 2008 with Doxygen (ver 1.5.6) [logfile].