41
double X,Y,Z,val,valx,valy,valz;
40
double X, Y, Z, val, valx, valy, valz;
42
41
double shape_functions[128];
43
static adapt_point * New (double x, double y, double z,
44
Double_Matrix *coeffs, Double_Matrix *eexps);
47
printf("p %g %g\n" ,x,y);
49
bool operator < (const adapt_point & other) const
42
static adapt_point *New(double x, double y, double z,
43
Double_Matrix *coeffs, Double_Matrix *eexps);
44
bool operator < (const adapt_point &other) const
51
46
if(other.x < x) return true;
52
47
if(other.x > x) return false;
64
adapt_edge (adapt_point *p1,adapt_point *p2)
59
adapt_edge(adapt_point *p1, adapt_point *p2)
71
inline double V () const
73
return (p[0]->val + p[1]->val)/2.;
75
inline static void GSF (const double u, const double v, double w, double sf[])
82
printf("p1 %g %g p2 %g %g\n", p[0]->x, p[0]->y, p[1]->x, p[1]->y);
84
static void Create (int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps) ;
85
static void Recur_Create (adapt_edge *e, int maxlevel, int level,
86
Double_Matrix *coeffs, Double_Matrix *eexps);
87
static void Error (double AVG , double tol );
88
static void Recur_Error (adapt_edge *e, double AVG, double tol);
66
inline double V() const
68
return (p[0]->val + p[1]->val) / 2.;
70
inline static void GSF(const double u, const double v, double w, double sf[])
75
static void Create(int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps);
76
static void Recur_Create(adapt_edge *e, int maxlevel, int level,
77
Double_Matrix *coeffs, Double_Matrix *eexps);
78
static void Error(double AVG, double tol);
79
static void Recur_Error(adapt_edge *e, double AVG, double tol);
92
83
static std::list<adapt_edge*> all_elems;
96
87
class adapt_triangle
99
adapt_triangle (adapt_point *p1, adapt_point *p2, adapt_point *p3)
90
adapt_triangle(adapt_point *p1, adapt_point *p2, adapt_point *p3)
105
96
e[0] = e[1] = e[2] = e[3] = 0;
107
inline double V () const
109
return (p[0]->val + p[1]->val + p[2]->val)/3.;
111
static void GSF (const double u, const double v, double w, double sf[]);
114
printf("p1 %g %g p2 %g %g p3 %g %g\n",
115
p[0]->x, p[0]->y, p[1]->x, p[1]->y, p[2]->x, p[2]->y);
117
static void Create (int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps);
118
static void Recur_Create (adapt_triangle *t, int maxlevel, int level,
119
Double_Matrix *coeffs, Double_Matrix *eexps);
120
static void Error (double AVG, double tol);
121
static void Recur_Error (adapt_triangle *t, double AVG, double tol);
98
inline double V() const
100
return (p[0]->val + p[1]->val + p[2]->val) / 3.;
102
static void GSF(const double u, const double v, double w, double sf[])
108
static void Create(int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps);
109
static void Recur_Create(adapt_triangle *t, int maxlevel, int level,
110
Double_Matrix *coeffs, Double_Matrix *eexps);
111
static void Error(double AVG, double tol);
112
static void Recur_Error(adapt_triangle *t, double AVG, double tol);
123
114
adapt_point *p[3];
124
115
adapt_triangle *e[4];
143
130
e[0] = e[1] = e[2] = e[3] = 0;
145
inline double V () const
132
inline double V() const
147
return (p[0]->val + p[1]->val + p[2]->val + p[3]->val)/4.;
134
return (p[0]->val + p[1]->val + p[2]->val + p[3]->val) / 4.;
149
inline static void GSF (const double u, const double v, double w, double sf[])
136
inline static void GSF(const double u, const double v, double w, double sf[])
151
138
sf[0] = 0.25 * (1. - u) * (1. - v);
152
139
sf[1] = 0.25 * (1. + u) * (1. - v);
153
140
sf[2] = 0.25 * (1. + u) * (1. + v);
154
141
sf[3] = 0.25 * (1. - u) * (1. + v);
158
printf("p1 %g %g p2 %g %g p3 %g %g\n",
159
p[0]->x, p[0]->y, p[1]->x, p[1]->y, p[2]->x, p[2]->y);
161
static void Create (int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps);
162
static void Recur_Create (adapt_quad *q, int maxlevel, int level,
163
Double_Matrix *coeffs, Double_Matrix *eexps);
164
static void Error (double AVG, double tol);
165
static void Recur_Error (adapt_quad *q, double AVG, double tol);
143
static void Create(int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps);
144
static void Recur_Create(adapt_quad *q, int maxlevel, int level,
145
Double_Matrix *coeffs, Double_Matrix *eexps);
146
static void Error(double AVG, double tol);
147
static void Recur_Error(adapt_quad *q, double AVG, double tol);
167
149
adapt_point *p[4];
168
150
adapt_quad *e[4];
183
165
e[0] = e[1] = e[2] = e[3] = 0;
184
166
e[4] = e[5] = e[6] = e[7] = 0;
186
inline static void GSF (const double u, const double v, double w, double sf[])
168
inline static void GSF(const double u, const double v, double w, double sf[])
188
170
sf[0] = 1. - u - v - w;
193
inline double V () const
195
return (p[0]->val + p[1]->val + p[2]->val + p[3]->val)/4.;
199
printf("p1 %g %g p2 %g %g p3 %g %g\n",
200
p[0]->x, p[0]->y, p[1]->x, p[1]->y, p[2]->x, p[2]->y);
202
static void Create (int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps);
203
static void Recur_Create (adapt_tet *t, int maxlevel, int level,
204
Double_Matrix *coeffs, Double_Matrix *eexps);
205
static void Error (double AVG, double tol);
206
static void Recur_Error (adapt_tet *t, double AVG, double tol);
175
inline double V() const
177
return (p[0]->val + p[1]->val + p[2]->val + p[3]->val) / 4.;
179
static void Create(int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps);
180
static void Recur_Create(adapt_tet *t, int maxlevel, int level,
181
Double_Matrix *coeffs, Double_Matrix *eexps);
182
static void Error(double AVG, double tol);
183
static void Recur_Error(adapt_tet *t, double AVG, double tol);
208
185
adapt_point *p[4];
217
adapt_hex (adapt_point *p1, adapt_point *p2, adapt_point *p3, adapt_point *p4,
218
adapt_point *p5, adapt_point *p6, adapt_point *p7, adapt_point *p8)
194
adapt_hex(adapt_point *p1, adapt_point *p2, adapt_point *p3, adapt_point *p4,
195
adapt_point *p5, adapt_point *p6, adapt_point *p7, adapt_point *p8)
240
217
sf[6] = 0.125 * (1 + u) * (1 + v) * (1 + w);
241
218
sf[7] = 0.125 * (1 - u) * (1 + v) * (1 + w);
243
inline double V () const
220
inline double V() const
245
222
return (p[0]->val + p[1]->val + p[2]->val+ p[3]->val +
246
p[4]->val + p[5]->val + p[6]->val+ p[7]->val)/8.;
250
printf("p1 %g %g p2 %g %g p3 %g %g\n",
251
p[0]->x, p[0]->y, p[1]->x, p[1]->y, p[2]->x, p[2]->y);
253
static void Create (int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps);
254
static void Recur_Create (adapt_hex *h, int maxlevel, int level,
255
Double_Matrix *coeffs, Double_Matrix *eexps);
256
static void Error (double AVG, double tol);
257
static void Recur_Error (adapt_hex *h, double AVG, double tol);
223
p[4]->val + p[5]->val + p[6]->val+ p[7]->val) / 8.;
225
static void Create(int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps);
226
static void Recur_Create(adapt_hex *h, int maxlevel, int level,
227
Double_Matrix *coeffs, Double_Matrix *eexps);
228
static void Error(double AVG, double tol);
229
static void Recur_Error(adapt_hex *h, double AVG, double tol);
259
231
adapt_point *p[8];
268
240
double minval, maxval;
269
241
int presentZoomLevel;
270
242
double presentTol;
271
Double_Matrix * _eexps;
272
Double_Matrix * _coefs;
273
Double_Matrix * _coefsGeom;
274
Double_Matrix * _eexpsGeom;
275
Double_Matrix * _STposX;
276
Double_Matrix * _STposY;
277
Double_Matrix * _STposZ;
278
Double_Matrix * _STval;
243
Double_Matrix *_eexps;
244
Double_Matrix *_coefs;
245
Double_Matrix *_coefsGeom;
246
Double_Matrix *_eexpsGeom;
247
Double_Matrix *_STposX;
248
Double_Matrix *_STposY;
249
Double_Matrix *_STposZ;
250
Double_Matrix *_STval;
280
Double_Matrix * _STvalX;
281
Double_Matrix * _STvalY;
282
Double_Matrix * _STvalZ;
283
Double_Matrix * _Interpolate;
284
Double_Matrix * _Geometry;
252
Double_Matrix *_STvalX;
253
Double_Matrix *_STvalY;
254
Double_Matrix *_STvalZ;
255
Double_Matrix *_Interpolate;
256
Double_Matrix *_Geometry;
286
Adaptive_Post_View (Post_View *view, List_T *_coeffs, List_T *_eexps, List_T *_coeffsGeom=0, List_T *_eexpsGeom=0);
287
~Adaptive_Post_View ();
288
int getGlobalResolutionLevel () const { return presentZoomLevel; }
289
void setGlobalResolutionLevel (Post_View * view, int level)
258
Adaptive_Post_View(PViewDataList *data, List_T *_coeffs, List_T *_eexps,
259
List_T *_coeffsGeom=0, List_T *_eexpsGeom=0);
260
~Adaptive_Post_View();
261
int getGlobalResolutionLevel() const { return presentZoomLevel; }
262
void setGlobalResolutionLevel(PViewDataList *data, int level)
291
setAdaptiveResolutionLevel(view, level);
264
setAdaptiveResolutionLevel(data, level);
293
template <class ELEM>
294
void setAdaptiveResolutionLevel_TEMPL(Post_View * view, int level, int lemvelmax,
295
GMSH_Post_Plugin *plug, List_T **myList,
296
int *counter, int *done);
297
void setAdaptiveResolutionLevel (Post_View * view , int levelmax,
298
GMSH_Post_Plugin *plug = 0);
299
void initWithLowResolution (Post_View *view);
300
void setTolerance (const double eps) { tol=eps; }
301
double getTolerance () const { return tol; }
302
template <class ELEM>
303
int zoomElement (Post_View * view, int ielem, int level, int levelmax,
304
GMSH_Post_Plugin *plug, List_T *theList, int *counter);
266
void setAdaptiveResolutionLevel(PViewDataList *data, int levelmax,
267
GMSH_Post_Plugin *plug=0);
268
template <class ELEM>
269
void setAdaptiveResolutionLevel_TEMPL(int level, int lemvelmax,
270
GMSH_Post_Plugin *plug, List_T **myList,
271
int *counter, int *done);
272
void initWithLowResolution(PViewDataList *data);
273
void setTolerance(const double eps) { tol = eps; }
274
double getTolerance() const { return tol; }
275
template <class ELEM>
276
int zoomElement(int ielem, int level, int levelmax,
277
GMSH_Post_Plugin *plug, List_T *theList, int *counter);
307
280
template <class ELEM>
310
typename std::list<ELEM*>::iterator it = ELEM::all_elems.begin();
311
typename std::list<ELEM*>::iterator ite = ELEM::all_elems.end();
312
for (; it != ite; ++it){
283
typename std::list<ELEM*>::iterator it = ELEM::all_elems.begin();
284
typename std::list<ELEM*>::iterator ite = ELEM::all_elems.end();
285
for(; it != ite; ++it){
315
288
ELEM::all_elems.clear();