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 typedef 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 typedef 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 , getMinMaxValues(0)
00113 {
00114
00115 dataList().insert(this);
00116 }
00117
00118
00119 ~dune_fdata()
00120 {
00121 dataList().erase(this);
00122 }
00123
00124
00125 int mynum;
00126
00127
00128 std::string name;
00129
00130
00131 evalCoord_t * evalCoord;
00132 evalDof_t * evalDof;
00133
00134
00135 const void *discFunc;
00136
00137
00138 const void *indexSet;
00139
00140
00141 int allLevels;
00142
00143
00144 int dimVal;
00145
00146
00147 int dimRange;
00148
00149
00150
00151
00152 int * comp;
00153
00154
00155 int polyOrd;
00156
00157
00158 int continuous;
00159
00160
00161 int compName;
00162
00163
00164 void * gridPart;
00165
00166
00167 void (*setGridPartIterators)(DUNE_DAT * , void * gridPart);
00168
00169
00170 void * f_data;
00171
00172
00173 double minValue;
00174
00175 double maxValue;
00176
00177
00178 bool valuesSet;
00179
00180
00181 void (*getMinMaxValues)(DUNE_FDATA *, double * min, double * max );
00182 };
00183
00184
00185 struct dune_dat
00186 {
00187
00188 dune_dat()
00189 : first_macro(0)
00190 , next_macro(0)
00191 , delete_iter(0)
00192 , first_child(0)
00193 , next_child(0)
00194 , copy(0)
00195 , check_inside(0)
00196 , wtoc(0)
00197 , ctow(0)
00198 , setIterationModus(0)
00199 , partition(-1)
00200 , iteratorType(-1)
00201 , partitionIteratorType(-1)
00202 , gridPart(0)
00203 , all (0)
00204 , get_stackentry(0)
00205 , free_stackentry(0) {}
00206
00207
00208 int (* first_macro)(DUNE_ELEM *) ;
00209 int (* next_macro)(DUNE_ELEM *) ;
00210
00211
00212 void (* delete_iter)(DUNE_ELEM *) ;
00213
00214
00215 int (* first_child)(DUNE_ELEM *) ;
00216 int (* next_child)(DUNE_ELEM *) ;
00217
00218 void * (* copy)(const void *) ;
00219
00220 int (* check_inside)(DUNE_ELEM *, const double * ) ;
00221 int (* wtoc)(DUNE_ELEM *, const double *, double * ) ;
00222 void (* ctow)(DUNE_ELEM *, const double *, double * ) ;
00223
00224
00225
00226 void (* setIterationModus)(DUNE_DAT *, DUNE_FDATA *);
00227
00228
00229 int partition;
00230
00231
00232 int iteratorType;
00233
00234
00235 int partitionIteratorType;
00236
00237
00238 void * gridPart;
00239
00240 DUNE_ELEM * all;
00241
00242
00243 void * (*get_stackentry)(DUNE_DAT * );
00244
00245 void (*free_stackentry)(DUNE_DAT * , void *);
00246 };
00247
00248
00249 extern void *setupHmesh(const int noe, const int nov,
00250 const int maxlev, DUNE_DAT * dune);
00251
00252
00253 extern void deleteHmesh( void * hmesh );
00254 extern void deleteFunctions( void * hmesh );
00255
00256 extern void displayTimeScene(INFO * info);
00257 extern void handleMesh (void *hmesh, bool gridMode );
00258
00259 extern DUNE_FDATA * extractData (void *hmesh , int num );
00260
00261
00262 extern void timeSceneInit(INFO *info, const int n_info, const int procs);
00263 extern void addDataToHmesh(void *hmesh, DUNE_FDATA * data);
00264
00265 extern void addHmeshToTimeScene(void * timescene, double time, void *hmesh , int proc);
00266
00267 extern void addHmeshToGlobalTimeScene(double time, void *hmesh , int proc);
00268 extern void tsc_timebar(void *timescene, double t_start, double t_end);
00269 extern void colorBarMinMax(const double min, const double max);
00270
00271 #endif