xref: /phasta/phSolver/common/common_c.h (revision 34e670573a35f7483bc764e7984cd2aafb2bfc73)
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 /*Woolwine June 4 2014 NASA Inlet*/
264   extern struct{
265     int BCdtKW;
266     int tsBase;
267   } nasavari;
268 
269   extern struct{
270     double PresFreq;
271     double PresAmp;
272     double AlphaFreq;
273     double AlphaAmp;
274   } nasavar;
275 
276 /*chen Sep 25 2009  Flow Control Parameters*/
277   extern struct{
278     int iI2Binlet;
279     int isetOutPres;
280     int isetInitial;
281   } ctrlvari;
282 
283 	extern struct{
284 		double BlowingVelDuct;
285 		double BlowingIniMdotDuct;
286 		double BlowingFnlMdotDuct;
287 		double suctionVbottom;
288 		double suctionVside_lower;
289 		double suctionVside_upper;
290 		double suctionVtop;
291 		double blowerVelocity;
292 		double blowerTemperature;
293 		double blowerEV;
294 		int isetOutletID;
295 		int isetInitial_Duct;
296 		int isetInlet_Duct;
297 		int isetSuctionID_Duct;
298 		int isetBlowerID_Duct;
299 		int iDuctgeometryType;
300 		int iStraigtPrint;
301 		int isetEV_IC_BC;
302 		int isetEVramp;
303 		int isetBlowing_Duct;
304 		int ifixBlowingVel_Duct;
305 		int nBlowingStepsDuct;
306 	}ductvari;
307 
308   extern struct{
309     double inletVelX;
310     double outPres1;
311     double xvel_ini;
312     double yvel_ini;
313     double zvel_ini;
314     double temp_ini;
315     double pres_ini;
316     double evis_ini;
317   } ctrlvar;
318 
319 	extern struct{
320 		double evis_IC_BC;
321 		double EVrampXmin;
322 		double EVrampXmax;
323 		double EVrampMin;
324 		double EVrampMax;
325 	} ductvar;
326 //////////////////////////////////////////
327 
328 
329   extern struct {
330     double epsilon_ls;
331     double epsilon_lsd;
332     double dtlset;
333     int iLSet;
334     int ivconstraint;
335     int iExpLSSclr1;
336     int iExpLSSclr2;
337   } levlset;
338 
339   extern struct {
340     int nshape;
341     int nshapeb;
342     int maxshb;
343     int nshl;
344     int nshlb;
345     int nfath;
346     int ntopsh;
347     int nsonmax;
348   } shpdat ;
349 
350   extern struct {
351     int mshp;
352     int mshgl;
353     int mwght;
354     int mshpb;
355     int mshglb;
356     int mwghtb;
357     int mmut;
358     int mrhot;
359     int mxst;
360   } datpnt ;
361 
362   extern struct {
363     int lelCat;
364     int lcsyst;
365     int iorder;
366     int nenb;
367     int nelblk;
368     int nelblb;
369     int ndofl;
370     int nsymdl;
371     int nenl;
372     int nfacel;
373     int nenbl;
374     int intind;
375     int mattyp;
376   } elmpar ;
377 
378   extern struct {
379     double E3nsd;
380     int I3nsd;
381     int nsymdf;
382     int ndofBC;
383     int ndiBCB;
384     int ndBCB;
385     int Jactyp;
386     int jump;
387     int ires;
388     int iprec;
389     int iprev;
390     int ibound;
391     int idiff;
392     int lhs;
393     int itau;
394     int ipord;
395     int ipred;
396     int lstres;
397     int iepstm;
398     double dtsfct;
399     double taucfct;
400     int ibksiz;
401     int iabc;
402     int isurf;
403     int idflx;
404     double Bo;
405     int EntropyPressure;
406     int irampViscOutlet;
407     int istretchOutlet;
408     int iremoveStabTimeTerm;
409 	int iLHScond;
410   } genpar ;
411 
412   extern struct {
413     double epstol[6];  /* 1+ max number of scalars  (beginning of the
414                           end of time sequences) */
415     double Delt[MAXTS];
416     double CFLfl[MAXTS];
417     double CFLsl[MAXTS];
418     int nstep[MAXTS];
419     int niter[MAXTS];
420     int impl[MAXTS];
421     double rhoinf[MAXTS];
422     int LHSupd[6];
423     int loctim[MAXTS];
424     double deltol[2][MAXTS];
425     int leslib;
426     int svLSFlag;
427     int svLSType;
428   } inpdat ;
429 
430   extern struct {
431     int iin;
432     int igeom;
433     int ipar;
434     int ibndc;
435     int imat;
436     int iecho;
437     int iout;
438     int ichmou;
439     int irstin;
440     int irstou;
441     int ihist;
442     int iflux;
443     int ierror;
444     int itable;
445     int iforce;
446     int igraph;
447     int itime;
448   } mio ;
449 
450   extern struct {
451     double fin;
452     double fgeom;
453     double fpar;
454     double fbndc;
455     double fmat;
456     double fecho;
457     double frstin;
458     double frstou;
459     double fhist;
460     double ferror;
461     double ftable;
462     double fforce;
463     double fgraph;
464     double ftime;
465   } mioname ;
466 
467   extern struct {
468     double eGMRES;
469     int lGMRES;
470     int lGMRESs;
471     int iKs;
472     int iKss;
473     int ntotGM;
474     int ntotGMs;
475   } itrpar ;
476 
477   extern struct {
478     double datmat[MAXTS][7][3];
479     int matflg[MAXTS][6];
480     int nummat;
481     int mexist;
482   } matdat ;
483 
484   extern struct {
485     double pr, Planck, Stephan, Nh, Rh, Rgas;
486     double gamma, gamma1, s0;
487     /*, const, xN2, xO2;*/
488     /*double yN2,    yO2,    Msh[5], cpsh[5],s0sh[5],h0sh[5];*/
489     /*double Rs[5],  cps[5], cvs[5], h0s[5], Trot[5],sigs[5];*/
490     /*double Tvib[5],g0s[5], dofs[5],ithm;*/
491   } mmatpar ;
492 
493   extern struct {
494     double ro;
495     double vel;
496     double temper;
497     double press;
498     double entrop;
499     int ntout;
500     int ioform;
501     int iowflux;
502     int iofieldv;
503     char iotype[80];
504     int ioybar;
505     int nstepsincycle;
506     int nphasesincycle;
507     int ncycles_startphaseavg;
508     int ivort;
509     int icomputevort;
510     int nsynciofiles;
511     int nsynciofieldswriterestart;
512     int iv_rankpercore;
513     int iv_corepernode;
514     int input_mode; //FIXME -1:streams, 0:posix, >0:syncio
515     int output_mode; //FIXME -1:streams, 0:posix, >0:syncio
516     /*  int iostats; */
517 /*      int ipresref; */
518   } outpar ;
519 
520   extern struct {
521     int mbeg;
522     int mend;
523     int mprec;
524   } point ;
525 
526   extern struct {
527     double epsM;
528     int iabres;
529   } precis ;
530 
531   extern struct {
532     int npro;
533   } propar ;
534 
535   extern struct {
536     double resfrt;
537     double resfrts;
538   } resdat ;
539 
540   extern struct {
541     int imap;
542     int ivart;
543     int iDC;
544     int iPcond;
545     int Kspace;
546     int nGMRES;
547     int iconvflow;
548     int iconvsclr;
549     int idcsclr[2];
550   } solpar ;
551 
552   extern struct {
553     double time;
554     double CFLfld;
555     double CFLsld;
556     double Dtgl;
557     double Dtmax;
558     double alpha;
559     double etol;
560     int lstep;  // read from numstart.dat and incremented every time step
561     int ifunc;
562     int itseq;
563     int istep; //  how many steps (starting from 0 each run)
564     int iter;
565     int nitr;
566     double almi;
567     double alfi;
568     double gami;
569     double flmpl;
570     double flmpr;
571     double dtol[2];
572     int iCFLworst;
573     int lskeep;
574   } timdat ;
575 
576   extern struct {
577     int LCtime;
578     int ntseq;
579   } timpar ;
580 
581   extern struct {
582     int numeqns[100];
583     int minIters;
584     int maxIters;
585     int iprjFlag;
586     int nPrjs;
587     int ipresPrjFlag;
588     int nPresPrjs;
589     double prestol;
590     double statsflow[6];
591     double statssclr[6];
592     int iverbose;
593   } incomp ;
594 
595   extern struct {
596     double ccode[13];
597   } mtimer1 ;
598 
599   extern struct {
600     double flops;
601     double gbytes;
602     double sbytes;
603     int iclock;
604     int icd;
605     int icode;
606     int icode2;
607     int icode3;
608   } mtimer2 ;
609 
610   extern struct {
611     double cpu[11];
612     double cpu0[11];
613     int nacess[11];
614   } timer3 ;
615 
616   extern struct {
617     double title;
618     int ititle;
619   } title ;
620 
621   extern struct {
622     int intg[MAXTS][2];
623   }intdat;
624 
625   extern struct {
626     double bcttimescale;
627     double ValueListResist[MAXSURF+1];
628     double rhovw;
629     double thicknessvw;
630     double evw;
631     double rnuvw;
632     double rshearconstantvw;
633     double betai;
634     int icardio;
635     int itvn;
636     int ipvsq;
637     int numResistSrfs;
638     int nsrflistResist[MAXSURF+1];
639     int numImpSrfs;
640     int nsrflistImp[MAXSURF+1];
641     int impfile;
642     int numRCRSrfs;
643     int nsrflistRCR[MAXSURF+1];
644     int ircrfile;
645     int ideformwall;
646     int iwallmassfactor;
647     int iwallstiffactor;
648     int iviscflux;
649  } nomodule;
650 
651   extern struct {
652     int seqsize;
653     int stepseq[100];
654   } sequence;
655 
656   extern struct {
657     double strong_eps;      /* strong criterion Stuben factor    */
658     double ramg_eps;        /* AMG convergence eps               */
659     double ramg_relax;       /* relaxation factor Gauss-Seidel/Jac*/
660     double ramg_trunc;      /* truncation select */
661     double ramg_chebyratio; /* Eigen ratio for chebyshev smoothing */
662  } amgvarr ;
663 
664   extern struct {
665     int irun_amg;           /* Employ AMG feature solfar.f      */
666     int irun_amg_prec;      /* Run AMG as preconditioner to CG */
667     int iamg_verb;          /* amg verbosity flag                */
668     int iamg_neg_sten;      /* neg only stencil or neg and pos   */
669     int iamg_nlevel;        /* number of levels 2-V etc.         */
670     int iamg_c_solver;     /* solve fine level iter. method     */
671     int iamg_init;           /* setup flag */
672     int iamg_setup_frez;    /* how many solfars to re setup amg */
673     int iamg_interp;        /* interpolation select */
674     int maxnev;             /* total eigenvectors used for ggb*/
675     int maxncv;             /* total iterative vectors for ggb*/
676     int iamg_smoother;      /* Smoother type */
677     int mlsdeg;             /* Polynomial Smoothing (MLS) degree */
678     int iamg_reduce;        /* Run a reduced case */
679  } amgvari ;
680 
681 #ifdef __cplusplus
682 }
683 #endif
684