xref: /phasta/phSolver/common/common_c.h (revision 712d3df0b59ebebaaeaea358162c8d2c043c6e08)
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 leslib;
413     int svLSFlag;
414     int svLSType;
415   } inpdat ;
416 
417   extern struct {
418     int iin;
419     int igeom;
420     int ipar;
421     int ibndc;
422     int imat;
423     int iecho;
424     int iout;
425     int ichmou;
426     int irstin;
427     int irstou;
428     int ihist;
429     int iflux;
430     int ierror;
431     int itable;
432     int iforce;
433     int igraph;
434     int itime;
435   } mio ;
436 
437   extern struct {
438     double fin;
439     double fgeom;
440     double fpar;
441     double fbndc;
442     double fmat;
443     double fecho;
444     double frstin;
445     double frstou;
446     double fhist;
447     double ferror;
448     double ftable;
449     double fforce;
450     double fgraph;
451     double ftime;
452   } mioname ;
453 
454   extern struct {
455     double eGMRES;
456     int lGMRES;
457     int lGMRESs;
458     int iKs;
459     int iKss;
460     int ntotGM;
461     int ntotGMs;
462   } itrpar ;
463 
464   extern struct {
465     double datmat[MAXTS][7][3];
466     int matflg[MAXTS][6];
467     int nummat;
468     int mexist;
469   } matdat ;
470 
471   extern struct {
472     double pr, Planck, Stephan, Nh, Rh, Rgas;
473     double gamma, gamma1, s0;
474     /*, const, xN2, xO2;*/
475     /*double yN2,    yO2,    Msh[5], cpsh[5],s0sh[5],h0sh[5];*/
476     /*double Rs[5],  cps[5], cvs[5], h0s[5], Trot[5],sigs[5];*/
477     /*double Tvib[5],g0s[5], dofs[5],ithm;*/
478   } mmatpar ;
479 
480   extern struct {
481     double ro;
482     double vel;
483     double temper;
484     double press;
485     double entrop;
486     int ntout;
487     int ioform;
488     int iowflux;
489     int iofieldv;
490     char iotype[80];
491     int ioybar;
492     int nstepsincycle;
493     int nphasesincycle;
494     int ncycles_startphaseavg;
495     int ivort;
496     int icomputevort;
497     int nsynciofiles;
498     int nsynciofieldswriterestart;
499     int iv_rankpercore;
500     int iv_corepernode;
501     int input_mode; //FIXME -1:streams, 0:posix, >0:syncio
502     int output_mode; //FIXME -1:streams, 0:posix, >0:syncio
503     /*  int iostats; */
504 /*      int ipresref; */
505   } outpar ;
506 
507   extern struct {
508     int mbeg;
509     int mend;
510     int mprec;
511   } point ;
512 
513   extern struct {
514     double epsM;
515     int iabres;
516   } precis ;
517 
518   extern struct {
519     int npro;
520   } propar ;
521 
522   extern struct {
523     double resfrt;
524     double resfrts;
525   } resdat ;
526 
527   extern struct {
528     int imap;
529     int ivart;
530     int iDC;
531     int iPcond;
532     int Kspace;
533     int nGMRES;
534     int iconvflow;
535     int iconvsclr;
536     int idcsclr[2];
537   } solpar ;
538 
539   extern struct {
540     double time;
541     double CFLfld;
542     double CFLsld;
543     double Dtgl;
544     double Dtmax;
545     double alpha;
546     double etol;
547     int lstep;  // read from numstart.dat and incremented every time step
548     int ifunc;
549     int itseq;
550     int istep; //  how many steps (starting from 0 each run)
551     int iter;
552     int nitr;
553     double almi;
554     double alfi;
555     double gami;
556     double flmpl;
557     double flmpr;
558     double dtol[2];
559     int iCFLworst;
560     int lskeep;
561   } timdat ;
562 
563   extern struct {
564     int LCtime;
565     int ntseq;
566   } timpar ;
567 
568   extern struct {
569     int numeqns[100];
570     int minIters;
571     int maxIters;
572     int iprjFlag;
573     int nPrjs;
574     int ipresPrjFlag;
575     int nPresPrjs;
576     double prestol;
577     double statsflow[6];
578     double statssclr[6];
579     int iverbose;
580   } incomp ;
581 
582   extern struct {
583     double ccode[13];
584   } mtimer1 ;
585 
586   extern struct {
587     double flops;
588     double gbytes;
589     double sbytes;
590     int iclock;
591     int icd;
592     int icode;
593     int icode2;
594     int icode3;
595   } mtimer2 ;
596 
597   extern struct {
598     double cpu[11];
599     double cpu0[11];
600     int nacess[11];
601   } timer3 ;
602 
603   extern struct {
604     double title;
605     int ititle;
606   } title ;
607 
608   extern struct {
609     int intg[MAXTS][2];
610   }intdat;
611 
612   extern struct {
613     double bcttimescale;
614     double ValueListResist[MAXSURF+1];
615     double rhovw;
616     double thicknessvw;
617     double evw;
618     double rnuvw;
619     double rshearconstantvw;
620     double betai;
621     int icardio;
622     int itvn;
623     int ipvsq;
624     int numResistSrfs;
625     int nsrflistResist[MAXSURF+1];
626     int numImpSrfs;
627     int nsrflistImp[MAXSURF+1];
628     int impfile;
629     int numRCRSrfs;
630     int nsrflistRCR[MAXSURF+1];
631     int ircrfile;
632     int ideformwall;
633     int iwallmassfactor;
634     int iwallstiffactor;
635     int iviscflux;
636  } nomodule;
637 
638   extern struct {
639     int seqsize;
640     int stepseq[100];
641   } sequence;
642 
643   extern struct {
644     double strong_eps;      /* strong criterion Stuben factor    */
645     double ramg_eps;        /* AMG convergence eps               */
646     double ramg_relax;       /* relaxation factor Gauss-Seidel/Jac*/
647     double ramg_trunc;      /* truncation select */
648     double ramg_chebyratio; /* Eigen ratio for chebyshev smoothing */
649  } amgvarr ;
650 
651   extern struct {
652     int irun_amg;           /* Employ AMG feature solfar.f      */
653     int irun_amg_prec;      /* Run AMG as preconditioner to CG */
654     int iamg_verb;          /* amg verbosity flag                */
655     int iamg_neg_sten;      /* neg only stencil or neg and pos   */
656     int iamg_nlevel;        /* number of levels 2-V etc.         */
657     int iamg_c_solver;     /* solve fine level iter. method     */
658     int iamg_init;           /* setup flag */
659     int iamg_setup_frez;    /* how many solfars to re setup amg */
660     int iamg_interp;        /* interpolation select */
661     int maxnev;             /* total eigenvectors used for ggb*/
662     int maxncv;             /* total iterative vectors for ggb*/
663     int iamg_smoother;      /* Smoother type */
664     int mlsdeg;             /* Polynomial Smoothing (MLS) degree */
665     int iamg_reduce;        /* Run a reduced case */
666  } amgvari ;
667 
668 #ifdef __cplusplus
669 }
670 #endif
671