20 BL_PROFILE(
"Integrator::Integrator()");
31 pp_query(
"restart", restart_file_cell);
32 pp_query(
"restart_cell", restart_file_cell);
33 pp_query(
"restart_node", restart_file_node);
44 std::vector<std::string> ignore;
47 for (
unsigned int i = 0; i < ignore.size(); i++)
50 pp.remove(ignore[i].c_str());
80 nsubsteps.resize(maxLevel() + 1, 1);
81 int cnt = pp.countval(
"nsubsteps");
83 if (cnt == maxLevel()) {
85 nsubsteps.insert(nsubsteps.begin(), 1);
92 for (
int lev = 1; lev <= maxLevel(); ++lev) nsubsteps[lev] = nsubsteps_all;
95 Util::Abort(
INFO,
"number of nsubsteps input must equal either 1 or amr.max_level");
97 for (
int lev = 1; lev <= maxLevel(); ++lev)
98 nsubsteps[lev] = MaxRefRatio(lev - 1);
104 if (dynamictimestep.on)
138 for (
int ilev = 0; ilev < maxLevel(); ++ilev)
140 std::string strlo =
"lo" + std::to_string(ilev + 1);
141 std::string strhi =
"hi" + std::to_string(ilev + 1);
146 amrex::Vector<int> lodata, hidata;
149 amrex::IntVect lo(AMREX_D_DECL(lodata[0], lodata[1], lodata[2]));
150 amrex::IntVect hi(AMREX_D_DECL(hidata[0], hidata[1], hidata[2]));
152 explicitmesh.box.push_back(amrex::Box(lo, hi));
172 if (str ==
"RungeKutta")
180 int nlevs_max = maxLevel() + 1;
182 istep.resize(nlevs_max, 0);
184 t_new.resize(nlevs_max, 0.0);
185 t_old.resize(nlevs_max, -1.e100);
186 SetTimestep(timestep);
235 BL_PROFILE(
"Integrator::MakeNewLevelFromCoarse");
237 for (
int n = 0; n < cell.number_of_fabs; n++)
239 const int ncomp = (*cell.fab_array[n])[lev - 1]->nComp();
240 const int nghost = (*cell.fab_array[n])[lev - 1]->nGrow();
242 (*cell.fab_array[n])[lev].reset(
new amrex::MultiFab(cgrids, dm, ncomp, nghost));
244 (*cell.fab_array[n])[lev]->setVal(0.0);
246 FillCoarsePatch(lev, time, *cell.fab_array[n], *cell.physbc_array[n], 0, ncomp);
249 amrex::BoxArray ngrids = cgrids;
250 ngrids.convert(amrex::IntVect::TheNodeVector());
252 for (
int n = 0; n < node.number_of_fabs; n++)
254 const int ncomp = (*node.fab_array[n])[lev - 1]->nComp();
255 const int nghost = (*node.fab_array[n])[lev - 1]->nGrow();
257 (*node.fab_array[n])[lev].reset(
new amrex::MultiFab(ngrids, dm, ncomp, nghost));
258 (*node.fab_array[n])[lev]->setVal(0.0);
260 FillCoarsePatch(lev, time, *node.fab_array[n], *node.physbc_array[n], 0, ncomp);
263 for (
unsigned int n = 0; n < m_basefields.size(); n++)
265 m_basefields[n]->MakeNewLevelFromCoarse(lev, time, cgrids, dm);
267 for (
unsigned int n = 0; n < m_basefields_cell.size(); n++)
269 m_basefields_cell[n]->MakeNewLevelFromCoarse(lev, time, cgrids, dm);
284 const amrex::BoxArray &cgrids,
285 const amrex::DistributionMapping &dm
288 BL_PROFILE(
"Integrator::RemakeLevel");
289 for (
int n = 0; n < cell.number_of_fabs; n++)
291 const int ncomp = (*cell.fab_array[n])[lev]->nComp();
292 const int nghost = (*cell.fab_array[n])[lev]->nGrow();
294 amrex::MultiFab new_state(cgrids, dm, ncomp, nghost);
296 new_state.setVal(0.0);
297 FillPatch(lev, time, *cell.fab_array[n], new_state, *cell.physbc_array[n], 0);
298 std::swap(new_state, *(*cell.fab_array[n])[lev]);
301 amrex::BoxArray ngrids = cgrids;
302 ngrids.convert(amrex::IntVect::TheNodeVector());
304 for (
int n = 0; n < node.number_of_fabs; n++)
306 const int ncomp = (*node.fab_array[n])[lev]->nComp();
307 const int nghost = (*node.fab_array[n])[lev]->nGrow();
309 amrex::MultiFab new_state(ngrids, dm, ncomp, nghost);
311 new_state.setVal(0.0);
312 FillPatch(lev, time, *node.fab_array[n], new_state, *node.physbc_array[n], 0);
313 std::swap(new_state, *(*node.fab_array[n])[lev]);
316 for (
unsigned int n = 0; n < m_basefields_cell.size(); n++)
318 m_basefields_cell[n]->RemakeLevel(lev, time, cgrids, dm);
320 for (
unsigned int n = 0; n < m_basefields.size(); n++)
322 m_basefields[n]->RemakeLevel(lev, time, cgrids, dm);
543 BL_PROFILE(
"Integrator::Restart");
545 if (a_nodal && node.fab_array.size() == 0)
550 if (!a_nodal && cell.fab_array.size() == 0)
556 std::string filename = dirname +
"/Header";
557 std::string chkptfilename = dirname +
"/Checkpoint";
558 amrex::VisMF::IO_Buffer io_buffer(amrex::VisMF::GetIOBufferSize());
559 amrex::Vector<char> fileCharPtr, chkptfileCharPtr;
560 amrex::ParallelDescriptor::ReadAndBcastFile(filename, fileCharPtr);
561 amrex::ParallelDescriptor::ReadAndBcastFile(chkptfilename, chkptfileCharPtr);
562 std::string fileCharPtrString(fileCharPtr.dataPtr());
563 std::string chkptfileCharPtrString(chkptfileCharPtr.dataPtr());
564 std::istringstream is(fileCharPtrString, std::istringstream::in);
565 std::istringstream chkpt_is(chkptfileCharPtrString, std::istringstream::in);
567 std::string line, word;
570 std::getline(is, line);
575 std::getline(is, line); tmp_numfabs = std::stoi(line);
577 std::vector<std::string> tmp_name_array;
579 for (
int i = 0; i < tmp_numfabs; i++)
581 std::getline(is, line);
582 tmp_name_array.push_back(line);
586 std::getline(is, line);
591 std::getline(is, line); tmp_time = std::stof(line);
Util::Message(
INFO,
"Current time: ", tmp_time);
592 for (
int i = 0; i < max_level + 1; i++)
594 t_new[i] = tmp_time; t_old[i] = tmp_time;
599 std::getline(is, line); tmp_max_level = std::stoi(line);
Util::Message(
INFO,
"Max AMR level: ", line);
600 if (tmp_max_level > max_level)
601 Util::Abort(
INFO,
"The max level specified (", max_level,
") is smaller than the finest level in the restart file (", tmp_max_level,
")");
602 finest_level = tmp_max_level;
614 std::getline(is, line);
616 if (tmp_iters.size() != (
unsigned int)(finest_level + 1))
Util::Abort(
INFO,
"Error reading in interation counts: line = ", line);
617 for (
int lev = 0; lev <= finest_level; lev++) { istep[lev] = std::stoi(tmp_iters[lev]);
Util::Message(
INFO,
"Iter on level ", lev,
" = ", istep[lev]); }
619 amrex::Vector<amrex::MultiFab> tmpdata(tmp_max_level + 1);
624 for (
unsigned int i = 0; i < node.fab_array.size(); i++)
625 if (node.writeout_array[i])
626 total_ncomp += node.ncomp_array[i];
630 for (
unsigned int i = 0; i < cell.fab_array.size(); i++)
631 if (cell.writeout_array[i])
632 total_ncomp += cell.ncomp_array[i];
635 int total_nghost = a_nodal ? 0 : cell.nghost_array[0];
637 for (
int lev = 0; lev <= finest_level; lev++)
639 amrex::BoxArray tmp_ba;
640 tmp_ba.readFrom(chkpt_is);
641 SetBoxArray(lev, tmp_ba);
642 amrex::DistributionMapping tmp_dm(tmp_ba, amrex::ParallelDescriptor::NProcs());
643 SetDistributionMap(lev, tmp_dm);
647 amrex::BoxArray ngrids = grids[lev];
648 ngrids.convert(amrex::IntVect::TheNodeVector());
659 Util::Message(
INFO,amrex::MultiFabFileFullPrefix(lev, dirname,
"Level_",
"Cell"));
662 amrex::VisMF::Read(tmpdata[lev],
663 amrex::MultiFabFileFullPrefix(lev, dirname,
"Level_",
"Cell"));
666 for (
int i = 0; i < node.number_of_fabs; i++)
668 amrex::BoxArray ngrids = grids[lev];
669 ngrids.convert(amrex::IntVect::TheNodeVector());
670 (*node.fab_array[i])[lev].reset(
new amrex::MultiFab(ngrids, dmap[lev], node.ncomp_array[i], node.nghost_array[i]));
671 (*node.fab_array[i])[lev]->setVal(0.);
674 for (
int i = 0; i < cell.number_of_fabs; i++)
675 (*cell.fab_array[i])[lev].reset(
new amrex::MultiFab(grids[lev], dmap[lev], cell.ncomp_array[i], cell.nghost_array[i]));
676 for (
int i = 0; i < tmp_numfabs; i++)
681 for (
int j = 0; j < node.number_of_fabs; j++)
683 if (tmp_name_array[i] == node.name_array[i][j])
686 Util::Message(
INFO,
"Initializing ", node.name_array[i][j],
"; nghost=", node.nghost_array[j],
" with ", tmp_name_array[i]);
687 amrex::MultiFab::Copy(*((*node.fab_array[j])[lev]).get(), tmpdata[lev], i, 0, 1, total_nghost);
689 for (
int k = 0; k < node.ncomp_array[j]; k++)
691 if (tmp_name_array[i] == node.name_array[j][k])
694 Util::Message(
INFO,
"Initializing ", node.name_array[j][k],
"; ncomp=", node.ncomp_array[j],
"; nghost=", node.nghost_array[j],
" with ", tmp_name_array[i]);
695 amrex::MultiFab::Copy(*((*node.fab_array[j])[lev]).get(), tmpdata[lev], i, k, 1, total_nghost);
703 for (
int j = 0; j < cell.number_of_fabs; j++)
705 for (
int k = 0; k < cell.ncomp_array[j]; k++)
707 if (tmp_name_array[i] == cell.name_array[j][k])
710 Util::Message(
INFO,
"Initializing ", cell.name_array[j][k],
"; ncomp=", cell.ncomp_array[j],
"; nghost=", cell.nghost_array[j],
" with ", tmp_name_array[i]);
711 amrex::MultiFab::Copy(*((*cell.fab_array[j])[lev]).get(), tmpdata[lev], i, k, 1, 0 );
717 if (!match)
Util::Warning(
INFO,
"Fab ", tmp_name_array[i],
" is in the restart file, but there is no fab with that name here.");
720 for (
unsigned int n = 0; n < m_basefields_cell.size(); n++)
722 m_basefields_cell[n]->MakeNewLevelFromScratch(lev, t_new[lev], grids[lev], dmap[lev]);
724 for (
unsigned int n = 0; n < m_basefields.size(); n++)
726 m_basefields[n]->MakeNewLevelFromScratch(lev, t_new[lev], grids[lev], dmap[lev]);
730 for (
int n = 0; n < cell.number_of_fabs; n++)
732 if (cell.writeout_array[n])
733 FillPatch(lev, t_new[lev], *cell.fab_array[n], *(*cell.fab_array[n])[lev], *cell.physbc_array[n], 0);
738 SetFinestLevel(max_level);
825 BL_PROFILE(
"Integrator::WritePlotFile");
826 int nlevels = finest_level + 1;
827 if (max_plot_level >= 0) nlevels = std::min(nlevels, max_plot_level);
829 int ccomponents = 0, ncomponents = 0, bfcomponents_cell = 0, bfcomponents = 0;
830 amrex::Vector<std::string> cnames, nnames, bfnames_cell, bfnames;
831 for (
int i = 0; i < cell.number_of_fabs; i++)
833 if (!cell.writeout_array[i])
continue;
834 ccomponents += cell.ncomp_array[i];
835 if (cell.ncomp_array[i] > 1)
836 for (
int j = 0; j < cell.ncomp_array[i]; j++)
837 cnames.push_back(cell.name_array[i][j]);
839 cnames.push_back(cell.name_array[i][0]);
841 for (
int i = 0; i < node.number_of_fabs; i++)
843 if (!node.writeout_array[i])
continue;
844 ncomponents += node.ncomp_array[i];
845 if (node.ncomp_array[i] > 1)
846 for (
int j = 0; j < node.ncomp_array[i]; j++)
847 nnames.push_back(node.name_array[i][j]);
849 nnames.push_back(node.name_array[i][0]);
851 for (
unsigned int i = 0; i < m_basefields_cell.size(); i++)
853 if (m_basefields_cell[i]->writeout)
855 bfcomponents_cell += m_basefields_cell[i]->NComp();
856 for (
int j = 0; j < m_basefields_cell[i]->NComp(); j++)
857 bfnames_cell.push_back(m_basefields_cell[i]->Name(j));
860 for (
unsigned int i = 0; i < m_basefields.size(); i++)
862 if (m_basefields[i]->writeout)
864 bfcomponents += m_basefields[i]->NComp();
865 for (
int j = 0; j < m_basefields[i]->NComp(); j++)
866 bfnames.push_back(m_basefields[i]->Name(j));
870 amrex::Vector<amrex::MultiFab> cplotmf(nlevels), nplotmf(nlevels);
872 bool do_cell_plotfile = (ccomponents + bfcomponents_cell > 0 || (ncomponents + bfcomponents > 0 && cell.all)) && cell.any;
873 bool do_node_plotfile = (ncomponents + bfcomponents > 0 || (ccomponents + bfcomponents_cell > 0 && node.all)) && node.any;
875 for (
int ilev = 0; ilev < nlevels; ++ilev)
877 if (do_cell_plotfile)
879 int ncomp = ccomponents + bfcomponents_cell;
880 if (cell.all) ncomp += ncomponents + bfcomponents;
881 cplotmf[ilev].define(grids[ilev], dmap[ilev], ncomp, 0);
885 for (
int i = 0; i < cell.number_of_fabs; i++)
887 if (!cell.writeout_array[i])
continue;
888 if ((*cell.fab_array[i])[ilev]->contains_nan())
890 if (abort_on_nan)
Util::Abort(
INFO, cnames[cnames_cnt],
" contains nan (i=", i,
")");
893 if ((*cell.fab_array[i])[ilev]->contains_inf())
895 if (abort_on_nan)
Util::Abort(
INFO, cnames[cnames_cnt],
" contains inf (i=", i,
")");
899 amrex::MultiFab::Copy(cplotmf[ilev], *(*cell.fab_array[i])[ilev], 0, n, cell.ncomp_array[i], 0);
900 n += cell.ncomp_array[i];
902 for (
unsigned int i = 0; i < m_basefields_cell.size(); i++)
904 if (m_basefields_cell[i]->writeout)
906 m_basefields_cell[i]->Copy(ilev, cplotmf[ilev], n, 0);
907 n += m_basefields_cell[i]->NComp();
914 for (
int i = 0; i < node.number_of_fabs; i++)
916 if (!node.writeout_array[i])
continue;
917 if ((*node.fab_array[i])[ilev]->contains_nan())
919 if (abort_on_nan)
Util::Abort(
INFO, nnames[nnames_cnt],
" contains nan (i=", i,
")");
922 if ((*node.fab_array[i])[ilev]->contains_inf())
924 if (abort_on_nan)
Util::Abort(
INFO, nnames[nnames_cnt],
" contains inf (i=", i,
")");
928 amrex::average_node_to_cellcenter(cplotmf[ilev], n, *(*node.fab_array[i])[ilev], 0, node.ncomp_array[i], 0);
929 n += node.ncomp_array[i];
931 if (bfcomponents > 0)
933 amrex::BoxArray ngrids = grids[ilev];
934 ngrids.convert(amrex::IntVect::TheNodeVector());
935 amrex::MultiFab bfplotmf(ngrids, dmap[ilev], bfcomponents, 0);
937 for (
unsigned int i = 0; i < m_basefields.size(); i++)
939 if (m_basefields[i]->writeout)
941 m_basefields[i]->Copy(ilev, bfplotmf, ctr, 0);
942 ctr += m_basefields[i]->NComp();
945 amrex::average_node_to_cellcenter(cplotmf[ilev], n, bfplotmf, 0, bfcomponents);
951 if (do_node_plotfile)
953 amrex::BoxArray ngrids = grids[ilev];
954 ngrids.convert(amrex::IntVect::TheNodeVector());
955 int ncomp = ncomponents + bfcomponents;
956 if (node.all) ncomp += ccomponents + bfcomponents_cell;
957 nplotmf[ilev].define(ngrids, dmap[ilev], ncomp, 0);
960 for (
int i = 0; i < node.number_of_fabs; i++)
962 if (!node.writeout_array[i])
continue;
963 if ((*node.fab_array[i])[ilev]->contains_nan())
Util::Warning(
INFO, nnames[i],
" contains nan (i=", i,
"). Resetting to zero.");
964 if ((*node.fab_array[i])[ilev]->contains_inf())
Util::Abort(
INFO, nnames[i],
" contains inf (i=", i,
")");
965 amrex::MultiFab::Copy(nplotmf[ilev], *(*node.fab_array[i])[ilev], 0, n, node.ncomp_array[i], 0);
966 n += node.ncomp_array[i];
968 for (
unsigned int i = 0; i < m_basefields.size(); i++)
970 if (m_basefields[i]->writeout)
972 m_basefields[i]->Copy(ilev, nplotmf[ilev], n, 0);
973 n += m_basefields[i]->NComp();
979 for (
int i = 0; i < cell.number_of_fabs; i++)
981 if (!cell.writeout_array[i])
continue;
982 if ((*cell.fab_array[i])[ilev]->contains_nan())
Util::Warning(
INFO, cnames[i],
" contains nan (i=", i,
"). Resetting to zero.");
983 if ((*cell.fab_array[i])[ilev]->contains_inf())
Util::Abort(
INFO, cnames[i],
" contains inf (i=", i,
")");
984 if ((*cell.fab_array[i])[ilev]->nGrow() == 0)
986 if (initial)
Util::Warning(
INFO, cnames[i],
" has no ghost cells and will not be included in nodal output");
990 n += cell.ncomp_array[i];
993 if (bfcomponents_cell > 0)
995 amrex::BoxArray cgrids = grids[ilev];
996 amrex::MultiFab bfplotmf(cgrids, dmap[ilev], bfcomponents_cell, 0);
998 for (
unsigned int i = 0; i < m_basefields_cell.size(); i++)
1000 if (m_basefields_cell[i]->writeout)
1002 m_basefields_cell[i]->Copy(ilev, bfplotmf, ctr, 0);
1003 ctr += m_basefields_cell[i]->NComp();
1007 n += bfcomponents_cell;
1013 std::vector<std::string> plotfilename = PlotFileName(istep[0], prefix);
1014 if (initial) plotfilename[1] = plotfilename[1] +
"init";
1016 if (do_cell_plotfile)
1018 amrex::Vector<std::string> allnames = cnames;
1019 allnames.insert(allnames.end(), bfnames_cell.begin(), bfnames_cell.end());
1021 allnames.insert(allnames.end(), nnames.begin(), nnames.end());
1022 allnames.insert(allnames.end(), bfnames.begin(), bfnames.end());
1024 WriteMultiLevelPlotfile(plotfilename[0] + plotfilename[1] +
"cell", nlevels, amrex::GetVecOfConstPtrs(cplotmf), allnames,
1025 Geom(), time, iter, refRatio());
1027 std::ofstream chkptfile;
1028 chkptfile.open(plotfilename[0] + plotfilename[1] +
"cell/Checkpoint");
1029 for (
int i = 0; i <= max_level; i++) boxArray(i).writeOn(chkptfile);
1033 if (do_node_plotfile)
1035 amrex::Vector<std::string> allnames = nnames;
1036 allnames.insert(allnames.end(), bfnames.begin(), bfnames.end());
1037 if (node.all) allnames.insert(allnames.end(), cnames.begin(), cnames.end());
1038 WriteMultiLevelPlotfile(plotfilename[0] + plotfilename[1] +
"node", nlevels, amrex::GetVecOfConstPtrs(nplotmf), allnames,
1039 Geom(), time, iter, refRatio());
1041 std::ofstream chkptfile;
1042 chkptfile.open(plotfilename[0] + plotfilename[1] +
"node/Checkpoint");
1043 for (
int i = 0; i <= max_level; i++) boxArray(i).writeOn(chkptfile);
1047 if (amrex::ParallelDescriptor::IOProcessor())
1049 std::ofstream coutfile, noutfile;
1052 if (do_cell_plotfile) coutfile.open(plot_file +
"/celloutput.visit", std::ios_base::out);
1053 if (do_node_plotfile) noutfile.open(plot_file +
"/nodeoutput.visit", std::ios_base::out);
1057 if (do_cell_plotfile) coutfile.open(plot_file +
"/celloutput.visit", std::ios_base::app);
1058 if (do_node_plotfile) noutfile.open(plot_file +
"/nodeoutput.visit", std::ios_base::app);
1060 if (do_cell_plotfile) coutfile << plotfilename[1] +
"cell" +
"/Header" << std::endl;
1061 if (do_node_plotfile) noutfile << plotfilename[1] +
"node" +
"/Header" << std::endl;
1119 BL_PROFILE(
"Integrator::IntegrateVariables");
1120 if (!thermo.number)
return;
1122 if ((thermo.interval > 0 && (step) % thermo.interval == 0) ||
1123 ((thermo.dt > 0.0) && (std::fabs(std::remainder(time, plot_dt)) < 0.5 * dt[0])))
1126 for (
int i = 0; i < thermo.number; i++)
1128 if (thermo.extensives[i]) *thermo.vars[i] = 0;
1132 for (
int ilev = 0; ilev < max_level; ilev++)
1134 const amrex::BoxArray& cfba = amrex::coarsen(grids[ilev + 1], refRatio(ilev));
1139 for (amrex::MFIter mfi(grids[ilev], dmap[ilev],
true); mfi.isValid(); ++mfi)
1141 const amrex::Box& box = mfi.tilebox();
1142 const amrex::BoxArray& comp = amrex::complementIn(box, cfba);
1144 for (
int i = 0; i < comp.size(); i++)
1146 Integrate(ilev, time, step,
1156 for (amrex::MFIter mfi(grids[max_level], dmap[max_level],
true); mfi.isValid(); ++mfi)
1158 const amrex::Box& box = mfi.tilebox();
1159 Integrate(max_level, time, step, mfi, box);
1164 for (
int i = 0; i < thermo.number; i++)
1166 if (thermo.extensives[i])
1167 amrex::ParallelDescriptor::ReduceRealSum(*thermo.vars[i]);
1170 if (amrex::ParallelDescriptor::IOProcessor() &&
1172 (thermo.plot_int > 0 && step % thermo.plot_int == 0) ||
1173 (thermo.plot_dt > 0.0 && std::fabs(std::remainder(time, thermo.plot_dt)) < 0.5 * dt[0])
1176 std::ofstream outfile;
1179 outfile.open(plot_file +
"/thermo.dat", std::ios_base::out);
1181 for (
int i = 0; i < thermo.number; i++)
1182 outfile <<
"\t" << thermo.names[i];
1183 outfile << std::endl;
1185 else outfile.open(plot_file +
"/thermo.dat", std::ios_base::app);
1187 for (
int i = 0; i < thermo.number; i++)
1188 outfile <<
"\t" << *thermo.vars[i];
1189 outfile << std::endl;
1199 BL_PROFILE(
"Integrator::TimeStep");
1200 if (base_regrid_int <= 0 || istep[0] % base_regrid_int == 0)
1202 if (regrid_int > 0 || base_regrid_int > 0)
1204 static amrex::Vector<int> last_regrid_step(max_level + 1, 0);
1207 if (lev < max_level && istep[lev] > last_regrid_step[lev])
1209 if (istep[lev] % regrid_int == 0)
1211 regrid(lev, time,
false);
1216 SetFinestLevel(finest_level);
1218 if (Verbose() && amrex::ParallelDescriptor::IOProcessor()) {
1219 std::cout <<
"[Level " << lev
1220 <<
" step " << istep[lev] + 1 <<
"] ";
1221 std::cout <<
"ADVANCE with dt = "
1226 for (
int n = 0; n < cell.number_of_fabs; n++)
1227 if (cell.evolving_array[n]) FillPatch(lev, time, *cell.fab_array[n], *(*cell.fab_array[n])[lev], *cell.physbc_array[n], 0);
1228 for (
int n = 0; n < node.number_of_fabs; n++)
1229 if (node.evolving_array[n]) FillPatch(lev, time, *node.fab_array[n], *(*node.fab_array[n])[lev], *node.physbc_array[n], 0);
1230 for (
unsigned int n = 0; n < m_basefields_cell.size(); n++)
1231 if (m_basefields_cell[n]->evolving) m_basefields_cell[n]->FillPatch(lev, time);
1232 for (
unsigned int n = 0; n < m_basefields.size(); n++)
1233 if (m_basefields[n]->evolving) m_basefields[n]->FillPatch(lev, time);
1235 Advance(lev, time, dt[lev]);
1238 if (Verbose() && amrex::ParallelDescriptor::IOProcessor())
1240 std::cout <<
"[Level " << lev
1241 <<
" step " << istep[lev] <<
"] ";
1242 std::cout <<
"Advanced "
1248 if (lev < finest_level)
1250 for (
int i = 1; i <= nsubsteps[lev + 1]; ++i)
1251 TimeStep(lev + 1, time + (i - 1) * dt[lev + 1], i);
1253 for (
int n = 0; n < cell.number_of_fabs; n++)
1255 amrex::average_down(*(*cell.fab_array[n])[lev + 1], *(*cell.fab_array[n])[lev],
1256 geom[lev + 1], geom[lev],
1257 0, (*cell.fab_array[n])[lev]->nComp(), refRatio(lev));
1259 for (
int n = 0; n < node.number_of_fabs; n++)
1261 amrex::average_down(*(*node.fab_array[n])[lev + 1], *(*node.fab_array[n])[lev],
1262 0, (*node.fab_array[n])[lev]->nComp(), refRatio(lev));
1264 for (
unsigned int n = 0; n < m_basefields_cell.size(); n++)
1266 if (m_basefields_cell[n]->evolving)
1267 m_basefields_cell[n]->AverageDown(lev, refRatio(lev));
1269 for (
unsigned int n = 0; n < m_basefields.size(); n++)
1271 if (m_basefields[n]->evolving)
1272 m_basefields[n]->AverageDown(lev, refRatio(lev));