HARM
harm and utilities
 All Data Structures Files Functions Variables Typedefs Macros Pages
interpline.para.c
Go to the documentation of this file.
1 
6 #include "decs.h"
7 
8 
10 
11 
13 void pass_1d_line_multipl_paraline(int MULTIPLTYPE, int whichquantity, int dir, int do_weight_or_recon, int recontype, int whichreduce, int preforder, int bs, int ps, int pe, int be, int *minorder, int *maxorder, int *shift, FTYPE (*shockindicator)[NBIGM], FTYPE *stiffindicator, FTYPE (*Vline)[NBIGM], FTYPE (*Pline)[NBIGM], FTYPE (*df)[NUMDFS][NBIGM], FTYPE (*dP)[NBIGM], FTYPE (*etai)[NUMTRUEEOMSETS][NBIGM], FTYPE (*monoindicator)[NUMMONOINDICATORS][NBIGM], FTYPE (*yprim)[2][NBIGM], FTYPE (*ystencilvar)[2][NBIGM], FTYPE (*yin)[2][NBIGM], FTYPE (*yout)[2][NBIGM], FTYPE (*youtpolycoef)[MAXSPACEORDER][NBIGM], struct of_trueijkp *trueijkp)
14 {
15  int nprlocalstart,nprlocalend;
16  int nprlocallist[MAXNPR];
17  int pllocal;
18  int numprims;
19  int plstart;
20  int pl,pliter;
21  int mypl;
22  int myi;
23  int is_copy;
24  void paracont(FTYPE ddq, FTYPE *y, FTYPE *facecont);
25  void parasteepgen(int pl, FTYPE etai, FTYPE *V, FTYPE *P, FTYPE *y, FTYPE *dq, FTYPE *l, FTYPE *r);
26  void paraflatten(int dir, int pl, FTYPE *y, FTYPE Fi, FTYPE *l, FTYPE *r);
27  void checkparamonotonicity(int smooth, int dqrange, int pl, FTYPE *y, FTYPE *ddq, FTYPE *dq, FTYPE *lin, FTYPE *rin, FTYPE *lout, FTYPE *rout);
28  void jonparasmooth_compute(int realisinterp, int dqrange, int pl, FTYPE *y, FTYPE *dq1, FTYPE *dq2, FTYPE *lout, FTYPE *rout, int *smooth);
29  FTYPE a_facecont[MAXNPR][NBIGM];
30  FTYPE (*facecont)[NBIGM];
31  int i;
32  int dqrange;
33  int odir1,odir2;
34  FTYPE left,right;
35  FTYPE mymono;
36  int smooth;
37  int whicheom;
38 
39 
40 #if(DOPPMREDUCE && SHOCKINDICATOR==0)
41 #error "Paraline needs SHOCKINDICATOR==1 when DOPPMREDUCE==1"
42 #endif
43 
44 #if(DOPPMCONTACTSTEEP && CONTACTINDICATOR==0)
45 #error "If Steepen in paraline, must turn on CONTACTINDICATOR"
46 #endif
47 
48 
49 
50 
51  // pointer shift
52  facecont=(FTYPE (*)[NBIGM]) (&(a_facecont[0][NBIGBND]));
53 
54 
55  // define orthogonal directions for field steepening
56  odir1=dir%3+1;
57  odir2=(dir+1)%3+1;
58 
59 
61  //
62  // Define which quantities (pl) to operate on
63  //
65 
66  setup_nprlocalist(whichquantity,&nprlocalstart,&nprlocalend,nprlocallist,&numprims);
67 
68 
70  //
71  // loop over line first getting continuous solution at face
72  //
74 
75  // for( i = ps; i <= pe; i++ ) {
76  NUMPRIMLOOP(pliter,pl) for( i = ps; i <= pe+1; i++ ) {
77  paracont(df[pl][DF2OFMONO][i], &yin[pl][0][i], &facecont[pl][i]);
78  }
79 
80 
81  //dqrange=preforder-2;
82  dqrange=5;
83 
84  // default left and right states
85  // 1 input and 2 outputs
86  NUMPRIMLOOP(pliter,pl) for( i = ps; i <= pe; i++ ) {
87  // left from y[i]
88  // yout[pl][0][i]=facecont[pl][i];
89  left=facecont[pl][i];
90  // right from y[i]
91  // yout[pl][1][i]=facecont[pl][i+1];
92  right=facecont[pl][i+1];
93 
94  if(RADFULLPL(pl)) whicheom=EOMSETRAD;
95  else whicheom=EOMSETMHD;
96 
97 #if(JONPARASMOOTH)
98  int realisinterp=1; // assume not big deal
99  jonparasmooth_compute(realisinterp,dqrange,pl,&yin[pl][0][i],&df[pl][DFONESIDED][i],&df[pl][DFCENT][i],&left,&right,&smooth);
100 #else
101  smooth=0;
102 #endif
103 
104 
105 #if(DOPPMCONTACTSTEEP)
106  if(smooth==0 && (whicheom==EOMSETMHD || whicheom==EOMSETRAD&&RADSHOCKFLAT)) parasteepgen(pl,etai[pl][whicheom][i],&Vline[whicheom][i],&Pline[whicheom][i],&yin[pl][0][i],&df[pl][DFMONO][i],&left,&right);
107 #endif
108 
109 
110 #if( DOPPMREDUCE )
111  if(whicheom==EOMSETMHD || whicheom==EOMSETRAD&&RADSHOCKFLAT) paraflatten(dir,pl,&yin[pl][0][i],shockindicator[whicheom][i],&left,&right);
112 #endif
113 
114 
115  dqrange=interporder[PARALINE]-2;
116  checkparamonotonicity(smooth, dqrange, pl, &yin[pl][0][i], &df[pl][DF2OFMONO][i], &df[pl][DFMONO][i], &left,&right,&left,&right);
117 
118 
119  // now see if want to use MONO result and combine with para result
120  // doesn't seem to help moving Gresho
121 #if(PARALINEUSESMONO)
122 
123  // in case parafrac==0 and WENO not called and monofrac==0, then need these to be 0 to avoid nan*0=nan
124  if(monoindicator[pl][MONOLEFTSET][i]==0.0) yout[pl][0][i]=0.0;
125  if(monoindicator[pl][MONORIGHTSET][i]==0.0) yout[pl][1][i]=0.0;
126 
127  mymono=min(max(monoindicator[pl][MONOINDTYPE][i],0.0),1.0);
128 
129  // mymono=1.0;
130 
131  //if(mymono>0.1) dualfprintf(fail_file,"i=%d mymono=%21.15g\n",i,mymono);
132 
133  yout[pl][0][i] = left * (1.0-mymono) + yout[pl][0][i] * mymono;
134  yout[pl][1][i] = right * (1.0-mymono) + yout[pl][1][i] * mymono;
135 #else
136  // no mono used, just assign para result
137  yout[pl][0][i] = left;
138  yout[pl][1][i] = right;
139 #endif
140 
141  // can force MINM for radiation, but don't need to.
142  if(0&&whicheom==EOMSETRAD){
143  FTYPE extremum=0.0;
144  FTYPE theta = 1.0;
145  FTYPE Dqm = theta * df[pl][DFONESIDED][i];
146  FTYPE Dqp = theta * df[pl][DFONESIDED][i+1];
147  FTYPE Dqc = df[pl][DFCENT][i];
148  FTYPE mydq = MINMODGEN(extremum,MINMODGEN(extremum,Dqm,Dqc),Dqp);
149 
150  yout[pl][0][i] = yin[pl][0][i] - 0.5*mydq;
151  yout[pl][1][i] = yin[pl][0][i] + 0.5*mydq;
152  }
153 
154 #if(NONMONOLIM>0 && DOPPMREDUCE)
155  // then flatten final result
156  if(whicheom==EOMSETMHD || whicheom==EOMSETRAD&&RADSHOCKFLAT) paraflatten(dir,pl,&yin[pl][0][i],shockindicator[whicheom][i],&yout[pl][0][i],&yout[pl][1][i]);
157 #endif
158 
159 
160  }
161 
162 
163 }
164 
165 
166 
167 
169 void pass_1d_line_paraline(int whichquantity, int dir, int do_weight_or_recon, int recontype, int whichreduce, int preforder, int pl, int bs, int ps, int pe, int be, int *minorder, int *maxorder, int *shift, FTYPE (*shockindicator)[NBIGM], FTYPE *stiffindicator, FTYPE (*Vline)[NBIGM], FTYPE (*Pline)[NBIGM], FTYPE (*df)[NBIGM], FTYPE (*dP)[NBIGM], FTYPE (*etai)[NBIGM], FTYPE (*monoindicator)[NBIGM], FTYPE (*yprim)[2][NBIGM], FTYPE (*ystencilvar)[NBIGM], FTYPE (*yin)[NBIGM], FTYPE (*yout)[NBIGM], FTYPE (*youtpolycoef)[NBIGM], struct of_trueijkp *trueijkp)
170 {
171 
172 
173  // assume never need this function
174  dualfprintf(fail_file,"pass_1d_line_paraline() not setup\n");
175  myexit(2896262);
176 
177 
178 }
179 
180 
181 
183 void get_limit_slopes_paraline(FTYPE *dq1l, FTYPE *dq1r, FTYPE *dq2, FTYPE *dq)
184 {
185 
186  void get_limit_slopes(int reallim, int extremum, FTYPE *dq1l, FTYPE *dq1r, FTYPE *dq2, FTYPE *dqout);
187 
188  get_limit_slopes(PARALINE2LIM, PARALINE2EXTREME, dq1l, dq1r, dq2, dq);
189 
190 }