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