5 #include "PatchPluto.H"
9 void PatchPluto::advanceStep(FArrayBox& a_U,
11 const FArrayBox& a_dV,
12 FArrayBox& split_tags,
13 BaseFab<unsigned char>& a_Flags,
25 CH_assert(isDefined());
26 CH_assert(UBox == m_currentBox);
29 int nxf, nyf, nzf, indf;
34 double *inv_dl, dl2, cylr;
36 #ifdef SKIP_SPLIT_CELLS
39 #if (PARABOLIC_FLUX & EXPLICIT)
40 static double **dcoeff;
47 #if TIME_STEPPING == RK2
59 print (
"! advanceStep(): need to re-allocate matrix\n");
67 #if GEOMETRY != CARTESIAN
68 for (nv = 0; nv <
NVAR; nv++) a_U.divide(a_dV,0,nv);
69 #if CHOMBO_CONS_AM == YES
70 #if ROTATING_FRAME == YES
71 Box curBox = a_U.box();
72 for(BoxIterator bit(curBox); bit.ok(); ++bit) {
73 const IntVect& iv = bit();
74 a_U(iv,
iMPHI) /= a_dV(iv,1);
78 a_U.divide(a_dV,1,
iMPHI);
82 if (g_stretch_fact != 1.) a_U /= g_stretch_fact;
85 for (nv = 0; nv <
NVAR; nv++){
88 #ifdef SKIP_SPLIT_CELLS
90 split_tags.dataPtr(0));
92 #if (TIME_STEPPING == RK2)
103 if (state.
flux == NULL){
111 #if (TIME_STEPPING != RK2)
114 #if (PARABOLIC_FLUX & EXPLICIT)
121 getPrimitiveVars (UU, &d, grid);
122 #if (SHOCK_FLATTENING == MULTID) || ENTROPY_SWITCH
126 #ifdef SKIP_SPLIT_CELLS
138 #if (TIME_STEPPING == RK2)
146 int numFlux = numFluxes();
147 a_F.resize(UBox,numFlux);
150 static double *aflux[3];
151 for (in = 0; in <
DIMENSIONS; in++) aflux[in] = a_F[in].dataPtr(0);
164 #if (TIME_STEPPING == RK2)
175 double dtdx =
g_dt/g_coeff_dl_min/m_dx;
187 #if (TIME_STEPPING == RK2)
213 #if GEOMETRY != CARTESIAN
214 #if CHOMBO_CONS_AM == YES
215 #if ROTATING_FRAME == YES
216 for(BoxIterator bit(curBox); bit.ok(); ++bit) {
217 const IntVect& iv = bit();
219 a_U(iv,
iMPHI) *= a_dV(iv,1);
222 a_U.mult(a_dV,1,
iMPHI);
225 for (nv = 0; nv <
NVAR; nv++) a_U.mult(a_dV,0,nv);
227 if (g_stretch_fact != 1.) a_U *= g_stretch_fact;
236 #ifdef SKIP_SPLIT_CELLS
240 #if (TIME_STEPPING == RK2)
double **** J
Electric current defined as curl(B).
double ** flux
upwind flux computed with the Riemann solver
void Riemann_Solver(const State_1D *, int, int, double *, Grid *)
void PrimToCons3D(Data_Arr V, Data_Arr U, RBox *box)
long int NX2_TOT
Total number of zones in the X2 direction (boundaries included) for the local processor.
int g_intStage
Gives the current integration stage of the time stepping method (predictor = 0, 1st corrector = 1...
double **** Vc
The main four-index data array used for cell-centered primitive variables.
double g_dt
The current integration time step.
#define DOM
Computational domain (interior)
#define ARRAY_3D(nx, ny, nz, type)
void FreeArrayMap(double ***t)
unsigned char *** flag
Pointer to a 3D array setting useful integration flags that are retrieved during integration.
void ConsToPrim3D(Data_Arr U, Data_Arr V, unsigned char ***flag, RBox *box)
void MakeState(State_1D *)
#define FLAG_SPLIT_CELL
Zone is covered by a finer level (AMR only).
double inv_dta
Inverse of advection (hyperbolic) time step, .
#define TOT_LOOP(k, j, i)
unsigned char *** ArrayCharMap(int nx, int ny, int nz, unsigned char *uptr)
void FreeArrayCharMap(unsigned char ***t)
long int NX3_TOT
Total number of zones in the X3 direction (boundaries included) for the local processor.
#define ARRAY_4D(nx, ny, nz, nv, type)
long int IEND
Upper grid index of the computational domain in the the X1 direction for the local processor...
void print(const char *fmt,...)
D_EXPAND(tot/[n]=(double) grid[IDIR].np_int_glob;, tot/[n]=(double) grid[JDIR].np_int_glob;, tot/[n]=(double) grid[KDIR].np_int_glob;)
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
void SplitSource(const Data *, double, Time_Step *, Grid *)
void UpdateStage(const Data *, Data_Arr, double **, Riemann_Solver *, double, Time_Step *, Grid *)
double *** ArrayBoxMap(int nrl, int nrh, int ncl, int nch, int ndl, int ndh, double *uptr)
void FreeArrayBoxMap(double ***t, int nrl, int nrh, int ncl, int nch, int ndl, int ndh)
long int KBEG
Lower grid index of the computational domain in the the X3 direction for the local processor...
#define ARRAY_2D(nx, ny, type)
void FlagShock(const Data *, Grid *)
long int KEND
Upper grid index of the computational domain in the the X3 direction for the local processor...
long int JBEG
Lower grid index of the computational domain in the the X2 direction for the local processor...
#define QUIT_PLUTO(e_code)
void GLM_Source(const Data_Arr Q, double dt, Grid *grid)
long int JEND
Upper grid index of the computational domain in the the X2 direction for the local processor...
long int NX1_TOT
Total number of zones in the X1 direction (boundaries included) for the local processor.
long int IBEG
Lower grid index of the computational domain in the the X1 direction for the local processor...
double *** ArrayMap(int nx, int ny, int nz, double *uptr)