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