xref: /phasta/phSolver/common/common_c.h (revision 3de22adcea938dcbea5f2b4ef2369694350775bd)
1 /* Routine contains the structures for reading the user input through
2  input_fform.cpp. The default values for all these variables are defined in
3  input.config.
4 
5  Input variables that have been previously declared in common.h have to be
6  re-declared here, in a consistant structure.*/
7 
8 #include <FCMangle.h>
9 
10 #define workfc FortranCInterface_GLOBAL_(workfc,WORKFC)
11 #define fronts FortranCInterface_GLOBAL_(fronts,FRONTS)
12 #define newdim FortranCInterface_GLOBAL_(newdim,NEWDIM)
13 #define timer4 FortranCInterface_GLOBAL_(timer4,TIMER4)
14 #define extrat FortranCInterface_GLOBAL_(extrat,EXTRAT)
15 #define spongevar FortranCInterface_GLOBAL_(spongevar,SPONGEVAR)
16 #define turbvar FortranCInterface_GLOBAL_(turbvar,TURBVAR)
17 #define turbvari FortranCInterface_GLOBAL_(turbvari,TURBVARI)
18 #define mpistats FortranCInterface_GLOBAL_(mpistats,MPISTATS)
19 #define memstats FortranCInterface_GLOBAL_(memstats,MEMSTATS)
20 #define spebcvr FortranCInterface_GLOBAL_(spebcvr,SPEBCVR)
21 #define aerfrc FortranCInterface_GLOBAL_(aerfrc,AERFRC)
22 #define astore FortranCInterface_GLOBAL_(astore,ASTORE)
23 #define conpar FortranCInterface_GLOBAL_(conpar,CONPAR)
24 #define ctrlvari FortranCInterface_GLOBAL_(ctrlvari,CTRLVARI)
25 #define ctrlvar  FortranCInterface_GLOBAL_(ctrlvar,CTRLVAR)
26 #define shpdat FortranCInterface_GLOBAL_(shpdat,SHPDAT)
27 #define datpnt FortranCInterface_GLOBAL_(datpnt,DATPNT)
28 #define elmpar FortranCInterface_GLOBAL_(elmpar,ELMPAR)
29 #define genpar FortranCInterface_GLOBAL_(genpar,GENPAR)
30 #define inpdat FortranCInterface_GLOBAL_(inpdat,INPDAT)
31 #define intdat FortranCInterface_GLOBAL_(intdat,INTDAT)
32 #define mio FortranCInterface_GLOBAL_(mio,MIO)
33 #define mioname FortranCInterface_GLOBAL_(mioname,MIONAME)
34 #define itrpar FortranCInterface_GLOBAL_(itrpar,ITRPAR)
35 #define itrpnt FortranCInterface_GLOBAL_(itrpnt,ITRPNT)
36 #define matdat FortranCInterface_GLOBAL_(matdat,MATDAT)
37 #define mmatpar FortranCInterface_GLOBAL_(mmatpar,MMATPAR)
38 #define outpar FortranCInterface_GLOBAL_(outpar,OUTPAR)
39 #define point FortranCInterface_GLOBAL_(point,POINT)
40 #define precis FortranCInterface_GLOBAL_(precis,PRECIS)
41 #define propar FortranCInterface_GLOBAL_(propar,PROPAR)
42 #define resdat FortranCInterface_GLOBAL_(resdat,RESDAT)
43 #define solpar FortranCInterface_GLOBAL_(solpar,SOLPAR)
44 #define timdat FortranCInterface_GLOBAL_(timdat,TIMDAT)
45 #define timpar FortranCInterface_GLOBAL_(timpar,TIMPAR)
46 #define incomp FortranCInterface_GLOBAL_(incomp,INCOMP)
47 #define mtimer1 FortranCInterface_GLOBAL_(mtimer1,MTIMER1)
48 #define mtimer2 FortranCInterface_GLOBAL_(mtimer2,MTIMER2)
49 #define timer3 FortranCInterface_GLOBAL_(timer3,TIMER3)
50 #define title FortranCInterface_GLOBAL_(title,TITLE)
51 #define sclrs FortranCInterface_GLOBAL_(sclrs,SCLRS)
52 #define levlset FortranCInterface_GLOBAL_(levlset,LEVLSET)
53 #define nomodule FortranCInterface_GLOBAL_(nomodule,NOMODULE)
54 #define sequence FortranCInterface_GLOBAL_(sequence,SEQUENCE)
55 #define amgvarr FortranCInterface_GLOBAL_(amgvarr,AMGVARR)
56 #define amgvari FortranCInterface_GLOBAL_(amgvari,AMGVARI)
57 
58 #define MAXBLK   50000
59 #define MAXSURF  30
60 #define MAXTS   100
61 #define MAXTOP   6
62 #define MAXQPT   125
63 #define MAXSH    32
64 #define NSD      3
65 #define NSDSQ    9
66 #define machin   'RS/6000'
67 #define machfl   4
68 #define zero   0.0000000000000000000000000000000d0
69 #define pt125   0.1250000000000000000000000000000d0
70 #define pt25   0.2500000000000000000000000000000d0
71 #define pt33   0.3333333333333333333333333333333d0
72 #define pt39   0.3968502629920498686879264098181d0
73 #define pt5   0.5000000000000000000000000000000d0
74 #define pt57   0.5773502691896257645091487805020d0
75 #define pt66   0.6666666666666666666666666666667d0
76 #define pt75   0.7500000000000000000000000000000d0
77 #define one   1.0000000000000000000000000000000d0
78 #define sqt2   1.4142135623730950488016887242097d0
79 #define onept5   1.5000000000000000000000000000000d0
80 #define two   2.0000000000000000000000000000000d0
81 #define three   3.0000000000000000000000000000000d0
82 #define four   4.0000000000000000000000000000000d0
83 #define five   5.0000000000000000000000000000000d0
84 #define pi   3.1415926535897932384626433832795d0
85 #define inv1024sq 9.5367431640625e-7
86 
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
90   extern struct {
91     int master;
92     int numpe;
93     int myrank;
94   } workfc ;
95 
96   extern struct {
97     int maxfront;
98     int nlwork;
99   } fronts ;
100 
101   extern struct {
102     int numper;
103     int nshgt;
104     int nshg0;
105   } newdim ;
106 
107   extern struct {
108     double birth;
109     double death;
110     double comtim;
111   } timer4 ;
112 
113   extern struct {
114     double ttim[100];
115   } extrat ;
116 
117   extern struct {
118     double zoutsponge, radsponge, zinsponge, grthosponge, grthisponge;
119     double betamax;
120     int spongecontinuity, spongemomentum1, spongemomentum2;
121     int spongeenergy, spongemomentum3;
122   } spongevar ;
123 
124   extern struct {
125     double eles;
126     double ylimit[9][3]; /* 9 = 5 + 4 = puvwT + 4Scalars */
127     double rampmdot[3][2];
128     double rmutarget;
129     double pzero;
130     double wtavei;
131     double dtavei;
132     double dke;
133     double fwr1;
134     double flump;
135     double DES_SA_hmin;
136     int ierrcalc;
137     int ihessian;
138     int itwmod;
139     int ngaussf;
140     int idim;
141     int nlist;
142     int nintf[MAXTOP];
143   } turbvar ;
144 
145   extern struct {
146     int irans, iles, idistcalc, isubmod;
147     int ifproj;
148     int i2filt;
149     int modlstats;
150     int idis;
151     int nohomog;
152     int ierrsmooth;
153     int iramp;
154 
155 /*      int itwmod; */
156 /*      double rtavei; */
157 /*      int ierrcalc; */
158   } turbvari ;
159 
160   extern struct {
161     int iISend;
162     int iISendScal;
163     int iIRecv;
164     int iIRecvScal;
165     int iWaitAll;
166     int iWaitAllScal;
167     int iAllR;
168     int iAllRScal;
169     int impistat;
170     int impistat2;
171     double rmpitmr;
172     double rISend;
173     double rISendScal;
174     double rIRecv;
175     double rIRecvScal;
176     double rWaitAll;
177     double rWaitAllScal;
178     double rAllR;
179     double rAllRScal;
180     double rCommu;
181     double rCommuScal;
182   } mpistats ;
183 
184   extern struct {
185     double rheap;
186     double rheapavail;
187     double rstack;
188     double rstackavail;
189     double rshared;
190     double rpersist;
191     double rguard;
192     double rmmap;
193   } memstats ;
194 
195 
196   extern struct {
197     int irscale;
198     int intpres;
199     double plandist;
200     double thetag;
201     double ds;
202     double tolerence;
203     double radcyl;
204     double rbltin;
205     double rvscal;
206   } spebcvr ;
207 
208   extern struct {
209     double scdiff[5];
210     double tdecay;
211     int nsclr, isclr,nsolt, nosource;
212     int consrv_sclr_conv_vel;
213   } sclrs;
214 
215   extern struct {
216     double flxID[MAXSURF+1][10] ;
217     double Force[3];
218     double HFlux;
219     int nsrflist[MAXSURF+1];
220     int isrfIM;
221     double flxIDsclr[MAXSURF][4];
222     int irankfilesforce[MAXSURF+1];
223   } aerfrc ;
224 
225   extern struct {
226     double a[100000];
227   } astore ;
228 
229   extern struct {
230     int numnp;
231     int numel;
232     int numelb;
233     int numpbc;
234     int nen;
235     int nfaces;
236     int numflx;
237     int ndof;
238     int iALE;
239     int icoord;
240     int navier;
241     int irs;
242     int iexec;
243     int necho;
244     int ichem;
245     int iRK;
246     int nedof;
247     int nshg;
248     int nnz;
249     int istop;
250     int nflow;
251     int nnz_tot;
252     int idtn;
253   } conpar ;
254 
255 /*chen Sep 25 2009  Flow Control Parameters*/
256   extern struct{
257     int iI2Binlet;
258     int isetOutPres;
259     int isetInitial;
260   } ctrlvari;
261 
262   extern struct{
263     double inletVelX;
264     double outPres1;
265     double xvel_ini;
266     double yvel_ini;
267     double zvel_ini;
268     double temp_ini;
269     double pres_ini;
270     double evis_ini;
271   } ctrlvar;
272 
273   extern struct {
274     double epsilon_ls;
275     double epsilon_lsd;
276     double dtlset;
277     int iLSet;
278     int ivconstraint;
279     int iExpLSSclr1;
280     int iExpLSSclr2;
281   } levlset;
282 
283   extern struct {
284     int nshape;
285     int nshapeb;
286     int maxshb;
287     int nshl;
288     int nshlb;
289     int nfath;
290     int ntopsh;
291     int nsonmax;
292   } shpdat ;
293 
294   extern struct {
295     int mshp;
296     int mshgl;
297     int mwght;
298     int mshpb;
299     int mshglb;
300     int mwghtb;
301     int mmut;
302     int mrhot;
303     int mxst;
304   } datpnt ;
305 
306   extern struct {
307     int lelCat;
308     int lcsyst;
309     int iorder;
310     int nenb;
311     int nelblk;
312     int nelblb;
313     int ndofl;
314     int nsymdl;
315     int nenl;
316     int nfacel;
317     int nenbl;
318     int intind;
319     int mattyp;
320   } elmpar ;
321 
322   extern struct {
323     double E3nsd;
324     int I3nsd;
325     int nsymdf;
326     int ndofBC;
327     int ndiBCB;
328     int ndBCB;
329     int Jactyp;
330     int jump;
331     int ires;
332     int iprec;
333     int iprev;
334     int ibound;
335     int idiff;
336     int lhs;
337     int itau;
338     int ipord;
339     int ipred;
340     int lstres;
341     int iepstm;
342     double dtsfct;
343     double taucfct;
344     int ibksiz;
345     int iabc;
346     int isurf;
347     int idflx;
348     double Bo;
349     int EntropyPressure;
350     int irampViscOutlet;
351     int istretchOutlet;
352     int iremoveStabTimeTerm;
353   } genpar ;
354 
355   extern struct {
356     double epstol[6];  /* 1+ max number of scalars  (beginning of the
357                           end of time sequences) */
358     double Delt[MAXTS];
359     double CFLfl[MAXTS];
360     double CFLsl[MAXTS];
361     int nstep[MAXTS];
362     int niter[MAXTS];
363     int impl[MAXTS];
364     double rhoinf[MAXTS];
365     int LHSupd[6];
366     int loctim[MAXTS];
367     double deltol[2][MAXTS];
368   } inpdat ;
369 
370   extern struct {
371     int iin;
372     int igeom;
373     int ipar;
374     int ibndc;
375     int imat;
376     int iecho;
377     int iout;
378     int ichmou;
379     int irstin;
380     int irstou;
381     int ihist;
382     int iflux;
383     int ierror;
384     int itable;
385     int iforce;
386     int igraph;
387     int itime;
388   } mio ;
389 
390   extern struct {
391     double fin;
392     double fgeom;
393     double fpar;
394     double fbndc;
395     double fmat;
396     double fecho;
397     double frstin;
398     double frstou;
399     double fhist;
400     double ferror;
401     double ftable;
402     double fforce;
403     double fgraph;
404     double ftime;
405   } mioname ;
406 
407   extern struct {
408     double eGMRES;
409     int lGMRES;
410     int iKs;
411     int ntotGM;
412   } itrpar ;
413 
414   extern struct {
415     int mHBrg;
416     int meBrg;
417     int myBrg;
418     int mRcos;
419     int mRsin;
420   } itrpnt ;
421 
422   extern struct {
423     double datmat[MAXTS][7][3];
424     int matflg[MAXTS][6];
425     int nummat;
426     int mexist;
427   } matdat ;
428 
429   extern struct {
430     double pr, Planck, Stephan, Nh, Rh, Rgas;
431     double gamma, gamma1, s0;
432     /*, const, xN2, xO2;*/
433     /*double yN2,    yO2,    Msh[5], cpsh[5],s0sh[5],h0sh[5];*/
434     /*double Rs[5],  cps[5], cvs[5], h0s[5], Trot[5],sigs[5];*/
435     /*double Tvib[5],g0s[5], dofs[5],ithm;*/
436   } mmatpar ;
437 
438   extern struct {
439     double ro;
440     double vel;
441     double temper;
442     double press;
443     double entrop;
444     int ntout;
445     int ioform;
446     int iowflux;
447     int iofieldv;
448     char iotype[80];
449     int ioybar;
450     int nstepsincycle;
451     int nphasesincycle;
452     int ncycles_startphaseavg;
453     int ivort;
454     int icomputevort;
455     int nsynciofiles;
456     int nsynciofieldswriterestart;
457     int iv_rankpercore;
458     int iv_corepernode;
459     int input_mode; //FIXME -1:streams, 0:posix, >0:syncio
460     int output_mode; //FIXME -1:streams, 0:posix, >0:syncio
461     /*  int iostats; */
462 /*      int ipresref; */
463   } outpar ;
464 
465   extern struct {
466     int mbeg;
467     int mend;
468     int mprec;
469   } point ;
470 
471   extern struct {
472     double epsM;
473     int iabres;
474   } precis ;
475 
476   extern struct {
477     int npro;
478   } propar ;
479 
480   extern struct {
481     double resfrt;
482   } resdat ;
483 
484   extern struct {
485     int imap;
486     int ivart;
487     int iDC;
488     int iPcond;
489     int Kspace;
490     int nGMRES;
491     int iconvflow;
492     int iconvsclr;
493     int idcsclr[2];
494   } solpar ;
495 
496   extern struct {
497     double time;
498     double CFLfld;
499     double CFLsld;
500     double Dtgl;
501     double Dtmax;
502     double alpha;
503     double etol;
504     int lstep;
505     int ifunc;
506     int itseq;
507     int istep;
508     int iter;
509     int nitr;
510     double almi;
511     double alfi;
512     double gami;
513     double flmpl;
514     double flmpr;
515     double dtol[2];
516     int iCFLworst;
517     int lskeep;
518   } timdat ;
519 
520   extern struct {
521     int LCtime;
522     int ntseq;
523   } timpar ;
524 
525   extern struct {
526     int numeqns[100];
527     int minIters;
528     int maxIters;
529     int iprjFlag;
530     int nPrjs;
531     int ipresPrjFlag;
532     int nPresPrjs;
533     double prestol;
534     double statsflow[6];
535     double statssclr[6];
536     int iverbose;
537   } incomp ;
538 
539   extern struct {
540     double ccode[13];
541   } mtimer1 ;
542 
543   extern struct {
544     double flops;
545     double gbytes;
546     double sbytes;
547     int iclock;
548     int icd;
549     int icode;
550     int icode2;
551     int icode3;
552   } mtimer2 ;
553 
554   extern struct {
555     double cpu[11];
556     double cpu0[11];
557     int nacess[11];
558   } timer3 ;
559 
560   extern struct {
561     double title;
562     int ititle;
563   } title ;
564 
565   extern struct {
566     int intg[MAXTS][2];
567   }intdat;
568 
569   extern struct {
570     double bcttimescale;
571     double ValueListResist[MAXSURF+1];
572     double rhovw;
573     double thicknessvw;
574     double evw;
575     double rnuvw;
576     double rshearconstantvw;
577     double betai;
578     int icardio;
579     int itvn;
580     int ipvsq;
581     int numResistSrfs;
582     int nsrflistResist[MAXSURF+1];
583     int numImpSrfs;
584     int nsrflistImp[MAXSURF+1];
585     int impfile;
586     int numRCRSrfs;
587     int nsrflistRCR[MAXSURF+1];
588     int ircrfile;
589     int ideformwall;
590     int iwallmassfactor;
591     int iwallstiffactor;
592     int iviscflux;
593  } nomodule;
594 
595   extern struct {
596     int seqsize;
597     int stepseq[100];
598   } sequence;
599 
600   extern struct {
601     double strong_eps;      /* strong criterion Stuben factor    */
602     double ramg_eps;        /* AMG convergence eps               */
603     double ramg_relax;       /* relaxation factor Gauss-Seidel/Jac*/
604     double ramg_trunc;      /* truncation select */
605     double ramg_chebyratio; /* Eigen ratio for chebyshev smoothing */
606  } amgvarr ;
607 
608   extern struct {
609     int irun_amg;           /* Employ AMG feature solfar.f      */
610     int irun_amg_prec;      /* Run AMG as preconditioner to CG */
611     int iamg_verb;          /* amg verbosity flag                */
612     int iamg_neg_sten;      /* neg only stencil or neg and pos   */
613     int iamg_nlevel;        /* number of levels 2-V etc.         */
614     int iamg_c_solver;     /* solve fine level iter. method     */
615     int iamg_init;           /* setup flag */
616     int iamg_setup_frez;    /* how many solfars to re setup amg */
617     int iamg_interp;        /* interpolation select */
618     int maxnev;             /* total eigenvectors used for ggb*/
619     int maxncv;             /* total iterative vectors for ggb*/
620     int iamg_smoother;      /* Smoother type */
621     int mlsdeg;             /* Polynomial Smoothing (MLS) degree */
622     int iamg_reduce;        /* Run a reduced case */
623  } amgvari ;
624 
625 #ifdef __cplusplus
626 }
627 #endif
628