ParMooN
 All Classes Functions Variables Friends Pages
TNSE3D_FixPo.h
1 // ======================================================================
2 // @(#)TNSE3D_FixPo.h 1.2 05/05/00
3 //
4 // common declaration for all time dependent Navier-Stokes problems
5 // ======================================================================
6 
7 #ifndef __TNSE3D_FIXPO__
8 #define __TNSE3D_FIXPO__
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 static int TimeNSType1N_Terms = 5;
18 static MultiIndex3D TimeNSType1Derivatives[5] = { D100, D010, D001, D000, D000 };
19 static int TimeNSType1SpaceNumbers[5] = { 0, 0, 0, 0, 1 };
20 static int TimeNSType1N_Matrices = 5;
21 static int TimeNSType1RowSpace[5] = { 0, 0, 1, 1, 1 };
22 static int TimeNSType1ColumnSpace[5] = { 0, 0, 0, 0, 0 };
23 static int TimeNSType1N_Rhs = 3;
24 static int TimeNSType1RhsSpace[3] = { 0, 0, 0 };
25 
26 // ======================================================================
27 // Type 1, Standard Galerkin
28 // ======================================================================
29 void TimeNSType1Galerkin3D(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 TimeNSType1Upwind3D(double Mult, double *coeff,
42  double *param, double hK,
43  double **OrigValues, int *N_BaseFuncts,
44  double ***LocMatrices, double **LocRhs);
45 
46 // ======================================================================
47 // Type 1, Smagorinsky
48 // ======================================================================
49 void TimeNSType1Smagorinsky3D(double Mult, double *coeff,
50  double *param, double hK,
51  double **OrigValues, int *N_BaseFuncts,
52  double ***LocMatrices, double **LocRhs);
53 
54 // ======================================================================
55 // Type 1, ClassicalLES
56 // ======================================================================
57 void TimeNSType1ClassicalLES3D(double Mult, double *coeff,
58  double *param, double hK,
59  double **OrigValues, int *N_BaseFuncts,
60  double ***LocMatrices, double **LocRhs);
61 
62 // ======================================================================
63 // Type 1, GL00Convolution
64 // ======================================================================
65 void TimeNSType1GL00Convolution3D(double Mult, double *coeff,
66  double *param, double hK,
67  double **OrigValues, int *N_BaseFuncts,
68  double ***LocMatrices, double **LocRhs);
69 
70 // ======================================================================
71 // Type 1, GL00AuxProblem
72 // ======================================================================
73 static int TimeNSType1GL00AuxProblemN_Matrices = 6;
74 static int TimeNSType1GL00AuxProblemRowSpace[6] = { 0, 0, 2, 1, 1, 1 };
75 static int TimeNSType1GL00AuxProblemColumnSpace[6] = { 0, 0, 2, 0, 0, 0 };
76 
77 void TimeNSType1GL00AuxProblem3D(double Mult, double *coeff,
78  double *param, double hK,
79  double **OrigValues, int *N_BaseFuncts,
80  double ***LocMatrices, double **LocRhs);
81 
82 // ======================================================================
83 // declaration for all Navier-Stokes problems of type 2
84 // one A block,
85 // M block from time discretization
86 // B1, B2 (divergence blocks),
87 // B1T, B2T (gradient blocks)
88 // ======================================================================
89 
90 static int TimeNSType2N_Terms = 5;
91 static MultiIndex3D TimeNSType2Derivatives[5] = { D100, D010, D001, D000, D000 };
92 static int TimeNSType2SpaceNumbers[5] = { 0, 0, 0, 0, 1 };
93 static int TimeNSType2N_Matrices = 8;
94 static int TimeNSType2RowSpace[8] = { 0, 0, 1, 1, 1, 0, 0, 0 };
95 static int TimeNSType2ColumnSpace[8] = { 0, 0, 0, 0, 0, 1, 1, 1 };
96 static int TimeNSType2N_Rhs = 3;
97 static int TimeNSType2RhsSpace[3] = { 0, 0, 0 };
98 
99 // ======================================================================
100 // Type 2, Standard Galerkin
101 // ======================================================================
102 void TimeNSType2Galerkin3D(double Mult, double *coeff,
103  double *param, double hK,
104  double **OrigValues, int *N_BaseFuncts,
105  double ***LocMatrices, double **LocRhs);
106 
107 // ======================================================================
108 // for Type 2 SDFEM is not available
109 // ======================================================================
110 
111 // ======================================================================
112 // Type 2, Upwind (only Laplacian in A block)
113 // ======================================================================
114 void TimeNSType2Upwind3D(double Mult, double *coeff,
115  double *param, double hK,
116  double **OrigValues, int *N_BaseFuncts,
117  double ***LocMatrices, double **LocRhs);
118 
119 // ======================================================================
120 // Type 2, Smagorinsky
121 // ======================================================================
122 void TimeNSType2Smagorinsky3D(double Mult, double *coeff,
123  double *param, double hK,
124  double **OrigValues, int *N_BaseFuncts,
125  double ***LocMatrices, double **LocRhs);
126 
127 // ======================================================================
128 // Type 2, ClassicalLES
129 // ======================================================================
130 void TimeNSType2ClassicalLES3D(double Mult, double *coeff,
131  double *param, double hK,
132  double **OrigValues, int *N_BaseFuncts,
133  double ***LocMatrices, double **LocRhs);
134 
135 // ======================================================================
136 // Type 2, GL00Convolution
137 // ======================================================================
138 void TimeNSType2GL00Convolution3D(double Mult, double *coeff,
139  double *param, double hK,
140  double **OrigValues, int *N_BaseFuncts,
141  double ***LocMatrices, double **LocRhs);
142 
143 
144 // ======================================================================
145 // Type 2, GL00AuxProblem
146 // ======================================================================
147 static int TimeNSType2GL00AuxProblemN_Matrices = 9;
148 static int TimeNSType2GL00AuxProblemRowSpace[9] = { 0, 0, 2, 1, 1, 1, 0, 0, 0 };
149 static int TimeNSType2GL00AuxProblemColumnSpace[9] = { 0, 0, 2, 0, 0, 0, 1, 1, 1 };
150 
151 void TimeNSType2GL00AuxProblem3D(double Mult, double *coeff,
152  double *param, double hK,
153  double **OrigValues, int *N_BaseFuncts,
154  double ***LocMatrices, double **LocRhs);
155 
156 // ======================================================================
157 // declaration for all Navier-Stokes problems of type 3
158 // all four A blocks,
159 // B1, B2 (divergence blocks),
160 // ======================================================================
161 
162 static int TimeNSType3N_Terms = 5;
163 static MultiIndex3D TimeNSType3Derivatives[5] = { D100, D010, D001, D000, D000 };
164 static int TimeNSType3SpaceNumbers[5] = { 0, 0, 0, 0, 1 };
165 static int TimeNSType3N_Matrices = 15;
166 static int TimeNSType3RowSpace[15] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
167  1, 1, 1 };
168 static int TimeNSType3ColumnSpace[15] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
169  0, 0, 0 };
170 static int TimeNSType3N_Rhs = 3;
171 static int TimeNSType3RhsSpace[3] = { 0, 0, 0 };
172 
173 // ======================================================================
174 // Type 3, Standard Galerkin, (grad u, grad v)
175 // ======================================================================
176 void TimeNSType3Galerkin3D(double Mult, double *coeff,
177  double *param, double hK,
178  double **OrigValues, int *N_BaseFuncts,
179  double ***LocMatrices, double **LocRhs);
180 
181 // ======================================================================
182 // Type 3, Standard Galerkin, D(u):D(v)
183 // ======================================================================
184 void TimeNSType3GalerkinDD3D(double Mult, double *coeff,
185  double *param, double hK,
186  double **OrigValues, int *N_BaseFuncts,
187  double ***LocMatrices, double **LocRhs);
188 
189 // ======================================================================
190 // for Type 3 is SDFEM not available
191 // ======================================================================
192 
193 // ======================================================================
194 // Type 3, Upwind (no convection term), (grad u, grad v)
195 // ======================================================================
196 void TimeNSType3Upwind3D(double Mult, double *coeff,
197  double *param, double hK,
198  double **OrigValues, int *N_BaseFuncts,
199  double ***LocMatrices, double **LocRhs);
200 
201 // ======================================================================
202 // Type 3, Upwind (no convection term), D(u):D(v)
203 // ======================================================================
204 void TimeNSType3UpwindDD3D(double Mult, double *coeff,
205  double *param, double hK,
206  double **OrigValues, int *N_BaseFuncts,
207  double ***LocMatrices, double **LocRhs);
208 
209 // ======================================================================
210 // Type 3, Standard Smagorinsky, (grad u, grad v)
211 // ======================================================================
212 void TimeNSType3Smagorinsky3D(double Mult, double *coeff,
213  double *param, double hK,
214  double **OrigValues, int *N_BaseFuncts,
215  double ***LocMatrices, double **LocRhs);
216 
217 // ======================================================================
218 // Type 3, Standard Smagorinsky, D(u):D(v)
219 // ======================================================================
220 void TimeNSType3SmagorinskyDD3D(double Mult, double *coeff,
221  double *param, double hK,
222  double **OrigValues, int *N_BaseFuncts,
223  double ***LocMatrices, double **LocRhs);
224 
225 // ======================================================================
226 // Type 3, ClassicalLES, (grad u, grad v)
227 // ======================================================================
228 void TimeNSType3ClassicalLES3D(double Mult, double *coeff,
229  double *param, double hK,
230  double **OrigValues, int *N_BaseFuncts,
231  double ***LocMatrices, double **LocRhs);
232 
233 // ======================================================================
234 // Type 3, ClassicalLES, D(u):D(v)
235 // ======================================================================
236 void TimeNSType3ClassicalLESDD3D(double Mult, double *coeff,
237  double *param, double hK,
238  double **OrigValues, int *N_BaseFuncts,
239  double ***LocMatrices, double **LocRhs);
240 
241 // ======================================================================
242 // Type 3, GL00Convolution, (grad u, grad v)
243 // ======================================================================
244 void TimeNSType3GL00Convolution3D(double Mult, double *coeff,
245  double *param, double hK,
246  double **OrigValues, int *N_BaseFuncts,
247  double ***LocMatrices, double **LocRhs);
248 
249 // ======================================================================
250 // Type 3, GL00Convolution, D(u):D(v)
251 // ======================================================================
252 void TimeNSType3GL00ConvolutionDD3D(double Mult, double *coeff,
253  double *param, double hK,
254  double **OrigValues, int *N_BaseFuncts,
255  double ***LocMatrices, double **LocRhs);
256 
257 // ======================================================================
258 // Type 3, GL00AuxProblem, (grad u, grad v)
259 // ======================================================================
260 static int TimeNSType3GL00AuxProblemN_Matrices = 16;
261 static int TimeNSType3GL00AuxProblemRowSpace[16] = { 0, 0, 0, 0, 0, 0,
262  0, 0, 0, 0, 0, 0,
263  2, 1, 1, 1 };
264 static int TimeNSType3GL00AuxProblemColumnSpace[16] = { 0, 0, 0, 0, 0, 0,
265  0, 0, 0, 0, 0, 0,
266  2, 0, 0, 0 };
267 
268 void TimeNSType3GL00AuxProblem3D(double Mult, double *coeff,
269  double *param, double hK,
270  double **OrigValues, int *N_BaseFuncts,
271  double ***LocMatrices, double **LocRhs);
272 
273 // ======================================================================
274 // Type 3, GL00AuxProblem, D(u):D(v)
275 // ======================================================================
276 void TimeNSType3GL00AuxProblemDD3D(double Mult, double *coeff,
277  double *param, double hK,
278  double **OrigValues, int *N_BaseFuncts,
279  double ***LocMatrices, double **LocRhs);
280 
281 // ======================================================================
282 // declaration for all Navier-Stokes problems of type 4
283 // all four A blocks,
284 // B1, B2 (divergence blocks),
285 // B1T, B2T (gradient blocks)
286 // ======================================================================
287 
288 static int TimeNSType4N_Terms = 5;
289 static MultiIndex3D TimeNSType4Derivatives[5] = { D100, D010, D001, D000, D000 };
290 static int TimeNSType4SpaceNumbers[5] = { 0, 0, 0, 0, 1 };
291 static int TimeNSType4N_Matrices = 18;
292 static int TimeNSType4RowSpace[18] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
293  1, 1, 1, 0, 0, 0 };
294 static int TimeNSType4ColumnSpace[18] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
295  0, 0, 0, 1, 1, 1 };
296 static int TimeNSType4N_Rhs = 3;
297 static int TimeNSType4RhsSpace[3] = { 0, 0, 0 };
298 
299 // ======================================================================
300 // Type 4, Standard Galerkin, (grad u, grad v)
301 // ======================================================================
302 void TimeNSType4Galerkin3D(double Mult, double *coeff,
303  double *param, double hK,
304  double **OrigValues, int *N_BaseFuncts,
305  double ***LocMatrices, double **LocRhs);
306 
307 // ======================================================================
308 // Type 4, Standard Galerkin, D(u):D(v)
309 // ======================================================================
310 void TimeNSType4GalerkinDD3D(double Mult, double *coeff,
311  double *param, double hK,
312  double **OrigValues, int *N_BaseFuncts,
313  double ***LocMatrices, double **LocRhs);
314 
315 // ======================================================================
316 // for Type 4 SDFEM is not available
317 // ======================================================================
318 
319 // ======================================================================
320 // Type 4, Upwind (no convection terms), (grad u, grad v)
321 // ======================================================================
322 void TimeNSType4Upwind3D(double Mult, double *coeff,
323  double *param, double hK,
324  double **OrigValues, int *N_BaseFuncts,
325  double ***LocMatrices, double **LocRhs);
326 
327 // ======================================================================
328 // Type 4, Upwind (no convection terms), D(u):D(v)
329 // ======================================================================
330 void TimeNSType4UpwindDD3D(double Mult, double *coeff,
331  double *param, double hK,
332  double **OrigValues, int *N_BaseFuncts,
333  double ***LocMatrices, double **LocRhs);
334 
335 // ======================================================================
336 // Type 4, Smagorinsky, (grad u, grad v)
337 // ======================================================================
338 void TimeNSType4Smagorinsky3D(double Mult, double *coeff,
339  double *param, double hK,
340  double **OrigValues, int *N_BaseFuncts,
341  double ***LocMatrices, double **LocRhs);
342 
343 // ======================================================================
344 // Type 4, Smagorinsky, D(u):D(v)
345 // ======================================================================
346 void TimeNSType4SmagorinskyDD3D(double Mult, double *coeff,
347  double *param, double hK,
348  double **OrigValues, int *N_BaseFuncts,
349  double ***LocMatrices, double **LocRhs);
350 
351 // ======================================================================
352 // Type 4, ClassicalLES, (grad u, grad v)
353 // ======================================================================
354 void TimeNSType4ClassicalLES3D(double Mult, double *coeff,
355  double *param, double hK,
356  double **OrigValues, int *N_BaseFuncts,
357  double ***LocMatrices, double **LocRhs);
358 
359 // ======================================================================
360 // Type 4, ClassicalLES, D(u):D(v)
361 // ======================================================================
362 void TimeNSType4ClassicalLESDD3D(double Mult, double *coeff,
363  double *param, double hK,
364  double **OrigValues, int *N_BaseFuncts,
365  double ***LocMatrices, double **LocRhs);
366 
367 // ======================================================================
368 // Type 4, GL00Convolution, (grad u, grad v)
369 // ======================================================================
370 void TimeNSType4GL00Convolution3D(double Mult, double *coeff,
371  double *param, double hK,
372  double **OrigValues, int *N_BaseFuncts,
373  double ***LocMatrices, double **LocRhs);
374 
375 // ======================================================================
376 // Type 4, GL00Convolution, D(u):D(v)
377 // ======================================================================
378 void TimeNSType4GL00ConvolutionDD3D(double Mult, double *coeff,
379  double *param, double hK,
380  double **OrigValues, int *N_BaseFuncts,
381  double ***LocMatrices, double **LocRhs);
382 
383 // ======================================================================
384 // Type 4, GL00AuxProblem, (grad u, grad v)
385 // ======================================================================
386 static int TimeNSType4GL00AuxProblemN_Matrices = 19;
387 static int TimeNSType4GL00AuxProblemRowSpace[19] =
388  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 1, 0, 0, 0 };
389 static int TimeNSType4GL00AuxProblemColumnSpace[19] =
390  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 1, 1 };
391 
392 void TimeNSType4GL00AuxProblem3D(double Mult, double *coeff,
393  double *param, double hK,
394  double **OrigValues, int *N_BaseFuncts,
395  double ***LocMatrices, double **LocRhs);
396 
397 // ======================================================================
398 // Type 4, GL00AuxProblem, D(u):D(v)
399 // ======================================================================
400 void TimeNSType4GL00AuxProblemDD3D(double Mult, double *coeff,
401  double *param, double hK,
402  double **OrigValues, int *N_BaseFuncts,
403  double ***LocMatrices, double **LocRhs);
404 
405 // ======================================================================
406 // Type 4, VMS_Projection, D(u):D(v)
407 // ======================================================================
408 static int TimeNSType4VMS_ProjectionN_Terms = 6;
409 static MultiIndex3D TimeNSType4VMS_ProjectionDerivatives[6] = { D100, D010, D001, D000, D000, D000 };
410 static int TimeNSType4VMS_ProjectionSpaceNumbers[6] = { 0, 0, 0, 0, 1, 2 };
411 static int TimeNSType4VMS_ProjectionN_Matrices = 25;
412 static int TimeNSType4VMS_ProjectionRowSpace[25] = { 0, 0, 0, 0, 0, 0,
413  0, 0, 0, 0, 0, 0,
414  2, 1, 1, 1, 0, 0, 0,
415  0, 0, 0, 2, 2, 2};
416 
417 static int TimeNSType4VMS_ProjectionColumnSpace[25] = { 0, 0, 0, 0, 0, 0,
418  0, 0, 0, 0, 0, 0,
419  2, 0, 0, 0, 1, 1, 1,
420  2, 2, 2, 0, 0, 0};
421 
422 void TimeNSType4VMS_ProjectionDD3D(double Mult, double *coeff,
423  double *param, double hK,
424  double **OrigValues, int *N_BaseFuncts,
425  double ***LocMatrices, double **LocRhs);
426 
427 
428 // ======================================================================
429 // Type 4, VMS_Projection with streamline formulation D(u):D(v)
430 // ======================================================================
431 
432 void TimeNSType4VMS_ProjectionStreamlineDD3D(double Mult, double *coeff,
433  double *param, double hK,
434  double **OrigValues, int *N_BaseFuncts,
435  double ***LocMatrices, double **LocRhs);
436 
437 // ======================================================================
438 // declaration for SUPG
439 // ONLY right hand sides
440 // ======================================================================
441 
442 static int TimeNSVMS_Rhs_SUPGN_Terms = 7;
443 static MultiIndex3D TimeNSVMS_Rhs_SUPGDerivatives[7] = { D100, D010, D001, D000,
444  D100, D010, D001 };
445 static int TimeNSVMS_Rhs_SUPGSpaceNumbers[7] = { 0, 0, 0, 0, 1, 1, 1 };
446 static int TimeNSVMS_Rhs_SUPGN_Matrices = 0;
447 static int *TimeNSVMS_Rhs_SUPGRowSpace = NULL;
448 static int *TimeNSVMS_Rhs_SUPGColumnSpace = NULL;
449 static int TimeNSVMS_Rhs_SUPGN_Rhs = 7;
450 static int TimeNSVMS_Rhs_SUPGRhsSpace[7] = { 0, 0, 0, 0, 0, 0, 1};
451 
452 // compute stabilization parameters
453 void SUPG_Param3D(double u1, double u2, double u3, double* coeff, double* params);
454 
455 void TimeNSType14VMS_Rhs_SUPGDD3D(double Mult, double *coeff, double *param,
456  double hK, double **OrigValues,
457  int *N_BaseFuncts, double ***LocMatrices,
458  double **LocRhs);
459 
460 
461 // ======================================================================
462 // Type 4, VMS_SUPG, D(u):D(v)
463 // ======================================================================
464 static int TimeNSType4VMS_SUPGN_Terms = 8;
465 static MultiIndex3D TimeNSType4VMS_SUPGDerivatives[8] = { D100, D010, D001, D000,
466  D100, D010, D001, D000 };
467 static int TimeNSType4VMS_SUPGSpaceNumbers[8] = { 0, 0, 0, 0, 1, 1, 1, 1 };
468 static int TimeNSType4VMS_SUPGN_Matrices = 28;
469 static int TimeNSType4VMS_SUPGRowSpace[28] = { 0, 0, 0, 0, 0, 0,
470  0, 0, 0, 0, 0, 0,
471  0, 0, 0, 0, 0, 0,
472  0, 0, 0, 0,
473  1, 1, 1, 0, 0, 0};
474 
475 static int TimeNSType4VMS_SUPGColumnSpace[28] = {0, 0, 0, 0, 0, 0,
476  0, 0, 0, 0, 0, 0,
477  0, 0, 0, 0, 0, 0,
478  0, 0, 0, 0,
479  0, 0, 0, 1, 1, 1};
480 
481 static int TimeNSType4VMS_SUPGN_Rhs = 4;
482 static int TimeNSType4VMS_SUPGRhsSpace[4] = { 0, 0, 0, 1};
483 
484 void TimeNSType4VMS_SUPGDD3D(double Mult, double *coeff,
485  double *param, double hK,
486  double **OrigValues, int *N_BaseFuncts,
487  double ***LocMatrices, double **LocRhs);
488 
489 static int TimeNSType4NLVMS_SUPGN_Terms = 8;
490 static MultiIndex3D TimeNSType4NLVMS_SUPGDerivatives[8] = { D100, D010, D001, D000,
491  D100, D010, D001, D000 };
492 static int TimeNSType4NLVMS_SUPGSpaceNumbers[8] = { 0, 0, 0, 0, 1, 1, 1, 1 };
493 static int TimeNSType4NLVMS_SUPGN_Matrices = 22;
494 static int TimeNSType4NLVMS_SUPGRowSpace[22] = { 0, 0, 0, 0, 0, 0,
495  0, 0, 0, 0, 0, 0,
496  0, 0, 0, 0, 0, 0,
497  0, 0, 0, 0};
498 
499 static int TimeNSType4NLVMS_SUPGColumnSpace[22] = {0, 0, 0, 0, 0, 0,
500  0, 0, 0, 0, 0, 0,
501  0, 0, 0, 0, 0, 0,
502  0, 0, 0, 0};
503 
504 static int TimeNSType4NLVMS_SUPGN_Rhs = 0;
505 static int *TimeNSType4NLVMS_SUPGRhsSpace = NULL;
506 
507 void TimeNSType4NLVMS_SUPGDD3D(double Mult, double *coeff,
508  double *param, double hK,
509  double **OrigValues, int *N_BaseFuncts,
510  double ***LocMatrices, double **LocRhs);
511 
512 // ======================================================================
513 // declaration for SUPG
514 // ONLY right hand sides
515 // ======================================================================
516 
517 void TimeNSType4VMS_Rhs_SUPGDD3D(double Mult, double *coeff,
518  double *param, double hK,
519  double **OrigValues, int *N_BaseFuncts,
520  double ***LocMatrices, double **LocRhs);
521 
522 
523 // ======================================================================
524 // Type 14, VMS_SUPG, D(u):D(v)
525 // ======================================================================
526 static int TimeNSType14VMS_SUPGN_Terms =8;
527 static MultiIndex3D TimeNSType14VMS_SUPGDerivatives[8] = { D100, D010, D001, D000,
528  D100, D010, D001, D000};
529 static int TimeNSType14VMS_SUPGSpaceNumbers[11] = { 0, 0, 0, 0, 1, 1, 1, 1};
530 static int TimeNSType14VMS_SUPGN_Matrices = 37;
531 static int TimeNSType14VMS_SUPGRowSpace[37] = { 0, 0, 0, 0, 0, 0,
532  0, 0, 0, 0, 0, 0,
533  0, 0, 0, 0, 0, 0,
534  0, 0, 0, 0, 0, 0,
535  0, 0, 0, 0, 0, 0,
536  1, 1, 1, 1, 0, 0, 0};
537 
538 static int TimeNSType14VMS_SUPGColumnSpace[37] = {0, 0, 0, 0, 0, 0,
539  0, 0, 0, 0, 0, 0,
540  0, 0, 0, 0, 0, 0,
541  0, 0, 0, 0, 0, 0,
542  0, 0, 0, 0, 0, 0,
543  1, 0, 0, 0, 1, 1, 1};
544 
545 static int TimeNSType14VMS_SUPGN_Rhs = 7;
546 static int TimeNSType14VMS_SUPGRhsSpace[7] = { 0, 0, 0, 0, 0, 0, 1};
547 
548 void TimeNSType14VMS_SUPGDD3D(double Mult, double *coeff,
549  double *param, double hK,
550  double **OrigValues, int *N_BaseFuncts,
551  double ***LocMatrices, double **LocRhs);
552 
553 static int TimeNSType14NLVMS_SUPGN_Terms = 8;
554 static MultiIndex3D TimeNSType14NLVMS_SUPGDerivatives[8] = { D100, D010, D001, D000,
555  D100, D010, D001, D000};
556 static int TimeNSType14NLVMS_SUPGSpaceNumbers[8] = { 0, 0, 0, 0, 1, 1, 1, 1};
557 static int TimeNSType14NLVMS_SUPGN_Matrices = 34;
558 static int TimeNSType14NLVMS_SUPGRowSpace[34] = { 0, 0, 0, 0, 0, 0,
559  0, 0, 0, 0, 0, 0,
560  0, 0, 0, 0, 0, 0,
561  0, 0, 0, 0, 0, 0,
562  0, 0, 0, 1, 1, 1,
563  1, 0, 0, 0};
564 
565 static int TimeNSType14NLVMS_SUPGColumnSpace[34] = {0, 0, 0, 0, 0, 0,
566  0, 0, 0, 0, 0, 0,
567  0, 0, 0, 0, 0, 0,
568  0, 0, 0, 0, 0, 0,
569  0, 0, 0, 1, 0, 0,
570  0, 1, 1, 1};
571 
572 static int TimeNSType14NLVMS_SUPGN_Rhs = 3;
573 static int TimeNSType14NLVMS_SUPGRhsSpace[3] = {0, 0, 0};
574 
575 void TimeNSType14NLVMS_SUPGDD3D(double Mult, double *coeff,
576  double *param, double hK,
577  double **OrigValues, int *N_BaseFuncts,
578  double ***LocMatrices, double **LocRhs);
579 
580 // ======================================================================
581 // Type 4, Leray-alpha D(u):D(v)
582 // ======================================================================
583 void TimeNSType4LerayAlphaDD3D(double Mult, double *coeff,
584  double *param, double hK,
585  double **OrigValues, int *N_BaseFuncts,
586  double ***LocMatrices, double **LocRhs);
587 
588 // ======================================================================
589 // Assembling routine for all nonlinear matrices
590 // ======================================================================
591 
592 // ======================================================================
593 // declaration for all Navier-Stokes problems of type 1
594 // one nonlinear A block
595 // WITHOUT right hand sides
596 // ======================================================================
597 
598 static int TimeNSType1_2NLN_Terms = 4;
599 static MultiIndex3D TimeNSType1_2NLDerivatives[4] = { D100, D010, D001, D000 };
600 static int TimeNSType1_2NLSpaceNumbers[4] = { 0, 0, 0, 0 };
601 static int TimeNSType1_2NLN_Matrices = 1;
602 static int TimeNSType1_2NLRowSpace[1] = { 0 };
603 static int TimeNSType1_2NLColumnSpace[1] = { 0 };
604 static int TimeNSType1_2NLN_Rhs = 0;
605 static int *TimeNSType1_2NLRhsSpace = NULL;
606 
607 // ======================================================================
608 // Type 1, Standard Galerkin, only nonlinear part
609 // Type 2, Standard Galerkin, only nonlinear part
610 // Type 1, ClassicalLES, only nonlinear part
611 // Type 2, ClassicalLES, only nonlinear part
612 // Type 1, GL00Convolution, only nonlinear part
613 // Type 2, GL00Convolution, only nonlinear part
614 // ======================================================================
615 void TimeNSType1_2NLGalerkin3D(double Mult, double *coeff,
616  double *param, double hK,
617  double **OrigValues, int *N_BaseFuncts,
618  double ***LocMatrices, double **LocRhs);
619 
620 // ======================================================================
621 // Type 1, for upwind (only laplacian in A block)
622 // Type 2, for upwind (only laplacian in A block)
623 // ======================================================================
624 void TimeNSType1_2NLUpwind3D(double Mult, double *coeff,
625  double *param, double hK,
626  double **OrigValues, int *N_BaseFuncts,
627  double ***LocMatrices, double **LocRhs);
628 
629 // ======================================================================
630 // Type 1, Smagorinsky, only nonlinear part
631 // Type 2, Smagorinsky, only nonlinear part
632 // ======================================================================
633 void TimeNSType1_2NLSmagorinsky3D(double Mult, double *coeff,
634  double *param, double hK,
635  double **OrigValues, int *N_BaseFuncts,
636  double ***LocMatrices, double **LocRhs);
637 
638 // ======================================================================
639 // declaration for all Navier-Stokes problems of type 3
640 // main diagonal blocks A11, A22
641 // WITHOUT right hand sides
642 // ======================================================================
643 
644 static int TimeNSType3_4NLN_Terms = 4;
645 static MultiIndex3D TimeNSType3_4NLDerivatives[4] = { D100, D010, D001, D000 };
646 static int TimeNSType3_4NLSpaceNumbers[4] = { 0, 0, 0, 0 };
647 static int TimeNSType3_4NLN_Matrices = 3;
648 static int TimeNSType3_4NLRowSpace[3] = { 0, 0, 0 };
649 static int TimeNSType3_4NLColumnSpace[3] = { 0, 0, 0 };
650 static int TimeNSType3_4NLN_Rhs = 0;
651 static int *TimeNSType3_4NLRhsSpace = NULL;
652 
653 // ======================================================================
654 // Type 3, Standard Galerkin, (grad u, grad v), only nonlinear part
655 // Type 4, Standard Galerkin, (grad u, grad v), only nonlinear part
656 // Type 3, ClassicalLES, (grad u, grad v), only nonlinear part
657 // Type 4, ClassicalLES, (grad u, grad v), only nonlinear part
658 // Type 3, GL00Convolution, (grad u, grad v), only nonlinear part
659 // Type 4, GL00Convolution, (grad u, grad v), only nonlinear part
660 // ======================================================================
661 void TimeNSType3_4NLGalerkin3D(double Mult, double *coeff,
662  double *param, double hK,
663  double **OrigValues, int *N_BaseFuncts,
664  double ***LocMatrices, double **LocRhs);
665 
666 // ======================================================================
667 // Type 3, Standard Galerkin, D(u):D(v), only nonlinear diagonal blocks
668 // Type 4, Standard Galerkin, D(u):D(v), only nonlinear diagonal blocks
669 // Type 3, ClassicalLES, D(u):D(v), only nonlinear diagonal blocks
670 // Type 4, ClassicalLES, D(u):D(v), only nonlinear diagonal blocks
671 // Type 3, GL00Convolution, D(u):D(v), only nonlinear diagonal blocks
672 // Type 4, GL00Convolution, D(u):D(v), only nonlinear diagonal blocks
673 // ======================================================================
674 void TimeNSType3_4NLGalerkinDD3D(double Mult, double *coeff,
675  double *param, double hK,
676  double **OrigValues, int *N_BaseFuncts,
677  double ***LocMatrices, double **LocRhs);
678 
679 // ======================================================================
680 // Type 3, Upwind (no convection term), (grad u, grad v)
681 // Type 4, Upwind (no convection term), (grad u, grad v)
682 // ======================================================================
683 void TimeNSType3_4NLUpwind3D(double Mult, double *coeff,
684  double *param, double hK,
685  double **OrigValues, int *N_BaseFuncts,
686  double ***LocMatrices, double **LocRhs);
687 
688 // ======================================================================
689 // Type 3, Upwind (no convection term), D(u):D(v)
690 // Type 4, Upwind (no convection term), D(u):D(v)
691 // ======================================================================
692 void TimeNSType3_4NLUpwindDD3D(double Mult, double *coeff,
693  double *param, double hK,
694  double **OrigValues, int *N_BaseFuncts,
695  double ***LocMatrices, double **LocRhs);
696 
697 // ======================================================================
698 // Type 3, Standard Smagorinsky, (grad u, grad v), only nonlinear part
699 // Type 4, Standard Smagorinsky, (grad u, grad v), only nonlinear part
700 // ======================================================================
701 static int TimeNSType3_4NLSmagorinskyN_Matrices = 9;
702 static int TimeNSType3_4NLSmagorinskyRowSpace[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
703 static int TimeNSType3_4NLSmagorinskyColumnSpace[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
704 
705 
706 void TimeNSType3_4NLSmagorinsky3D(double Mult, double *coeff,
707  double *param, double hK,
708  double **OrigValues, int *N_BaseFuncts,
709  double ***LocMatrices, double **LocRhs);
710 
711 // ======================================================================
712 // Type 3, Standard Smagorinsky, D(u):D(v), only nonlinear diagonal blocks
713 // Type 4, Standard Smagorinsky, D(u):D(v), only nonlinear diagonal blocks
714 // ======================================================================
715 void TimeNSType3_4NLSmagorinskyDD3D(double Mult, double *coeff,
716  double *param, double hK,
717  double **OrigValues, int *N_BaseFuncts,
718  double ***LocMatrices, double **LocRhs);
719 
720 
721 // ======================================================================
722 // Type 3, Standard Galerkin, (grad u, grad v), only nonlinear part
723 // Type 4, Standard Galerkin, (grad u, grad v), only nonlinear part
724 // ======================================================================
725 void TimeNSType3_4NLGalerkin3D(double Mult, double *coeff,
726  double *param, double hK,
727  double **OrigValues, int *N_BaseFuncts,
728  double ***LocMatrices, double **LocRhs);
729 
730 // ======================================================================
731 // Type 3, VMS_Projection, D(u):D(v), only nonlinear diagonal blocks
732 // Type 4, VMS_Projection, D(u):D(v), only nonlinear diagonal blocks
733 // ======================================================================
734 static int TimeNSType3_4NLVMS_ProjectionN_Terms = 5;
735 static MultiIndex3D TimeNSType3_4NLVMS_ProjectionDerivatives[5] = { D100, D010, D001, D000, D000 };
736 static int TimeNSType3_4NLVMS_ProjectionSpaceNumbers[5] = { 0, 0, 0, 0, 2 };
737 static int TimeNSType3_4NLVMS_ProjectionN_Matrices = 12;
738 static int TimeNSType3_4NLVMS_ProjectionRowSpace[12] = { 0, 0, 0, 0, 0, 0,
739  0, 0, 0, 0, 0, 0};
740 static int TimeNSType3_4NLVMS_ProjectionColumnSpace[12] = { 0, 0, 0, 0, 0, 0,
741  0, 0, 0, 2, 2, 2};
742 
743 void TimeNSType3_4NLVMS_ProjectionDD3D(double Mult, double *coeff,
744  double *param, double hK,
745  double **OrigValues, int *N_BaseFuncts,
746  double ***LocMatrices, double **LocRhs);
747 
748 // ======================================================================
749 // Type 3, VMS_Projection, D(u):D(v), adaptive coarse space
750 // Type 4, VMS_Projection, D(u):D(v), adaptive coarse space
751 // ======================================================================
752 static int TimeNSType3_4NL_Adap_VMS_ProjectionN_Terms = 5;
753 static MultiIndex3D TimeNSType3_4NL_Adap_VMS_ProjectionDerivatives[5] = { D100, D010, D001, D000, D000 };
754 static int TimeNSType3_4NL_Adap_VMS_ProjectionSpaceNumbers[5] = { 0, 0, 0, 0, 2 };
755 static int TimeNSType3_4NL_Adap_VMS_ProjectionN_Matrices = 16;
756 static int TimeNSType3_4NL_Adap_VMS_ProjectionRowSpace[16] = { 0, 0, 0, 0, 0, 0,
757  0, 0, 0, 2, 0, 0, 0, 2, 2, 2};
758 static int TimeNSType3_4NL_Adap_VMS_ProjectionColumnSpace[16] = { 0, 0, 0, 0, 0, 0,
759  0, 0, 0, 2, 2, 2, 2, 0, 0, 0};
760 
761 void TimeNSType3_4NL_Adap_VMS_ProjectionDD3D(double Mult, double *coeff,
762  double *param, double hK,
763  double **OrigValues, int *N_BaseFuncts,
764  double ***LocMatrices, double **LocRhs);
765 
766 // ======================================================================
767 // Type 3, VMS_Projection, D(u):D(v), only nonlinear diagonal blocks
768 // Type 4, VMS_Projection, D(u):D(v), only nonlinear diagonal blocks
769 // streamline projection
770 // ======================================================================
771 void TimeNSType3_4NLVMS_ProjectionStreamlineDD3D(double Mult, double *coeff,
772  double *param, double hK,
773  double **OrigValues, int *N_BaseFuncts,
774  double ***LocMatrices, double **LocRhs);
775 
776 // ======================================================================
777 // Type 3, VMS_Projection explicit, only Matrix_tilde_G??
778 // Type 4, VMS_Projection explicit, only Matrix_tilde_G??
779 // ======================================================================
780 
781 static int TimeNSType3_4NLVMS_ProjectionExplN_Terms = 4;
782 static MultiIndex3D TimeNSType3_4NLVMS_ProjectionExplDerivatives[4] = { D100, D010, D001, D000};
783 static int TimeNSType3_4NLVMS_ProjectionExplSpaceNumbers[4] = { 0, 0, 0, 1 };
784 static int TimeNSType3_4NLVMS_ProjectionExplN_Matrices = 3;
785 static int TimeNSType3_4NLVMS_ProjectionExplRowSpace[3] = {0, 0, 0 };
786 static int TimeNSType3_4NLVMS_ProjectionExplColumnSpace[3] = {1, 1, 1 };
787 
788 void TimeNSType3_4VMS_ProjectionExpl3D(double Mult, double *coeff,
789  double *param, double hK,
790  double **OrigValues, int *N_BaseFuncts,
791  double ***LocMatrices, double **LocRhs);
792 
793 // ======================================================================
794 // Type 3, div-div stabilization
795 // Type 4, div-div stabilization
796 // ======================================================================
797 void TimeNSType3_4NLDivDivDD3D(double Mult, double *coeff,
798  double *param, double hK,
799  double **OrigValues, int *N_BaseFuncts,
800  double ***LocMatrices, double **LocRhs);
801 
802 // ======================================================================
803 // Assembling routine for right-hand sides only
804 // ======================================================================
805 
806 // ======================================================================
807 // declaration for all Navier-Stokes problems
808 // ONLY right hand sides
809 // ======================================================================
810 
811 static int TimeNSRHSN_Terms = 1;
812 static MultiIndex3D TimeNSRHSDerivatives[1] = { D000 };
813 static int TimeNSRHSSpaceNumbers[1] = { 0 };
814 static int TimeNSRHSN_Matrices = 0;
815 static int *TimeNSRHSRowSpace = NULL;
816 static int *TimeNSRHSColumnSpace = NULL;
817 static int TimeNSRHSN_Rhs = 3;
818 static int TimeNSRHSRhsSpace[3] = { 0, 0, 0 };
819 
820 // ======================================================================
821 // right-hand side ONLY
822 // ======================================================================
823 void TimeNSRHS3D(double Mult, double *coeff,
824  double *param, double hK,
825  double **OrigValues, int *N_BaseFuncts,
826  double ***LocMatrices, double **LocRhs);
827 
828 static int TimeNSRHSLESN_Terms = 4;
829 static MultiIndex3D TimeNSRHSLESDerivatives[4] = { D100, D010, D001, D000 };
830 static int TimeNSRHSLESSpaceNumbers[4] = { 0, 0, 0, 0 };
831 static int TimeNSRHSLESN_Matrices = 0;
832 static int *TimeNSRHSLESRowSpace = NULL;
833 static int *TimeNSRHSLESColumnSpace = NULL;
834 static int TimeNSRHSLESN_Rhs = 3;
835 static int TimeNSRHSLESRhsSpace[3] = { 0, 0, 0 };
836 
837 // ======================================================================
838 // right-hand side ONLY, ClassicalLES model
839 // ======================================================================
840 void TimeNSRHSClassicalLES3D(double Mult, double *coeff,
841  double *param, double hK,
842  double **OrigValues, int *N_BaseFuncts,
843  double ***LocMatrices, double **LocRhs);
844 
845 // ======================================================================
846 // right-hand side ONLY, Galdi-Layton model with convolution
847 // right-hand side ONLY, Galdi-Layton model with auxiliary problem
848 // ======================================================================
849 
850 void TimeNSRHSLESModel3D(double Mult, double *coeff,
851  double *param, double hK,
852  double **OrigValues, int *N_BaseFuncts,
853  double ***LocMatrices, double **LocRhs);
854 
855 // ======================================================================
856 // right-hand side for auxiliary problem
857 // ONLY, Galdi-Layton model with auxiliary problem
858 // ======================================================================
859 
860 static int TimeNSGL00AuxProblemRHSN_Terms = 1;
861 static MultiIndex3D TimeNSGL00AuxProblemRHSDerivatives[1] = { D000 };
862 static int TimeNSGL00AuxProblemRHSSpaceNumbers[1] = { 0 };
863 static int TimeNSGL00AuxProblemRHSN_Matrices = 0;
864 static int *TimeNSGL00AuxProblemRHSRowSpace = NULL;
865 static int *TimeNSGL00AuxProblemRHSColumnSpace = NULL;
866 static int TimeNSGL00AuxProblemRHSN_Rhs = 6;
867 static int TimeNSGL00AuxProblemRHSRhsSpace[6] = { 0, 0, 0, 0, 0, 0 };
868 
869 void TimeNSGL00AuxProblemRHS3D(double Mult, double *coeff,
870  double *param, double hK,
871  double **OrigValues, int *N_BaseFuncts,
872  double ***LocMatrices, double **LocRhs);
873 
874 
875 // ======================================================================
876 // right-hand side ONLY for auxiliary problem applied to velocity
877 // ======================================================================
878 void TimeNSRHSAuxProblemU(double Mult, double *coeff,
879  double *param, double hK,
880  double **OrigValues, int *N_BaseFuncts,
881  double ***LocMatrices, double **LocRhs);
882 
883 // ======================================================================
884 // declaration for computation of rhs for RFB explicit
885 // only rhs
886 // ======================================================================
887 
888 static int TimeNSRFBExplRhsN_Terms = 1;
889 static MultiIndex3D TimeNSRFBExplRhsDerivatives[1] = { D000 };
890 static int TimeNSRFBExplRhsSpaceNumbers[1] = { 0 };
891 static int TimeNSRFBExplRhsN_Matrices = 0;
892 static int *TimeNSRFBExplRhsRowSpace = NULL;
893 static int *TimeNSRFBExplRhsColumnSpace = NULL;
894 static int TimeNSRFBExplRhsN_Rhs = 3;
895 static int TimeNSRFBExplRhsRhsSpace[3] = { 0, 0, 0 };
896 
897 // ======================================================================
898 // Assembling routine for matrices for auxiliary problems
899 // ======================================================================
900 
901 // ======================================================================
902 // declarations
903 // ======================================================================
904 
905 //int TimeNSGL00AuxProblemN_Terms = 3;
906 //MultiIndex3D TimeNSGL00AuxProblemDerivatives[3] = { D10, D01, D00 };
907 //int TimeNSGL00AuxProblemSpaceNumbers[3] = { 0, 0, 0 };
908 //int TimeNSGL00AuxProblemN_Matrices = 1;
909 //int TimeNSGL00AuxProblemRowSpace[2] = { 0 };
910 //int TimeNSGL00AuxProblemColumnSpace[2] = { 0 };
911 //int TimeNSGL00AuxProblemN_Rhs = 0;
912 //int *TimeNSGL00AuxProblemRhsSpace = NULL;
913 
914 //void TimeNSAuxMatrixGL00AuxProblem3D(double Mult, double *coeff,
915 // double *param, double hK,
916 // double **OrigValues, int *N_BaseFuncts,
917 // double ***LocMatrices, double **LocRhs);
918 
919 
920 static int MatrixAuxiliaryProblemN_Terms = 4;
921 static MultiIndex3D MatrixAuxiliaryProblemDerivatives[4] = { D100, D010, D001, D000};
922 static int MatrixAuxiliaryProblemSpaceNumbers[4] = { 0, 0, 0, 0};
923 static int MatrixAuxiliaryProblemN_Matrices = 1;
924 static int MatrixAuxiliaryProblemRowSpace[1] = { 0 };
925 static int MatrixAuxiliaryProblemColumnSpace[1] = { 0 };
926 static int MatrixAuxiliaryProblemN_Rhs = 0;
927 static int *MatrixAuxiliaryProblemRhsSpace = NULL;
928 
929 void MatrixAuxiliaryProblem(double Mult, double *coeff,
930  double *param, double hK,
931  double **OrigValues, int *N_BaseFuncts,
932  double ***LocMatrices, double **LocRhs);
933 
934 
935 // ======================================================================
936 // right-hand side for additional terms in rhs of small scale systems
937 // for VMS
938 // ======================================================================
939 void TimeNS_VMS_SmallRhs3D(double Mult, double *coeff,
940  double *param, double hK,
941  double **OrigValues, int *N_BaseFuncts,
942  double ***LocMatrices, double **LocRhs);
943 
944 // ======================================================================
945 // declaration for VMS
946 // ONLY right hand sides
947 // ======================================================================
948 
949 static int TimeNS_ho_RHSN_Terms = 4;
950 static MultiIndex3D TimeNS_ho_RHSDerivatives[4] = { D100, D010, D001, D000};
951 static int TimeNS_ho_RHSSpaceNumbers[1] = { 0 };
952 static int TimeNS_ho_RHSN_Matrices = 0;
953 static int *TimeNS_ho_RHSRowSpace = NULL;
954 static int *TimeNS_ho_RHSColumnSpace = NULL;
955 static int TimeNS_ho_RHSN_Rhs = 3;
956 static int TimeNS_ho_RHSRhsSpace[3] = { 0, 0, 0 };
957 
958 void TimeNSType1GalerkinJ3D(double Mult, double *coeff,
959  double *param, double hK,
960  double **OrigValues, int *N_BaseFuncts,
961  double ***LocMatrices, double **LocRhs);
962 
963 void TimeNSGalerkinC3D(double Mult, double *coeff,
964  double *param, double hK,
965  double **OrigValues, int *N_BaseFuncts,
966  double ***LocMatrices, double **LocRhs);
967 
968 
969 void TimeNSType3GalerkinJ3D(double Mult, double *coeff,
970  double *param, double hK,
971  double **OrigValues, int *N_BaseFuncts,
972  double ***LocMatrices, double **LocRhs);
973 
974 
975 
976 
977 #endif
978 
979 
980