ParMooN
 All Classes Functions Variables Friends Pages
Constants.h
1 // =======================================================================
2 // @(#)Constants.h 1.15 04/13/00
3 //
4 // Purpose: constains important constants which are used by several
5 // other classes
6 //
7 // Author: Volker Behns 09.07.97
8 //
9 // =======================================================================
10 
11 #ifndef __CONSTANTS__
12 #define __CONSTANTS__
13 
14 #ifdef NULL
15  #undef NULL
16 #endif
17 
18 #define NULL 0
19 
20 #include <math.h>
21 
22 #ifdef __2D__
23 #define GEO_DIM 2
24 #else
25 #define GEO_DIM 3
26 #endif
27 
28 
29 #define Pi M_PI
30 #define ln2 log((double) 2.0)
31 
32 #ifndef __LINUX__
33  #define Abs(x) abs(x)
34 #else
35  #define Abs(x) fabs(x)
36 #endif
37 
38 #define SizeOfPointer ((long) 4)
39 #define SizeOfInt ((long) 4)
40 #define SizeOfFloat ((long) 4)
41 #define SizeOfDouble ((long) 8)
42 
43 #ifdef __COMPAQ__
44  #undef SizeOfPointer
45  #define SizeOfPointer ((long) 8)
46 #endif
47 
48 #ifdef __HPaCC64__
49  #undef SizeOfPointer
50  #define SizeOfPointer ((long) 8)
51 #endif
52 
53 #ifdef FALSE
54 #undef FALSE
55 #endif
56 #ifdef TRUE
57 #undef TRUE
58 #endif
59 
60 #ifdef _MPI
61  #define BYADD 0
62  #define BYMASTER 1
63  #define BYOWN 2
64 #endif
65 
66 enum boolean {FALSE, TRUE};
67 
68 #define N_BOUNDCOND 10
69 enum BoundCond { DIRICHLET, NEUMANN, ROBIN, SLIP, FREESURF,
70  SLIP_FRICTION_PENETRATION_RESISTANCE,
71  INTERFACE, SUBDOMAIN_INTERFACE, SUBDOMAIN_HALOBOUND, DIRICHLET_WEAK};
72 
73 enum JointType {Joint, JointEqN, MortarBaseJoint, MortarJoint,
74  BoundaryPoint, BoundaryEdge, BoundaryFace,
75  InterfaceJoint, PeriodicJoint, IsoInterfaceJoint,
76  IsoJointEqN, IsoBoundEdge, IsoBoundFace,
77  Joint_2to1,
78  InterfaceJoint3D, IsoInterfaceJoint3D,
79  SubDomainJoint, SubDomainHaloJoint, InnerInterfaceJoint,
80  InnerEdge, IsoEdge3D, BDEdge3D};
81 
82 typedef void DoubleFunct1D(double, double *);
83 typedef void DoubleFunct2D(double, double, double *);
84 typedef void DoubleFunct3D(double, double, double, double *);
85 typedef void DoubleFunctND(int, double *, double *);
86 typedef void DoubleFunctVect(double *, double *);
87 typedef int IntFunct2D(double, double);
88 typedef double DoubleFunct2Param(double, double);
89 
90 typedef void BoundCondFunct3D(int, double, double, double, BoundCond &);
91 typedef void BoundValueFunct3D(int, double, double, double, double &);
92 typedef void BoundCondFunct2D(int, double, BoundCond &);
93 typedef void BoundValueFunct2D(int, double, double &);
94 
95 typedef void ErrorMethod2D(int, double *, double *,
96  double *, double *, double,
97  double **, double **,
98  double **, double *);
99 
100 typedef void ErrorMethod3D(int, double *, double *, double *,
101  double *, double *, double,
102  double **, double **,
103  double **, double *);
104 
105 typedef DoubleFunctVect ParamFct;
106 
107 typedef void CoeffFct2D(int n_points, double *X, double *Y,
108  double **param, double **coeffs);
109 
110 typedef void CoeffFct3D(int n_points, double *X, double *Y, double *Z,
111  double **param, double **coeffs);
112 
113 typedef void CoeffFctND(int n_points, int N_Dim, double **Coords,
114  double **param, double **coeffs);
115 
116 typedef void AssembleFct2D(double, double *, double, double **,
117  int *, double ***, double **);
118 
119 typedef void AssembleFctParam2D(double, double *, double *,
120  double, double **,
121  int *, double ***, double **);
122 
123 typedef void AssembleFct3D(double, double *, double, double **,
124  int *, double ***, double **);
125 
126 typedef void AssembleFctParam3D(double, double *, double *,
127  double, double **,
128  int *, double ***, double **);
129 
130 class TBaseCell;
131 typedef void ManipulateFct2D(int, double **, double **, TBaseCell *);
132 
133 typedef void ManipulateFct3D(int, double **, double **, TBaseCell *);
134 
135 class TCollection;
136 typedef void EvalAllNF(TCollection *, TBaseCell *, double *, double *);
137 typedef void EvalJointNF(TCollection *, TBaseCell *, int, double *, double *);
138 
139 class TFESpace2D;
140 typedef void CheckWrongNeumannNodesFunct2D(TCollection *, TFESpace2D *,
141  int &, int* &,
142  int* &,
143  double* &);
144 
145 class TSquareMatrix;
146 class TMatrix;
147 typedef void MatVecProc(TSquareMatrix **, TMatrix **, double *, double *);
148 typedef void DefectProc(TSquareMatrix **, TMatrix **, double *, double *,
149  double *);
150 
151 class TVertex;
152 class TIsoBoundEdge;
153 typedef void ModifyMeshCoords(double , double , double &, double &, double );
154 
155 typedef void ModifyBoundCoords(int, TVertex **, TIsoBoundEdge **, double *, double);
156 
157 typedef void ModifyBoundCoords_3D(int,
158  TVertex **,
159  int,
160  int *,
161  TBaseCell **,
162  double);
163 typedef void ModifyMeshCoords_3D(double , double ,double , double &, double &,double &, double );
164 
165 
166 
167 #ifdef _MPI
168 class TParVectorNSE3D;
169 typedef void ParDefectProc(TSquareMatrix **, TMatrix **, TParVectorNSE3D *, TParVectorNSE3D *,
170  TParVectorNSE3D *);
171 #endif
172 
173 typedef int TypeBoundSwitchFunct2D(int, double );
174 
175 class TFEFunction2D;
176 class TFEVectFunct2D;
177 typedef void EvaluateSolutionFunct2D(TFEFunction2D **, TFEVectFunct2D **,
178  double *, int *);
179 
180 
181 #define GALERKIN 1
182 #define SDFEM 2
183 #define SUPG 2
184 #define UPWIND 3
185 #define SMAGORINSKY 4
186 #define SMAGORINSKY_EXPL 5
187 #define CLASSICAL_LES 6
188 #define GL00_CONVOLUTION 7
189 #define GL00_AUX_PROBLEM 8
190 #define VMS_PROJECTION 9
191 #define VMS_PROJECTION_EXPL 10
192 #define VMS_RFB_EXPL 11
193 #define VMS_PROJECTION_SD 12
194 #define VMS_RFB_EXPL_COUPLED 13
195 #define LERAY_ALPHA_EXPL 16
196 #define LERAY_ALPHA_IMPL 17
197 #define NSE_RFB 21
198 #define SDFEM_DIVDIV 5
199 #define LOCAL_PROJECTION 14
200 #define LOCAL_PROJECTION_2_LEVEL 15
201 #define CIP 4
202 #define DG 5
203 #define GLS 6
204 #define FD 0
205 #define ENO_3 13
206 #define WENO_5 14
207 #define HEATLINE 100
208 
209 #define OSEEN_PROBLEM 13
210 
211 #define HMM86 0
212 #define TP86_1 1
213 #define TP86_2 2
214 #define JSW87 3
215 #define GdC88 4
216 #define dCG91 5
217 #define dCA03 6
218 #define AS97 7
219 #define C93 8
220 #define KLR02_1 9
221 #define KLR02_2 10
222 #define KLR02_3 11
223 #define KLR02_4 12
224 #define J90 13
225 #define BE02_1 14
226 #define BE02_2 15
227 #define BH04 16
228 #define BE05_1 17
229 #define BE05_2 18
230 #define LP96 19
231 #define CS99 20
232 #define MH_Kno06 21
233 #define BE02_3 22
234 //#define ALG_FLUX_CORR 23
235 #define Y_Z_BETA 24
236 #define JSW87_1 25
237 #define FEM_FCT 50
238 #define FEM_FCT_LIN 51
239 #define FEM_TVD 52
240 #define GENERAL_SOLD 200
241 
242 #define SD_POWER_H 1.0
243 #define SD_FACTOR_H 1.0
244 
245 #define BULK_FWE_FDM_UPWIND 0
246 #define BULK_BWE_FDM_UPWIND 1
247 #define BULK_BWE_FEM_SUPG 2
248 #define BULK_FEM_FCT 3
249 
250 #define WINDTUNNEL_LAYER_NUMBER_X_CONST 4
251 #define WINDTUNNEL_DIM_Y_CONST 47
252 // be careful number of grid points plus 1 right dimension 46
253 #define WINDTUNNEL_DIM_Z_CONST 20
254 // be careful number of grid points plus 1 right dimension 19
255 #define WINDTUNNEL_DIM_R_CONST 47
256 //#define WINDTUNNEL_DIM_R_CONST 51
257 // be careful number of grid points plus 1 right dimension 45
258 
259 #define WINDTUNNEL_FWE_FDM_UPWIND 0
260 #define WINDTUNNEL_BWE_FDM_UPWIND 1
261 #define WINDTUNNEL_FEM_FCT 2
262 
263 #define UREA_FWE_FDM_UPWIND 0
264 #define UREA_BWE_FDM_UPWIND 1
265 #define UREA_FEM_FCT 2
266 
267 #define PB_RKV_ENO 4
268 
269 #define ABS(i) (((i)<0) ? (-(i)) : (i))
270 
271 #ifdef MIN
272  #undef MIN
273 #endif
274 
275 #ifdef MAX
276  #undef MAX
277 #endif
278 
279 #ifndef __HPaCC__
280 #ifndef __HPaCC64__
281 #define MIN(x,y) (((x)<(y)) ? (x) : (y))
282 #define MAX(x,y) (((x)>(y)) ? (x) : (y))
283 #endif
284 #endif
285 
286 #define POW2(i) (1<<(i))
287 #define POW(a,b) ((b==1)?(a):((b==2)?((a)*(a)):((b==0)?(1):(pow(a,b)))))
288 #define ABSDIFF(a,b) (fabs((a)-(b)))
289 
290 #define SIGN(a) ((a>0)?(1):((a<0)?(-1):(0)))
291 
292 double GetTime();
293 int GetMemory();
294 
295 #define AMG_SOLVE 0
296 #define GMG 1
297 #define DIRECT 2
298 
299 // maybe we should define more types here (like CD, TCD, TNSE, TSTOKES,...)
300 #define NSE 0
301 #define STOKES 1
302 #define OSEEN 2
303 
304 #define SCALAR 100
305 
306 #define MAXN_LEVELS 100
307 
308 #ifdef _MPI
309  #define BEGIN_SEQ \
310  MPI_Barrier(comm); \
311  for(int _i=0;_i<size;++_i) \
312  { \
313  if ( rank == _i ) \
314  {
315 
316  #define END_SEQ \
317  } \
318  MPI_Barrier(comm); \
319  }
320 #endif
321 
322 #endif
Definition: Matrix.h:21
Definition: IsoBoundEdge.h:18
Definition: FESpace2D.h:28
store cells in an array, used by cell iterators
Definition: Collection.h:18
Definition: SquareMatrix.h:20
Definition: FEVectFunct2D.h:23
information for finite element data structure
Definition: BaseCell.h:25
Definition: Vertex.h:19
Definition: FEFunction2D.h:24