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