-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDerived.H
674 lines (604 loc) · 26.7 KB
/
Derived.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
#include <AMReX_REAL.H>
#include <AMReX_ArrayLim.H>
#ifdef BL_LANG_FORT
# define FORT_DERLGDN fdlgdn3d
# define FORT_DERDEN fdden3d
# define FORT_DERTRAC fdtrac3d
# define FORT_DERTMASK fdtmask3d
# define FORT_DERSTATE fdstate3d
# define FORT_DERXVEL fdxvel3d
# define FORT_DERYVEL fdyvel3d
# define FORT_DERZVEL fdzvel3d
# define FORT_DERTENG fdeng3d
# define FORT_DERIENG fdieng3d
# define FORT_DERKENG fdkeng3d
# define FORT_DERVORT fdvort3d
# define FORT_DERVORTCOMPS fdvortcomps3d
# define FORT_DERCON fdcon3d
# define FORT_INTEGRATE fdintegrate
# define FORT_JPDF fdjpdf
# define FORT_LIMITS fdlimits
# define FORT_SETGAMMA fdsetgam
# define FORT_SETALPHA fdsetalpha
# define FORT_SETQPOS fdsetqpos
# define FORT_SUMMASS fdsummass
# define FORT_SUMCONC fdsumconc
# define FORT_SUMVORT fdsumvort
# define FORT_DERDILI fddili3d
# define FORT_BINTRAC bintrac
# define FORT_DERMACH fdmach3d
# define FORT_RANDMOVE randmove
# define FORT_CHEMMOVE chemmove
# define FORT_MAXLAMBDA maxlambda
# define FORT_MAXDTLAMBDA maxdtlambda
# define FORT_MAXDTDIFF maxdtdiff
# define FORT_SELECTPOS selectpos
# define FORT_PROBFAB probfab
# define FORT_ACCUMPROB accumprob
# define FORT_TEMPQMODEL tempqmodel
# define FORT_FUELFRAC fuelfrac
# define FORT_OXFRAC oxfrac
# define FORT_PRODFRAC prodfrac
#else
# if defined(BL_FORT_USE_UPPERCASE)
# define FORT_DERLGDN FDLGDN3D
# define FORT_DERDEN FDDEN3D
# define FORT_DERTRAC FDTRAC3D
# define FORT_DERTMASK FDTMASK3D
# define FORT_DERSTATE FDSTATE3D
# define FORT_DERXVEL FDXVEL3D
# define FORT_DERYVEL FDYVEL3D
# define FORT_DERZVEL FDZVEL3D
# define FORT_DERTENG FDENG3D
# define FORT_DERIENG FDIENG3D
# define FORT_DERKENG FDKENG3D
# define FORT_DERVORT FDVORT3D
# define FORT_DERVORTCOMPS FDVORTCOMPS3D
# define FORT_DERCON FDCON3D
# define FORT_INTEGRATE FDINTEGRATE
# define FORT_JPDF FDJPDF
# define FORT_LIMITS FDLIMITS
# define FORT_SETGAMMA FDSETGAM
# define FORT_SETALPHA FDSETALPHA
# define FORT_SETQPOS FDSETQPOS
# define FORT_SUMMASS FDSUMMASS
# define FORT_SUMCONC FDSUMCONC
# define FORT_SUMVORT FDSUMVORT
# define FORT_DERDILI FDDILI3D
# define FORT_BINTRAC BINTRAC
# define FORT_DERMACH FDMACH3D
# define FORT_RANDMOVE RANDMOVE
# define FORT_CHEMMOVE CHEMMOVE
# define FORT_MAXLAMBDA MAXLAMBDA
# define FORT_MAXDTLAMBDA MAXDTLAMBDA
# define FORT_MAXDTDIFF MAXDTDIFF
# define FORT_SELECTPOS SELECTPOS
# define FORT_BUILDPROB BUILDPROB
# define FORT_PROBFAB PROBFAB
# define FORT_ACCUMPROB ACCUMPROB
# define FORT_TEMPQMODEL TEMPQMODEL
# define FORT_FUELFRAC FUELFRAC
# define FORT_OXFRAC OXFRAC
# define FORT_PRODFRAC PRODFRAC
# elif defined(BL_FORT_USE_LOWERCASE)
# define FORT_DERLGDN fdlgdn3d
# define FORT_DERDEN fdden3d
# define FORT_DERTRAC fdtrac3d
# define FORT_DERTMASK fdtmask3d
# define FORT_DERSTATE fdstate3d
# define FORT_DERXVEL fdxvel3d
# define FORT_DERYVEL fdyvel3d
# define FORT_DERZVEL fdzvel3d
# define FORT_DERTENG fdeng3d
# define FORT_DERIENG fdieng3d
# define FORT_DERKENG fdkeng3d
# define FORT_DERVORT fdvort3d
# define FORT_DERVORTCOMPS fdvortcomps3d
# define FORT_DERCON fdcon3d
# define FORT_INTEGRATE fdintegrate
# define FORT_JPDF fdjpdf
# define FORT_LIMITS fdlimits
# define FORT_SETGAMMA fdsetgam
# define FORT_SETALPHA fdsetalpha
# define FORT_SETQPOS fdsetqpos
# define FORT_SUMMASS fdsummass
# define FORT_SUMCONC fdsumconc
# define FORT_SUMVORT fdsumvort
# define FORT_DERDILI fddili3d
# define FORT_BINTRAC bintrac
# define FORT_DERMACH fdmach3d
# define FORT_DERMACH fdmach3d
# define FORT_RANDMOVE randmove
# define FORT_CHEMMOVE chemmove
# define FORT_MAXLAMBDA maxlambda
# define FORT_MAXDTLAMBDA maxdtlambda
# define FORT_MAXDTDIFF maxdtdiff
# define FORT_SELECTPOS selectpos
# define FORT_PROBFAB probfab
# define FORT_ACCUMPROB accumprob
# define FORT_TEMPQMODEL tempqmodel
# define FORT_FUELFRAC fuelfrac
# define FORT_OXFRAC oxfrac
# define FORT_PRODFRAC prodfrac
# elif defined(BL_FORT_USE_UNDERSCORE)
# define FORT_DERLGDN fdlgdn3d_
# define FORT_DERDEN fdden3d_
# define FORT_DERTRAC fdtrac3d_
# define FORT_DERTMASK fdtmask3d_
# define FORT_DERSTATE fdstate3d_
# define FORT_DERXVEL fdxvel3d_
# define FORT_DERYVEL fdyvel3d_
# define FORT_DERZVEL fdzvel3d_
# define FORT_DERTENG fdeng3d_
# define FORT_DERIENG fdieng3d_
# define FORT_DERKENG fdkeng3d_
# define FORT_DERVORT fdvort3d_
# define FORT_DERVORTCOMPS fdvortcomps3d_
# define FORT_DERCON fdcon3d_
# define FORT_INTEGRATE fdintegrate_
# define FORT_JPDF fdjpdf_
# define FORT_LIMITS fdlimits_
# define FORT_SETGAMMA fdsetgam_
# define FORT_SETALPHA fdsetalpha_
# define FORT_SETQPOS fdsetqpos_
# define FORT_SUMMASS fdsummass_
# define FORT_SUMCONC fdsumconc_
# define FORT_SUMVORT fdsumvort_
# define FORT_DERDILI fddili3d_
# define FORT_BINTRAC bintrac_
# define FORT_DERMACH fdmach3d_
# define FORT_DERMACH fdmach3d_
# define FORT_RANDMOVE randmove_
# define FORT_CHEMMOVE chemmove_
# define FORT_MAXLAMBDA maxlambda_
# define FORT_MAXDTLAMBDA maxdtlambda_
# define FORT_MAXDTDIFF maxdtdiff_
# define FORT_SELECTPOS selectpos_
# define FORT_PROBFAB probfab_
# define FORT_ACCUMPROB accumprob_
# define FORT_TEMPQMODEL tempqmodel_
# define FORT_FUELFRAC fuelfrac_
# define FORT_OXFRAC oxfrac_
# define FORT_PRODFRAC prodfrac_
# endif
//
// Use ARLIM in the following.
//
extern "C"
{
void FORT_SETGAMMA( const Real *gam );
void FORT_SETALPHA( const Real *alp );
void FORT_SETQPOS( const int *qpos );
void FORT_DERLGDN(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2, const int &dloi3,
const int &dhii1, const int &dhii2, const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERXVEL(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2, const int &dloi3,
const int &dhii1, const int &dhii2, const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERYVEL(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2, const int &dloi3,
const int &dhii1, const int &dhii2, const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERZVEL(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2, const int &dloi3,
const int &dhii1, const int &dhii2, const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERIENG(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2, const int &dloi3,
const int &dhii1, const int &dhii2, const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERCON(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2,const int &dloi3,
const int &dhii1, const int &dhii2,const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERVORT(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2,const int &dloi3,
const int &dhii1, const int &dhii2,const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERVORTCOMPS(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2,const int &dloi3,
const int &dhii1, const int &dhii2,const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_TEMPQMODEL(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2,const int &dloi3,
const int &dhii1, const int &dhii2,const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_FUELFRAC(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2,const int &dloi3,
const int &dhii1, const int &dhii2,const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_OXFRAC(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2,const int &dloi3,
const int &dhii1, const int &dhii2,const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_PRODFRAC(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2,const int &dloi3,
const int &dhii1, const int &dhii2,const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERKENG(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2,const int &dloi3,
const int &dhii1, const int &dhii2,const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERTENG(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2,const int &dloi3,
const int &dhii1, const int &dhii2,const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERDILI(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2,const int &dloi3,
const int &dhii1, const int &dhii2,const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_INTEGRATE (const Real* field,
ARLIM_P(field_lo), ARLIM_P(field_hi),
ARLIM_P(valid_lo), ARLIM_P(valid_hi),
const Real* delta,
Real* integral);
void FORT_JPDF (const Real* field,
const Real* visible,
ARLIM_P(field_lo), ARLIM_P(field_hi),
ARLIM_P(valid_lo), ARLIM_P(valid_hi),
const int* hBins, const Real* hMax, const Real* hMin,
const int* vBins, const Real* vMax, const Real* vMin,
int* excessCount, int* jointCount);
void FORT_LIMITS (const Real* field,
const Real* visible,
ARLIM_P(field_lo), ARLIM_P(field_hi),
ARLIM_P(valid_lo), ARLIM_P(valid_hi),
Real* maximum,
Real* minimum);
#if (BL_SPACEDIM == 2)
void FORT_SUMMASS (const Real* dat, ARLIM_P(dat_lo), ARLIM_P(dat_hi),
ARLIM_P(grid_lo), ARLIM_P(grid_hi),
const Real* delta, Real* mass,
const Real* radius,
const int* irlo, const int* irhi,
const int* rz_flag, Real* tmp);
#else
void FORT_SUMMASS (const Real* dat, ARLIM_P(dat_lo), ARLIM_P(dat_hi),
ARLIM_P(grid_lo), ARLIM_P(grid_hi),
const Real* delta, Real* mass, Real* tmp);
#endif
void FORT_SUMCONC (const Real* dat, ARLIM_P(dlo), ARLIM_P(dhi),
ARLIM_P(grid_lo), ARLIM_P(grid_hi),
const Real* delta, Real* mass, Real* tmp);
void FORT_SUMVORT (const Real* dat, ARLIM_P(dlo), ARLIM_P(dhi),
ARLIM_P(grid_lo), ARLIM_P(grid_hi),
const Real* delta, Real* mass, Real* tmp);
void FORT_BINTRAC (const Real* trac, ARLIM_P(trac_lo), ARLIM_P(trac_hi),
const Real* rho,
const int* lo, const int* hi,
const Real* delta, Real* sum);
void FORT_DERDEN (const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2, const int &dloi3,
const int &dhii1, const int &dhii2, const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERTRAC(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2, const int &dloi3,
const int &dhii1, const int &dhii2, const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERTMASK(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2, const int &dloi3,
const int &dhii1, const int &dhii2, const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERSTATE(const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2, const int &dloi3,
const int &dhii1, const int &dhii2, const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_DERMACH (const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2, const int &dloi3,
const int &dhii1, const int &dhii2, const int &dhii3,
const int *ovlo, const int *ovhi);
void FORT_RANDMOVE (const Real* A,ARLIM_P(A_lo),ARLIM_P(A_hi),
const Real* B,
const Real* C,
const Real* D,
const Real* U,
const int* nspec,
const Real* x, const Real* y, const int* spec,
const Real* dx, const Real* dy, const Real* dt,
const Real* dxinv, const Real* dyinv);
void FORT_CHEMMOVE (const Real* RF,ARLIM_P(rf_lo),ARLIM_P(rf_hi),
const Real* RR,
const Real* CONC,
const int* nspec,
const int* nreac,
const int* edges, const int* edgeslen,
const int* pedges,
const Real* x, const Real* y, const int* spec,
const Real* dx, const Real* dy, const Real* dt,
const int* rxn,const Real* dxinv, const Real* dyinv);
void FORT_MAXLAMBDA (const Real* RF,ARLIM_P(rf_lo),ARLIM_P(rf_hi),
const Real* RR,
const Real* CONC,
const int* nspec,
const int* nreac,
const int* edges, const int* edgeslen,
const int* pedges);
void FORT_MAXDTLAMBDA (const Real* RF,ARLIM_P(rf_lo),ARLIM_P(rf_hi),
const Real* RR,
const Real* CONC,
const int* nspec,
const int* nreac,
const int* edges, const int* edgeslen,
const int* pedges,
const Real* x, const Real* y, const int* spec,
const Real* dx, const Real* dy, const Real* dt,
const Real* dxinv, const Real* dyinv);
void FORT_MAXDTDIFF (const Real* C,ARLIM_P(C_lo),ARLIM_P(C_hi),
const int* nspec,
const Real* x, const Real* y, const int* spec,
const Real* dx, const Real* dy, const Real* dt,
const Real* dxinv, const Real* dyinv);
void FORT_PROBFAB (const Real* rf, ARLIM_P(rf_lo), ARLIM_P(rf_hi),
const Real* rr,
const Real* prob, ARLIM_P(prob_lo), ARLIM_P(prob_hi),
const int* nspec,
const int* nreac,
const int* ispec,
const int* edges, const int* edgeslen,
const int* pedges,
const int* isrz,
D_DECL(const Real* dx, const Real* dy, const Real* dz));
void FORT_ACCUMPROB (const Real* prob, ARLIM_P(prob_lo), ARLIM_P(prob_hi),
const Real* totreact, Real* cumprob);
void FORT_SELECTPOS (const Real* prob,ARLIM_P(prob_lo),ARLIM_P(prob_hi),
const Real* rn,
D_DECL(const Real* dx, const Real* dy, const Real* dz),
D_DECL(const Real* x, const Real* y, const Real* z));
//
// Typedef needed for defining a pointer to the FORTRAN functions
// used in deriving other thermodynamic quantities from DATABOX
// state variables.
//
typedef void (*DERIVE_FUNC) (const Real *u,
const int &uloi1, const int &uloi2, const int &uloi3,
const int &uhii1, const int &uhii2, const int &uhii3,
const int &nvar,
const Real *xlo, const Real *xhi,
Real *dat,
const int &dloi1, const int &dloi2, const int &dloi3,
const int &dhii1, const int &dhii2, const int &dhii3,
const int *ovlo, const int *ovhi);
}
//
// Number of variables in the state including derived quantities.
//
#ifdef BL_DERIVE_IAMR
#define NSTATECOMPS 5
#else
#ifdef BL_DERIVE_HCHEM
#define NSTATECOMPS 14
#else
#define NSTATECOMPS 6
#endif
#endif
struct DeriveRecord
{
std::string name; // Name of quantity to derive from state data.
DERIVE_FUNC func; // Pointer to function that computes this quantity.
int derMap[NSTATECOMPS]; // Map of required variables for the
// derived functions
// 1 == needed, 0 == not needed
};
//
// The state quantities.
//
#if BL_SPACEDIM==3
#ifdef BL_DERIVE_IAMR
// nstates = spacedim + 2
// x_velocity
// y_velocity
// z_velocity
// density
// tracer
extern const struct DeriveRecord DerivedQuants[] =
{
// { "logden", FORT_DERLGDN, { 0, 0, 0, 1, 0 } },
// { "x_velocity", FORT_DERXVEL, { 1, 0, 0, 0, 0 } },
// { "y_velocity", FORT_DERYVEL, { 0, 1, 0, 0, 0 } },
// { "z_velocity", FORT_DERZVEL, { 0, 0, 1, 0, 0 } },
{ "density", FORT_DERDEN, { 0, 0, 0, 1, 0 } },
{ "tracer", FORT_DERTRAC, { 0, 0, 0, 0, 1 } }
};
/*
// these are for iamr: from the plotfile header:
// NavierStokes-V1.1
// 5
// x_velocity
// y_velocity
// z_velocity
// density
// tracer
extern const struct DeriveRecord DerivedQuants[] =
{
{ "logden", FORT_DERLGDN, { 0, 0, 0, 1, 0 } },
{ "x_velocity", FORT_DERXVEL, { 1, 0, 0, 0, 0 } },
{ "y_velocity", FORT_DERYVEL, { 0, 1, 0, 0, 0 } },
{ "z_velocity", FORT_DERZVEL, { 0, 0, 1, 0, 0 } },
//{ "teng", FORT_DERTENG, { 1, 0, 0, 0, 1 } },
//{ "eint", FORT_DERIENG, { 1, 1, 1, 1, 1 } },
//{ "kint", FORT_DERKENG, { 1, 1, 1, 1, 0 } },
//{ "vorticity", FORT_DERVORT, { 1, 1, 1, 1, 0 } },
//{ "concentration", FORT_DERCON, { 1, 0, 0, 0, 0 } },
//{ "dilitation", FORT_DERDILI, { 1, 1, 1, 1, 0 } },
{ "density", FORT_DERDEN, { 0, 0, 0, 1, 0 } },
{ "tracer", FORT_DERTRAC, { 0, 0, 0, 0, 1 } }
};
*/
#else
#ifdef BL_DERIVE_HCHEM
// density
// xmom
// ymom
// zmom
// eden
// tracer
// rho.Y(O2)
// rho.Y(H2O)
// rho.Y(CO2)
// rho.Y(C2H2)
// rho.Y(CO)
// rho.Y(N2)
// pressure
extern const struct DeriveRecord DerivedQuants[] =
{
{ "logden", FORT_DERLGDN, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ "x_velocity", FORT_DERXVEL, { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ "y_velocity", FORT_DERYVEL, { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ "z_velocity", FORT_DERZVEL, { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
//{ "teng", FORT_DERTENG, { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 } },
//{ "eint", FORT_DERIENG, { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 } },
//{ "kint", FORT_DERKENG, { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
//{ "vorticity", FORT_DERVORT, { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
//{ "concentration", FORT_DERCON, { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 } },
//{ "dilitation", FORT_DERDILI, { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ "density", FORT_DERDEN, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
//{ "mach", FORT_DERMACH, { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ "state", FORT_DERSTATE, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
{ "tmask", FORT_DERTMASK, { 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0 } },
{ "tempqmodel", FORT_TEMPQMODEL, { 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0 } },
{ "fuelfrac", FORT_FUELFRAC, { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 } },
{ "oxfrac", FORT_OXFRAC, { 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 } },
{ "prodfrac", FORT_PRODFRAC, { 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 } },
{ "tracer", FORT_DERTRAC, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 } }
};
#else
/*
extern const struct DeriveRecord DerivedQuants[] =
{
{ "logden", FORT_DERLGDN, { 1, 0, 0, 0, 0, 0 } },
{ "x_velocity", FORT_DERXVEL, { 1, 1, 0, 0, 0, 0 } },
{ "y_velocity", FORT_DERYVEL, { 1, 0, 1, 0, 0, 0 } },
{ "z_velocity", FORT_DERZVEL, { 1, 0, 0, 1, 0, 0 } },
{ "teng", FORT_DERTENG, { 1, 0, 0, 0, 1, 0 } },
{ "eint", FORT_DERIENG, { 1, 1, 1, 1, 1, 0 } },
{ "kint", FORT_DERKENG, { 1, 1, 1, 1, 0, 0 } },
{ "vorticity", FORT_DERVORT, { 1, 1, 1, 1, 0, 0 } },
{ "concentration", FORT_DERCON, { 1, 0, 0, 0, 0, 1 } },
{ "dilitation", FORT_DERDILI, { 1, 1, 1, 1, 0, 0 } },
{ "density", FORT_DERDEN, { 1, 0, 0, 0, 0, 0 } },
{ "tracer", FORT_DERTRAC, { 0, 0, 0, 0, 0, 1 } }
};
*/
extern const struct DeriveRecord DerivedQuants[] =
{
{ "logden", FORT_DERLGDN, { 1, 0, 0, 0, 0, 0 } },
{ "x_velocity", FORT_DERXVEL, { 1, 1, 0, 0, 0, 0 } },
{ "y_velocity", FORT_DERYVEL, { 1, 0, 1, 0, 0, 0 } },
{ "z_velocity", FORT_DERZVEL, { 1, 0, 0, 1, 0, 0 } },
{ "teng", FORT_DERTENG, { 1, 0, 0, 0, 1, 0 } },
{ "eint", FORT_DERIENG, { 1, 1, 1, 1, 1, 0 } },
{ "kint", FORT_DERKENG, { 1, 1, 1, 1, 0, 0 } },
{ "vorticity", FORT_DERVORT, { 1, 1, 1, 1, 0, 0 } },
{ "concentration", FORT_DERCON, { 1, 0, 0, 0, 0, 1 } },
{ "dilitation", FORT_DERDILI, { 1, 1, 1, 1, 0, 0 } },
{ "density", FORT_DERDEN, { 1, 0, 0, 0, 0, 0 } },
{ "mach", FORT_DERMACH, { 1, 1, 1, 1, 1, 0 } },
{ "tracer", FORT_DERTRAC, { 0, 0, 0, 0, 0, 1 } }
};
#endif /* BL_DERIVE_HCHEM */
#endif /*BL_DERIVE_IAMR*/
static const int NumDeriveFunc = sizeof(DerivedQuants)/sizeof(DeriveRecord);
#endif /*BL_SPACEDIM==3*/
#endif