ParMooN
 All Classes Functions Variables Friends Pages
MovingNavierStokes.h
1 // ======================================================================
2 // @(#)MovingNavierStokes.h 1.1 10/19/99
3 //
4 // Assembling routine for all matrices and right-hand sides
5 // ======================================================================
6 
7 #ifndef __MOVINGNAVIERSTOKES__
8 #define __MOVINGNAVIERSTOKES__
9 
10 // ======================================================================
11 // declaration for all Navier-Stokes problems of type 1
12 // one A block,
13 // M block from time discretization
14 // B1, B2 (divergence blocks)
15 // ======================================================================
16 
17 int MovingNSType1N_Terms = 4;
18 MultiIndex2D MovingNSType1Derivatives[4] = { D10, D01, D00, D00 };
19 int MovingNSType1SpaceNumbers[4] = { 0, 0, 0, 1 };
20 int MovingNSType1N_Matrices = 4;
21 int MovingNSType1RowSpace[4] = { 0, 0, 1, 1 };
22 int MovingNSType1ColumnSpace[4] = { 0, 0, 0, 0 };
23 int MovingNSType1N_Rhs = 2;
24 int MovingNSType1RhsSpace[2] = { 0, 0 };
25 
26 // ======================================================================
27 // Type 1, Standard Galerkin
28 // ======================================================================
29 void MovingNSType1Galerkin(double Mult, double *coeff,
30  double *param, double hK,
31  double **OrigValues, int *N_BaseFuncts,
32  double ***LocMatrices, double **LocRhs);
33 
34 // ======================================================================
35 // for Type 1 is no SDFEM available
36 // ======================================================================
37 
38 // ======================================================================
39 // Type 1, for upwind (only laplacian in A block)
40 // ======================================================================
41 void MovingNSType1Upwind(double Mult, double *coeff,
42  double *param, double hK,
43  double **OrigValues, int *N_BaseFuncts,
44  double ***LocMatrices, double **LocRhs);
45 
46 // ======================================================================
47 // declaration for all Navier-Stokes problems of type 2
48 // one A block,
49 // M block from time discretization
50 // B1, B2 (divergence blocks),
51 // B1T, B2T (gradient blocks)
52 // ======================================================================
53 
54 int MovingNSType2N_Terms = 4;
55 MultiIndex2D MovingNSType2Derivatives[4] = { D10, D01, D00, D00 };
56 int MovingNSType2SpaceNumbers[4] = { 0, 0, 0, 1 };
57 int MovingNSType2N_Matrices = 6;
58 int MovingNSType2RowSpace[6] = { 0, 0, 1, 1, 0, 0 };
59 int MovingNSType2ColumnSpace[6] = { 0, 0, 0, 0, 1, 1 };
60 int MovingNSType2N_Rhs = 2;
61 int MovingNSType2RhsSpace[2] = { 0, 0 };
62 
63 // ======================================================================
64 // Type 2, Standard Galerkin
65 // ======================================================================
66 void MovingNSType2Galerkin(double Mult, double *coeff,
67  double *param, double hK,
68  double **OrigValues, int *N_BaseFuncts,
69  double ***LocMatrices, double **LocRhs);
70 
71 // ======================================================================
72 // for Type 2 SDFEM is not available
73 // ======================================================================
74 
75 // ======================================================================
76 // Type 2, Upwind (only Laplacian in A block)
77 // ======================================================================
78 void MovingNSType2Upwind(double Mult, double *coeff,
79  double *param, double hK,
80  double **OrigValues, int *N_BaseFuncts,
81  double ***LocMatrices, double **LocRhs);
82 
83 // ======================================================================
84 // declaration for all Navier-Stokes problems of type 3
85 // all four A blocks,
86 // B1, B2 (divergence blocks),
87 // ======================================================================
88 
89 int MovingNSType3N_Terms = 4;
90 MultiIndex2D MovingNSType3Derivatives[4] = { D10, D01, D00, D00 };
91 int MovingNSType3SpaceNumbers[4] = { 0, 0, 0, 1 };
92 int MovingNSType3N_Matrices = 8;
93 int MovingNSType3RowSpace[8] = { 0, 0, 0, 0, 0, 0, 1, 1 };
94 int MovingNSType3ColumnSpace[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
95 int MovingNSType3N_Rhs = 2;
96 int MovingNSType3RhsSpace[2] = { 0, 0 };
97 
98 // ======================================================================
99 // Type 3, Standard Galerkin, (grad u, grad v)
100 // ======================================================================
101 void MovingNSType3Galerkin(double Mult, double *coeff,
102  double *param, double hK,
103  double **OrigValues, int *N_BaseFuncts,
104  double ***LocMatrices, double **LocRhs);
105 
106 // ======================================================================
107 // Type 3, Standard Galerkin, D(u):D(v)
108 // ======================================================================
109 void MovingNSType3GalerkinDD(double Mult, double *coeff,
110  double *param, double hK,
111  double **OrigValues, int *N_BaseFuncts,
112  double ***LocMatrices, double **LocRhs);
113 
114 // ======================================================================
115 // for Type 3 is SDFEM not available
116 // ======================================================================
117 
118 // ======================================================================
119 // Type 3, Upwind (no convection term), (grad u, grad v)
120 // ======================================================================
121 void MovingNSType3Upwind(double Mult, double *coeff,
122  double *param, double hK,
123  double **OrigValues, int *N_BaseFuncts,
124  double ***LocMatrices, double **LocRhs);
125 
126 // ======================================================================
127 // Type 3, Upwind (no convection term), D(u):D(v)
128 // ======================================================================
129 void MovingNSType3UpwindDD(double Mult, double *coeff,
130  double *param, double hK,
131  double **OrigValues, int *N_BaseFuncts,
132  double ***LocMatrices, double **LocRhs);
133 
134 // ======================================================================
135 // declaration for all Navier-Stokes problems of type 4
136 // all four A blocks,
137 // B1, B2 (divergence blocks),
138 // B1T, B2T (gradient blocks)
139 // ======================================================================
140 
141 int MovingNSType4N_Terms = 4;
142 MultiIndex2D MovingNSType4Derivatives[4] = { D10, D01, D00, D00 };
143 int MovingNSType4SpaceNumbers[4] = { 0, 0, 0, 1 };
144 int MovingNSType4N_Matrices = 10;
145 int MovingNSType4RowSpace[10] = { 0, 0, 0, 0, 0, 0, 1, 1, 0, 0 };
146 int MovingNSType4ColumnSpace[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };
147 int MovingNSType4N_Rhs = 2;
148 int MovingNSType4RhsSpace[2] = { 0, 0 };
149 
150 // ======================================================================
151 // Type 4, Standard Galerkin, (grad u, grad v)
152 // ======================================================================
153 void MovingNSType4Galerkin(double Mult, double *coeff,
154  double *param, double hK,
155  double **OrigValues, int *N_BaseFuncts,
156  double ***LocMatrices, double **LocRhs);
157 
158 // ======================================================================
159 // Type 4, Standard Galerkin, D(u):D(v)
160 // ======================================================================
161 void MovingNSType4GalerkinDD(double Mult, double *coeff,
162  double *param, double hK,
163  double **OrigValues, int *N_BaseFuncts,
164  double ***LocMatrices, double **LocRhs);
165 
166 // ======================================================================
167 // for Type 4 SDFEM is not available
168 // ======================================================================
169 
170 // ======================================================================
171 // Type 4, Upwind (no convection terms), (grad u, grad v)
172 // ======================================================================
173 void MovingNSType4Upwind(double Mult, double *coeff,
174  double *param, double hK,
175  double **OrigValues, int *N_BaseFuncts,
176  double ***LocMatrices, double **LocRhs);
177 
178 // ======================================================================
179 // Type 4, Upwind (no convection terms), D(u):D(v)
180 // ======================================================================
181 void MovingNSType4UpwindDD(double Mult, double *coeff,
182  double *param, double hK,
183  double **OrigValues, int *N_BaseFuncts,
184  double ***LocMatrices, double **LocRhs);
185 
186 // ======================================================================
187 // Assembling routine for all nonlinear matrices
188 // ======================================================================
189 
190 // ======================================================================
191 // declaration for all Navier-Stokes problems of type 1
192 // one nonlinear A block
193 // WITHOUT right hand sides
194 // ======================================================================
195 
196 int MovingNSType1NLN_Terms = 3;
197 MultiIndex2D MovingNSType1NLDerivatives[3] = { D10, D01, D00 };
198 int MovingNSType1NLSpaceNumbers[4] = { 0, 0, 0 };
199 int MovingNSType1NLN_Matrices = 1;
200 int MovingNSType1NLRowSpace[1] = { 0 };
201 int MovingNSType1NLColumnSpace[1] = { 0 };
202 int MovingNSType1NLN_Rhs = 0;
203 int *MovingNSType1NLRhsSpace = NULL;
204 
205 // ======================================================================
206 // Type 1, Standard Galerkin, only nonlinear part
207 // ======================================================================
208 void MovingNSType1NLGalerkin(double Mult, double *coeff,
209  double *param, double hK,
210  double **OrigValues, int *N_BaseFuncts,
211  double ***LocMatrices, double **LocRhs);
212 
213 // ======================================================================
214 // Type 1, for upwind (only laplacian in A block)
215 // ======================================================================
216 void MovingNSType1NLUpwind(double Mult, double *coeff,
217  double *param, double hK,
218  double **OrigValues, int *N_BaseFuncts,
219  double ***LocMatrices, double **LocRhs);
220 
221 // ======================================================================
222 // declaration for all Navier-Stokes problems of type 2
223 // one A block,
224 // WITHOUT B1T, B2T (gradient blocks)
225 // WITHOUT right hand sides
226 // ======================================================================
227 
228 int MovingNSType2NLN_Terms = 3;
229 MultiIndex2D MovingNSType2NLDerivatives[3] = { D10, D01, D00 };
230 int MovingNSType2NLSpaceNumbers[3] = { 0, 0, 0 };
231 int MovingNSType2NLN_Matrices = 1;
232 int MovingNSType2NLRowSpace[1] = { 0 };
233 int MovingNSType2NLColumnSpace[1] = { 0 };
234 int MovingNSType2NLN_Rhs = 0;
235 int *MovingNSType2NLRhsSpace = NULL;
236 
237 // ======================================================================
238 // Type 2, Standard Galerkin, only nonlinear part
239 // ======================================================================
240 void MovingNSType2NLGalerkin(double Mult, double *coeff,
241  double *param, double hK,
242  double **OrigValues, int *N_BaseFuncts,
243  double ***LocMatrices, double **LocRhs);
244 
245 // ======================================================================
246 // Type 2, Upwind (only Laplacian in A block)
247 // ======================================================================
248 void MovingNSType2NLUpwind(double Mult, double *coeff,
249  double *param, double hK,
250  double **OrigValues, int *N_BaseFuncts,
251  double ***LocMatrices, double **LocRhs);
252 
253 // ======================================================================
254 // declaration for all Navier-Stokes problems of type 3
255 // main diagonal blocks A11, A22
256 // WITHOUT right hand sides
257 // ======================================================================
258 
259 int MovingNSType3NLN_Terms = 3;
260 MultiIndex2D MovingNSType3NLDerivatives[3] = { D10, D01, D00 };
261 int MovingNSType3NLSpaceNumbers[3] = { 0, 0, 0 };
262 int MovingNSType3NLN_Matrices = 2;
263 int MovingNSType3NLRowSpace[2] = { 0, 0 };
264 int MovingNSType3NLColumnSpace[2] = { 0, 0 };
265 int MovingNSType3NLN_Rhs = 0;
266 int *MovingNSType3NLRhsSpace = NULL;
267 
268 // ======================================================================
269 // Type 3, Standard Galerkin, (grad u, grad v), only nonlinear part
270 // ======================================================================
271 void MovingNSType3NLGalerkin(double Mult, double *coeff,
272  double *param, double hK,
273  double **OrigValues, int *N_BaseFuncts,
274  double ***LocMatrices, double **LocRhs);
275 
276 // ======================================================================
277 // Type 3, Standard Galerkin, D(u):D(v), only nonlinear diagonal blocks
278 // ======================================================================
279 void MovingNSType3NLGalerkinDD(double Mult, double *coeff,
280  double *param, double hK,
281  double **OrigValues, int *N_BaseFuncts,
282  double ***LocMatrices, double **LocRhs);
283 
284 // ======================================================================
285 // Type 3, Upwind (no convection term), (grad u, grad v)
286 // ======================================================================
287 void MovingNSType3NLUpwind(double Mult, double *coeff,
288  double *param, double hK,
289  double **OrigValues, int *N_BaseFuncts,
290  double ***LocMatrices, double **LocRhs);
291 
292 // ======================================================================
293 // Type 3, Upwind (no convection term), D(u):D(v)
294 // ======================================================================
295 void MovingNSType3NLUpwindDD(double Mult, double *coeff,
296  double *param, double hK,
297  double **OrigValues, int *N_BaseFuncts,
298  double ***LocMatrices, double **LocRhs);
299 
300 // ======================================================================
301 // declaration for all Navier-Stokes problems of type 4
302 // main diagonal blocks A11, A22
303 // WITHOUT B1T, B2T (gradient blocks)
304 // WITHOUT right hand sides
305 // ======================================================================
306 
307 int MovingNSType4NLN_Terms = 3;
308 MultiIndex2D MovingNSType4NLDerivatives[3] = { D10, D01, D00 };
309 int MovingNSType4NLSpaceNumbers[3] = { 0, 0, 0 };
310 int MovingNSType4NLN_Matrices = 2;
311 int MovingNSType4NLRowSpace[2] = { 0, 0 };
312 int MovingNSType4NLColumnSpace[2] = { 0, 0 };
313 int MovingNSType4NLN_Rhs = 0;
314 int *MovingNSType4NLRhsSpace = NULL;
315 
316 // ======================================================================
317 // Type 4, Standard Galerkin, (grad u, grad v), only nonlinear part
318 // ======================================================================
319 void MovingNSType4NLGalerkin(double Mult, double *coeff,
320  double *param, double hK,
321  double **OrigValues, int *N_BaseFuncts,
322  double ***LocMatrices, double **LocRhs);
323 
324 // ======================================================================
325 // Type 4, Standard Galerkin, D(u):D(v), only nonlinear part
326 // ======================================================================
327 void MovingNSType4NLGalerkinDD(double Mult, double *coeff,
328  double *param, double hK,
329  double **OrigValues, int *N_BaseFuncts,
330  double ***LocMatrices, double **LocRhs);
331 
332 // ======================================================================
333 // Type 4, Upwind (no convection terms), (grad u, grad v)
334 // ======================================================================
335 void MovingNSType4NLUpwind(double Mult, double *coeff,
336  double *param, double hK,
337  double **OrigValues, int *N_BaseFuncts,
338  double ***LocMatrices, double **LocRhs);
339 
340 // ======================================================================
341 // Type 4, Upwind (no convection terms), D(u):D(v)
342 // ======================================================================
343 void MovingNSType4NLUpwindDD(double Mult, double *coeff,
344  double *param, double hK,
345  double **OrigValues, int *N_BaseFuncts,
346  double ***LocMatrices, double **LocRhs);
347 
348 // ======================================================================
349 // Assembling routine for right-hand sides only
350 // ======================================================================
351 
352 // ======================================================================
353 // declaration for all Navier-Stokes problems
354 // ONLY right hand sides
355 // ======================================================================
356 
357 int MovingNSRHSN_Terms = 1;
358 MultiIndex2D MovingNSRHSDerivatives[1] = { D00 };
359 int MovingNSRHSSpaceNumbers[1] = { 0 };
360 int MovingNSRHSN_Matrices = 0;
361 int *MovingNSRHSRowSpace = NULL;
362 int *MovingNSRHSColumnSpace = NULL;
363 int MovingNSRHSN_Rhs = 2;
364 int MovingNSRHSRhsSpace[2] = { 0, 0 };
365 
366 // ======================================================================
367 // right-hand side ONLY
368 // ======================================================================
369 void MovingNSRHS(double Mult, double *coeff,
370  double *param, double hK,
371  double **OrigValues, int *N_BaseFuncts,
372  double ***LocMatrices, double **LocRhs);
373 
374 // ======================================================================
375 // setting for error calculation for all types
376 // ======================================================================
377 MultiIndex2D MovingNSAllDerivatives[3] = { D00, D10, D01 };
378 
379 // ========================================================================
380 // parameter routines
381 // ========================================================================
382 
383 // ========================================================================
384 // parameters: u1old, u2old
385 // ========================================================================
386 void MovingNSParams2(double *in, double *out);
387 
388 int MovingNSN_FESpaces2 = 1;
389 int MovingNSN_Fct2 = 2;
390 int MovingNSN_ParamFct2 = 1;
391 int MovingNSN_FEValues2 = 2;
392 int MovingNSN_Params2 = 2;
393 int MovingNSFEFctIndex2[2] = { 0, 1 };
394 MultiIndex2D MovingNSFEMultiIndex2[2] = { D00, D00 };
395 ParamFct *MovingNSFct2[1] = { MovingNSParams2 };
396 int MovingNSBeginParam2[1] = { 0 };
397 
398 // ======================================================================
399 // parameters u1old, u2old, gridv_x, gridv_y
400 // ======================================================================
401 void GridParams4(double *in, double *out);
402 
403 int GridN_FESpaces4 = 2;
404 int GridN_Fct4 = 4;
405 int GridN_ParamFct4 = 1;
406 int GridN_FEValues4 = 4;
407 int GridN_Params4 = 2;
408 int GridFEFctIndex4[4] = { 0, 1, 2, 3 };
409 MultiIndex2D GridFEMultiIndex4[4] = { D00, D00, D00, D00 };
410 ParamFct *GridFct4[1] = { GridParams4 };
411 int GridBeginParam4[1] = { 0 };
412 
413 // ======================================================================
414 // declaration for grid moving matrix
415 // one A block,
416 // ======================================================================
417 
418 int GridN_Terms = 2;
419 MultiIndex2D GridDerivatives[2] = { D10, D01 };
420 int GridSpaceNumbers[2] = { 0, 0 };
421 int GridN_Matrices = 1;
422 int GridRowSpace[1] = { 0 };
423 int GridColumnSpace[1] = { 0 };
424 int GridN_Rhs = 0;
425 int *GridRhsSpace = NULL;
426 
427 // ======================================================================
428 // Type 1, Standard Galerkin
429 // ======================================================================
430 void GridAssemble(double Mult, double *coeff,
431  double *param, double hK,
432  double **OrigValues, int *N_BaseFuncts,
433  double ***LocMatrices, double **LocRhs);
434 
435 // // kind of boundary condition (for FE space needed)
436 // void GridBoundCondition(int BdComp, double t, BoundCond &cond);
437 //
438 // // value of boundary condition
439 // void GridBoundValue(int BdComp, double Param, double &value);
440 //
441 // void GridCoeffs(int n_points, double *x, double *y,
442 // double **parameters, double **coeffs);
443 
444 #endif