14 0,
cons_new[0]->nComp(), refRatio(0));
19 for (
int lev=0; lev <= finest_level;lev++) {
24 static Vector<int> last_regrid_step(max_level+1, 0);
29 if (lev < max_level &&
istep[lev] > last_regrid_step[lev])
35 int old_finest = finest_level;
39 for (
int k = lev; k <= finest_level; ++k) {
40 last_regrid_step[k] =
istep[k];
44 for (
int k = old_finest+1; k <= finest_level; ++k) {
54 for (
int lev=0; lev <= finest_level;lev++)
61 amrex::Print() <<
"[Level " << lev <<
" step " <<
istep[lev]+1 <<
"] ";
62 amrex::Print() <<
"ADVANCE from time = " <<
t_old[lev] <<
" to " <<
t_new[lev]
63 <<
" with dt = " <<
dt[lev] << std::endl;
77 if (lev < finest_level)
81 cons_old[lev]->FillBoundary(geom[lev].periodicity());
82 cons_new[lev]->FillBoundary(geom[lev].periodicity());
88 xvel_old[lev]->FillBoundary(geom[lev].periodicity());
89 xvel_new[lev]->FillBoundary(geom[lev].periodicity());
92 yvel_old[lev]->FillBoundary(geom[lev].periodicity());
93 yvel_new[lev]->FillBoundary(geom[lev].periodicity());
96 zvel_old[lev]->FillBoundary(geom[lev].periodicity());
97 zvel_new[lev]->FillBoundary(geom[lev].periodicity());
105 int nfast_counter=
nfast + 1;
107 for (
int my_iif = 0; my_iif < nfast_counter; my_iif++) {
109 for (
int lev=0; lev <= finest_level; lev++)
116 if (lev < finest_level)
120 vec_ubar[lev]->FillBoundary(geom[lev].periodicity());
123 vec_vbar[lev]->FillBoundary(geom[lev].periodicity());
131 for (
int lev=0; lev <= finest_level; lev++) {
137 amrex::Print() <<
"[Level " << lev <<
" step " <<
istep[lev] <<
"] ";
138 amrex::Print() <<
"Advanced " << CountCells(lev) <<
" cells" << std::endl;
143 if (lev < finest_level)
147 cons_old[lev]->FillBoundary(geom[lev].periodicity());
148 cons_new[lev]->FillBoundary(geom[lev].periodicity());
154 xvel_old[lev]->FillBoundary(geom[lev].periodicity());
155 xvel_new[lev]->FillBoundary(geom[lev].periodicity());
158 yvel_old[lev]->FillBoundary(geom[lev].periodicity());
159 yvel_new[lev]->FillBoundary(geom[lev].periodicity());
162 zvel_old[lev]->FillBoundary(geom[lev].periodicity());
163 zvel_new[lev]->FillBoundary(geom[lev].periodicity());
175 for (
int lev=0; lev <= finest_level-1; lev++) {
int nfast
Number of fast steps to take.
void scale_rhs_vars()
Scale RHS momentum variables by 1/cell area, needed before FillPatch to different levels.
amrex::Vector< REMORAFillPatcher > FPr_v
Vector over levels of FillPatchers for v (3D)
amrex::Vector< amrex::MultiFab * > cons_new
multilevel data container for current step's scalar data: temperature, salinity, passive scalar
amrex::Vector< amrex::MultiFab * > zvel_new
multilevel data container for current step's z velocities (largely unused; W stored separately)
amrex::Vector< REMORAFillPatcher > FPr_u
Vector over levels of FillPatchers for u (3D)
amrex::Vector< amrex::MultiFab * > xvel_old
multilevel data container for last step's x velocities (u in ROMS)
amrex::Vector< amrex::MultiFab * > yvel_new
multilevel data container for current step's y velocities (v in ROMS)
int regrid_int
how often each level regrids the higher levels of refinement (after a level advances that many time s...
void advance_2d_onestep(int lev, amrex::Real dt_lev, amrex::Real dtfast_lev, int my_iif, int nfast_counter)
2D advance, one predictor/corrector step
amrex::Vector< REMORAFillPatcher > FPr_vbar
Vector over levels of FillPatchers for vbar (2D)
void AverageDownTo(int crse_lev)
more flexible version of AverageDown() that lets you average down across multiple levels
amrex::Vector< amrex::MultiFab * > zvel_old
multilevel data container for last step's z velocities (largely unused; W stored separately)
amrex::Vector< amrex::MultiFab * > xvel_new
multilevel data container for current step's x velocities (u in ROMS)
amrex::Vector< int > nsubsteps
How many substeps on each level?
void FillPatch(int lev, amrex::Real time, amrex::MultiFab &mf_to_be_filled, amrex::Vector< amrex::MultiFab * > const &mfs, const int bccomp, const int bdy_var_type=BdyVars::null, const int icomp=0, const bool fill_all=true, const bool fill_set=true, const int n_not_fill=0, const int icomp_calc=0, const amrex::Real dt=amrex::Real(0.0), const amrex::MultiFab &mf_calc=amrex::MultiFab())
Fill a new MultiFab by copying in phi from valid region and filling ghost cells.
amrex::Vector< int > istep
which step?
void advance_3d_ml(int lev, amrex::Real dt_lev)
3D advance on a single level
amrex::Vector< amrex::MultiFab * > yvel_old
multilevel data container for last step's y velocities (v in ROMS)
amrex::Vector< REMORAFillPatcher > FPr_c
Vector over levels of FillPatchers for scalars.
void scale_rhs_vars_inv()
Scale RHS momentum variables by cell area, needed after FillPatch to different levels.
amrex::Vector< REMORAFillPatcher > FPr_w
Vector over levels of FillPatchers for w.
amrex::Vector< amrex::Real > t_new
new time at each level
static SolverChoice solverChoice
Container for algorithmic choices.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_vbar
barotropic y velocity (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ubar
barotropic x velocity (2D)
amrex::Vector< amrex::MultiFab * > cons_old
multilevel data container for last step's scalar data: temperature, salinity, passive scalar
amrex::Vector< REMORAFillPatcher > FPr_ubar
Vector over levels of FillPatchers for ubar (2D)
static int fixed_ndtfast_ratio
User specified, number of barotropic steps per baroclinic step.
void timeStepML(amrex::Real time, int iteration)
advance all levels by dt, loops over finer levels
void setup_step(int lev, amrex::Real time, amrex::Real dt_lev)
Set everything up for a step on a level.
void WritePlotFile()
main driver for writing AMReX plotfiles
int cf_width
Nudging width at coarse-fine interface.
amrex::Vector< amrex::Real > t_old
old time at each level
amrex::Vector< amrex::Real > dt
time step at each level
CouplingType coupling_type