00001 #ifndef __GRAPE_HMESH_H__
00002 #define __GRAPE_HMESH_H__
00003
00004 enum { MAX_NAME_LENGTH = 32 };
00005
00006 typedef struct dune_elem DUNE_ELEM;
00007 typedef struct dune_fdata DUNE_FDATA;
00008 typedef struct dune_dat DUNE_DAT;
00009
00010 typedef void evalDof_t (DUNE_ELEM *, DUNE_FDATA *, int , double *);
00011 typedef void evalCoord_t(DUNE_ELEM *, DUNE_FDATA *, const double *, double * );
00012
00013
00014 struct dune_elem
00015 {
00016
00017
00018 dune_elem()
00019 : type(127)
00020 , eindex(-1)
00021 , level(-1)
00022 , level_of_interest(-1)
00023 , has_children(0)
00024 , liter(0)
00025 , enditer(0)
00026 , hiter(0)
00027 , actElement(0)
00028 , gridPart(0)
00029 , display(0)
00030 , mesh(0)
00031 {
00032
00033 for(int i=0; i<MAX_EL_DOF; ++i)
00034 {
00035 vindex [i] = -1;
00036 vpointer[i] = (double *) coordinates[i];
00037 for(int j=0; j<3; ++j)
00038 {
00039 vpointer[i][j] = 0.0;
00040 }
00041 }
00042 for(int i=0; i<MAX_EL_FACE; ++i)
00043 {
00044 bnd [i] = -1;
00045 }
00046 }
00047
00048
00049
00050
00051 int type;
00052
00053 double * vpointer [MAX_EL_DOF];
00054 double coordinates [MAX_EL_DOF][3];
00055 int vindex [MAX_EL_DOF] ;
00056 int bnd [MAX_EL_FACE] ;
00057 int eindex;
00058 int level;
00059 int level_of_interest;
00060 int has_children;
00061
00062
00063 void * liter;
00064 void * enditer;
00065
00066
00067 void * hiter;
00068
00069
00070
00071 void * actElement;
00072
00073
00074 void * gridPart;
00075
00076
00077 void * display;
00078
00079
00080 void * mesh;
00081 };
00082
00083 struct dune_fdata
00084 {
00085 static std::set<DUNE_FDATA*>& dataList ()
00086 {
00087 static std::set<DUNE_FDATA*> dList;
00088 return dList;
00089 }
00090
00091
00092 dune_fdata()
00093 : mynum (-1)
00094 , name()
00095 , evalCoord(0)
00096 , evalDof(0)
00097 , discFunc(0)
00098 , indexSet(0)
00099 , allLevels(0)
00100 , dimVal(0)
00101 , dimRange(0)
00102 , comp(0)
00103 , polyOrd(0)
00104 , continuous(0)
00105 , compName(0)
00106 , gridPart(0)
00107 , setGridPartIterators(0)
00108 , f_data (0)
00109 , minValue(0.0)
00110 , maxValue(1.0)
00111 , valuesSet(false)
00112 , valCache(0.0)
00113 , getMinMaxValues(0)
00114 {
00115
00116 dataList().insert(this);
00117 }
00118
00119
00120 ~dune_fdata()
00121 {
00122 dataList().erase(this);
00123 }
00124
00125
00126 int mynum;
00127
00128
00129 std::string name;
00130
00131
00132 evalCoord_t * evalCoord;
00133 evalDof_t * evalDof;
00134
00135
00136 const void *discFunc;
00137
00138
00139 const void *indexSet;
00140
00141
00142 int allLevels;
00143
00144
00145 int dimVal;
00146
00147
00148 int dimRange;
00149
00150
00151
00152
00153 int * comp;
00154
00155
00156 int polyOrd;
00157
00158
00159 int continuous;
00160
00161
00162 int compName;
00163
00164
00165 void * gridPart;
00166
00167
00168 void (*setGridPartIterators)(DUNE_DAT * , void * gridPart);
00169
00170
00171 void * f_data;
00172
00173
00174 double minValue;
00175
00176 double maxValue;
00177
00178
00179 bool valuesSet;
00180
00181
00182 double valCache;
00183
00184
00185 void (*getMinMaxValues)(DUNE_FDATA *, double * min, double * max );
00186 };
00187
00188
00189 struct dune_dat
00190 {
00191
00192 dune_dat()
00193 : first_macro(0)
00194 , next_macro(0)
00195 , delete_iter(0)
00196 , first_child(0)
00197 , next_child(0)
00198 , copy(0)
00199 , check_inside(0)
00200 , wtoc(0)
00201 , ctow(0)
00202 , setIterationModus(0)
00203 , partition(-1)
00204 , iteratorType(-1)
00205 , partitionIteratorType(-1)
00206 , gridPart(0)
00207 , all (0)
00208 , get_stackentry(0)
00209 , free_stackentry(0) {}
00210
00211
00212 int (* first_macro)(DUNE_ELEM *) ;
00213 int (* next_macro)(DUNE_ELEM *) ;
00214
00215
00216 void (* delete_iter)(DUNE_ELEM *) ;
00217
00218
00219 int (* first_child)(DUNE_ELEM *) ;
00220 int (* next_child)(DUNE_ELEM *) ;
00221
00222 void * (* copy)(const void *) ;
00223
00224 int (* check_inside)(DUNE_ELEM *, const double * ) ;
00225 int (* wtoc)(DUNE_ELEM *, const double *, double * ) ;
00226 void (* ctow)(DUNE_ELEM *, const double *, double * ) ;
00227
00228
00229
00230 void (* setIterationModus)(DUNE_DAT *, DUNE_FDATA *);
00231
00232
00233 int partition;
00234
00235
00236 int iteratorType;
00237
00238
00239 int partitionIteratorType;
00240
00241
00242 void * gridPart;
00243
00244 DUNE_ELEM * all;
00245
00246
00247 void * (*get_stackentry)(DUNE_DAT * );
00248
00249 void (*free_stackentry)(DUNE_DAT * , void *);
00250 };
00251
00252
00253 extern void *setupHmesh(const int noe, const int nov,
00254 const int maxlev, DUNE_DAT * dune);
00255
00256
00257 extern void deleteHmesh( void * hmesh );
00258 extern void deleteFunctions( void * hmesh );
00259
00260 extern void displayTimeScene(INFO * info);
00261 extern void handleMesh (void *hmesh, bool gridMode );
00262
00263 extern DUNE_FDATA * extractData (void *hmesh , int num );
00264
00265
00266 extern void timeSceneInit(INFO *info, const int n_info, const int procs);
00267 extern void addDataToHmesh(void *hmesh, DUNE_FDATA * data);
00268
00269 extern void addHmeshToTimeScene(void * timescene, double time, void *hmesh , int proc);
00270
00271 extern void addHmeshToGlobalTimeScene(double time, void *hmesh , int proc);
00272 extern void tsc_timebar(void *timescene, double t_start, double t_end);
00273 extern void colorBarMinMax(const double min, const double max);
00274
00275 #endif