19 BL_PROFILE(
"Integrator::Integrator()");
27 pp_query(
"restart", restart_file_cell);
28 pp_query(
"restart_cell", restart_file_cell);
29 pp_query(
"restart_node", restart_file_node);
39 std::vector<std::string> ignore;
42 for (
unsigned int i = 0; i < ignore.size(); i++)
45 pp.remove(ignore[i].c_str());
75 nsubsteps.resize(maxLevel() + 1, 1);
76 int cnt = pp.countval(
"nsubsteps");
78 if (cnt == maxLevel()) {
80 nsubsteps.insert(nsubsteps.begin(), 1);
87 for (
int lev = 1; lev <= maxLevel(); ++lev) nsubsteps[lev] = nsubsteps_all;
90 Util::Abort(
INFO,
"number of nsubsteps input must equal either 1 or amr.max_level");
92 for (
int lev = 1; lev <= maxLevel(); ++lev)
93 nsubsteps[lev] = MaxRefRatio(lev - 1);
99 if (dynamictimestep.on)
133 for (
int ilev = 0; ilev < maxLevel(); ++ilev)
135 std::string strlo =
"lo" + std::to_string(ilev + 1);
136 std::string strhi =
"hi" + std::to_string(ilev + 1);
141 amrex::Vector<int> lodata, hidata;
144 amrex::IntVect lo(AMREX_D_DECL(lodata[0], lodata[1], lodata[2]));
145 amrex::IntVect hi(AMREX_D_DECL(hidata[0], hidata[1], hidata[2]));
147 explicitmesh.box.push_back(amrex::Box(lo, hi));
152 int nlevs_max = maxLevel() + 1;
154 istep.resize(nlevs_max, 0);
156 t_new.resize(nlevs_max, 0.0);
157 t_old.resize(nlevs_max, -1.e100);
158 SetTimestep(timestep);
207 BL_PROFILE(
"Integrator::MakeNewLevelFromCoarse");
209 for (
int n = 0; n < cell.number_of_fabs; n++)
211 const int ncomp = (*cell.fab_array[n])[lev - 1]->nComp();
212 const int nghost = (*cell.fab_array[n])[lev - 1]->nGrow();
214 (*cell.fab_array[n])[lev].reset(
new amrex::MultiFab(cgrids, dm, ncomp, nghost));
216 (*cell.fab_array[n])[lev]->setVal(0.0);
218 FillCoarsePatch(lev, time, *cell.fab_array[n], *cell.physbc_array[n], 0, ncomp);
221 amrex::BoxArray ngrids = cgrids;
222 ngrids.convert(amrex::IntVect::TheNodeVector());
224 for (
int n = 0; n < node.number_of_fabs; n++)
226 const int ncomp = (*node.fab_array[n])[lev - 1]->nComp();
227 const int nghost = (*node.fab_array[n])[lev - 1]->nGrow();
229 (*node.fab_array[n])[lev].reset(
new amrex::MultiFab(ngrids, dm, ncomp, nghost));
230 (*node.fab_array[n])[lev]->setVal(0.0);
232 FillCoarsePatch(lev, time, *node.fab_array[n], *node.physbc_array[n], 0, ncomp);
235 for (
unsigned int n = 0; n < m_basefields.size(); n++)
237 m_basefields[n]->MakeNewLevelFromCoarse(lev, time, cgrids, dm);
239 for (
unsigned int n = 0; n < m_basefields_cell.size(); n++)
241 m_basefields_cell[n]->MakeNewLevelFromCoarse(lev, time, cgrids, dm);
256 const amrex::BoxArray &cgrids,
257 const amrex::DistributionMapping &dm
260 BL_PROFILE(
"Integrator::RemakeLevel");
261 for (
int n = 0; n < cell.number_of_fabs; n++)
263 const int ncomp = (*cell.fab_array[n])[lev]->nComp();
264 const int nghost = (*cell.fab_array[n])[lev]->nGrow();
266 amrex::MultiFab new_state(cgrids, dm, ncomp, nghost);
268 new_state.setVal(0.0);
269 FillPatch(lev, time, *cell.fab_array[n], new_state, *cell.physbc_array[n], 0);
270 std::swap(new_state, *(*cell.fab_array[n])[lev]);
273 amrex::BoxArray ngrids = cgrids;
274 ngrids.convert(amrex::IntVect::TheNodeVector());
276 for (
int n = 0; n < node.number_of_fabs; n++)
278 const int ncomp = (*node.fab_array[n])[lev]->nComp();
279 const int nghost = (*node.fab_array[n])[lev]->nGrow();
281 amrex::MultiFab new_state(ngrids, dm, ncomp, nghost);
283 new_state.setVal(0.0);
284 FillPatch(lev, time, *node.fab_array[n], new_state, *node.physbc_array[n], 0);
285 std::swap(new_state, *(*node.fab_array[n])[lev]);
288 for (
unsigned int n = 0; n < m_basefields_cell.size(); n++)
290 m_basefields_cell[n]->RemakeLevel(lev, time, cgrids, dm);
292 for (
unsigned int n = 0; n < m_basefields.size(); n++)
294 m_basefields[n]->RemakeLevel(lev, time, cgrids, dm);
515 BL_PROFILE(
"Integrator::Restart");
517 if (a_nodal && node.fab_array.size() == 0)
522 if (!a_nodal && cell.fab_array.size() == 0)
528 std::string filename = dirname +
"/Header";
529 std::string chkptfilename = dirname +
"/Checkpoint";
530 amrex::VisMF::IO_Buffer io_buffer(amrex::VisMF::GetIOBufferSize());
531 amrex::Vector<char> fileCharPtr, chkptfileCharPtr;
532 amrex::ParallelDescriptor::ReadAndBcastFile(filename, fileCharPtr);
533 amrex::ParallelDescriptor::ReadAndBcastFile(chkptfilename, chkptfileCharPtr);
534 std::string fileCharPtrString(fileCharPtr.dataPtr());
535 std::string chkptfileCharPtrString(chkptfileCharPtr.dataPtr());
536 std::istringstream is(fileCharPtrString, std::istringstream::in);
537 std::istringstream chkpt_is(chkptfileCharPtrString, std::istringstream::in);
539 std::string line, word;
542 std::getline(is, line);
547 std::getline(is, line); tmp_numfabs = std::stoi(line);
549 std::vector<std::string> tmp_name_array;
551 for (
int i = 0; i < tmp_numfabs; i++)
553 std::getline(is, line);
554 tmp_name_array.push_back(line);
558 std::getline(is, line);
563 std::getline(is, line); tmp_time = std::stof(line);
Util::Message(
INFO,
"Current time: ", tmp_time);
564 for (
int i = 0; i < max_level + 1; i++)
566 t_new[i] = tmp_time; t_old[i] = tmp_time;
571 std::getline(is, line); tmp_max_level = std::stoi(line);
Util::Message(
INFO,
"Max AMR level: ", line);
572 if (tmp_max_level != max_level)
573 Util::Abort(
INFO,
"The max level specified (", max_level,
") does not match the max level in the restart file (", tmp_max_level,
")");
574 finest_level = tmp_max_level;
586 std::getline(is, line);
588 if (tmp_iters.size() != (
unsigned int)(max_level + 1))
Util::Abort(
INFO,
"Error reading in interation counts: line = ", line);
589 for (
int lev = 0; lev <= max_level; lev++) { istep[lev] = std::stoi(tmp_iters[lev]);
Util::Message(
INFO,
"Iter on level ", lev,
" = ", istep[lev]); }
591 amrex::Vector<amrex::MultiFab> tmpdata(tmp_max_level + 1);
594 if (a_nodal)
for (
unsigned int i = 0; i < node.fab_array.size(); i++) total_ncomp += node.ncomp_array[i];
595 else for (
unsigned int i = 0; i < cell.fab_array.size(); i++) total_ncomp += cell.ncomp_array[i];
597 int total_nghost = a_nodal ? 0 : cell.nghost_array[0];
599 for (
int lev = 0; lev <= max_level; lev++)
601 amrex::BoxArray tmp_ba;
602 tmp_ba.readFrom(chkpt_is);
603 SetBoxArray(lev, tmp_ba);
604 amrex::DistributionMapping tmp_dm(tmp_ba, amrex::ParallelDescriptor::NProcs());
605 SetDistributionMap(lev, tmp_dm);
609 amrex::BoxArray ngrids = grids[lev];
610 ngrids.convert(amrex::IntVect::TheNodeVector());
611 tmpdata[lev].define(ngrids, dmap[lev], total_ncomp, total_nghost);
615 tmpdata[lev].define(grids[lev], dmap[lev], total_ncomp, total_nghost);
617 amrex::VisMF::Read(tmpdata[lev],
618 amrex::MultiFabFileFullPrefix(lev, dirname,
"Level_",
"Cell"));
622 for (
int i = 0; i < node.number_of_fabs; i++)
624 amrex::BoxArray ngrids = grids[lev];
625 ngrids.convert(amrex::IntVect::TheNodeVector());
626 (*node.fab_array[i])[lev].reset(
new amrex::MultiFab(ngrids, dmap[lev], node.ncomp_array[i], node.nghost_array[i]));
627 (*node.fab_array[i])[lev]->setVal(0.);
630 for (
int i = 0; i < cell.number_of_fabs; i++)
631 (*cell.fab_array[i])[lev].reset(
new amrex::MultiFab(grids[lev], dmap[lev], cell.ncomp_array[i], cell.nghost_array[i]));
632 for (
int i = 0; i < tmp_numfabs; i++)
637 for (
int j = 0; j < node.number_of_fabs; j++)
639 if (tmp_name_array[i] == node.name_array[i][j])
642 Util::Message(
INFO,
"Initializing ", node.name_array[i][j],
"; nghost=", node.nghost_array[j],
" with ", tmp_name_array[i]);
643 amrex::MultiFab::Copy(*((*node.fab_array[j])[lev]).get(), tmpdata[lev], i, 0, 1, total_nghost);
645 for (
int k = 0; k < node.ncomp_array[j]; k++)
647 if (tmp_name_array[i] == node.name_array[j][k])
650 Util::Message(
INFO,
"Initializing ", node.name_array[j][k],
"; ncomp=", node.ncomp_array[j],
"; nghost=", node.nghost_array[j],
" with ", tmp_name_array[i]);
651 amrex::MultiFab::Copy(*((*node.fab_array[j])[lev]).get(), tmpdata[lev], i, k, 1, total_nghost);
659 for (
int j = 0; j < cell.number_of_fabs; j++)
660 for (
int k = 0; k < cell.ncomp_array[j]; k++)
662 if (tmp_name_array[i] == cell.name_array[j][k])
665 Util::Message(
INFO,
"Initializing ", cell.name_array[j][k],
"; ncomp=", cell.ncomp_array[j],
"; nghost=", cell.nghost_array[j],
" with ", tmp_name_array[i]);
666 amrex::MultiFab::Copy(*((*cell.fab_array[j])[lev]).get(), tmpdata[lev], i, k, 1, cell.nghost_array[j]);
670 if (!match)
Util::Warning(
INFO,
"Fab ", tmp_name_array[i],
" is in the restart file, but there is no fab with that name here.");
673 for (
unsigned int n = 0; n < m_basefields_cell.size(); n++)
675 m_basefields_cell[n]->MakeNewLevelFromScratch(lev, t_new[lev], grids[lev], dmap[lev]);
677 for (
unsigned int n = 0; n < m_basefields.size(); n++)
679 m_basefields[n]->MakeNewLevelFromScratch(lev, t_new[lev], grids[lev], dmap[lev]);
683 SetFinestLevel(max_level);
770 BL_PROFILE(
"Integrator::WritePlotFile");
771 int nlevels = finest_level + 1;
772 if (max_plot_level >= 0) nlevels = std::min(nlevels, max_plot_level);
774 int ccomponents = 0, ncomponents = 0, bfcomponents_cell = 0, bfcomponents = 0;
775 amrex::Vector<std::string> cnames, nnames, bfnames_cell, bfnames;
776 for (
int i = 0; i < cell.number_of_fabs; i++)
778 if (!cell.writeout_array[i])
continue;
779 ccomponents += cell.ncomp_array[i];
780 if (cell.ncomp_array[i] > 1)
781 for (
int j = 0; j < cell.ncomp_array[i]; j++)
782 cnames.push_back(cell.name_array[i][j]);
784 cnames.push_back(cell.name_array[i][0]);
786 for (
int i = 0; i < node.number_of_fabs; i++)
788 if (!node.writeout_array[i])
continue;
789 ncomponents += node.ncomp_array[i];
790 if (node.ncomp_array[i] > 1)
791 for (
int j = 0; j < node.ncomp_array[i]; j++)
792 nnames.push_back(node.name_array[i][j]);
794 nnames.push_back(node.name_array[i][0]);
796 for (
unsigned int i = 0; i < m_basefields_cell.size(); i++)
798 if (m_basefields_cell[i]->writeout)
800 bfcomponents_cell += m_basefields_cell[i]->NComp();
801 for (
int j = 0; j < m_basefields_cell[i]->NComp(); j++)
802 bfnames_cell.push_back(m_basefields_cell[i]->Name(j));
805 for (
unsigned int i = 0; i < m_basefields.size(); i++)
807 if (m_basefields[i]->writeout)
809 bfcomponents += m_basefields[i]->NComp();
810 for (
int j = 0; j < m_basefields[i]->NComp(); j++)
811 bfnames.push_back(m_basefields[i]->Name(j));
815 amrex::Vector<amrex::MultiFab> cplotmf(nlevels), nplotmf(nlevels);
817 bool do_cell_plotfile = (ccomponents + bfcomponents_cell > 0 || (ncomponents + bfcomponents > 0 && cell.all)) && cell.any;
818 bool do_node_plotfile = (ncomponents + bfcomponents > 0 || (ccomponents + bfcomponents_cell > 0 && node.all)) && node.any;
820 for (
int ilev = 0; ilev < nlevels; ++ilev)
822 if (do_cell_plotfile)
824 int ncomp = ccomponents + bfcomponents_cell;
825 if (cell.all) ncomp += ncomponents + bfcomponents;
826 cplotmf[ilev].define(grids[ilev], dmap[ilev], ncomp, 0);
830 for (
int i = 0; i < cell.number_of_fabs; i++)
832 if (!cell.writeout_array[i])
continue;
833 if ((*cell.fab_array[i])[ilev]->contains_nan())
835 if (abort_on_nan)
Util::Abort(
INFO, cnames[cnames_cnt],
" contains nan (i=", i,
")");
838 if ((*cell.fab_array[i])[ilev]->contains_inf())
840 if (abort_on_nan)
Util::Abort(
INFO, cnames[cnames_cnt],
" contains inf (i=", i,
")");
844 amrex::MultiFab::Copy(cplotmf[ilev], *(*cell.fab_array[i])[ilev], 0, n, cell.ncomp_array[i], 0);
845 n += cell.ncomp_array[i];
847 for (
unsigned int i = 0; i < m_basefields_cell.size(); i++)
849 if (m_basefields_cell[i]->writeout)
851 m_basefields_cell[i]->Copy(ilev, cplotmf[ilev], n, 0);
852 n += m_basefields_cell[i]->NComp();
859 for (
int i = 0; i < node.number_of_fabs; i++)
861 if (!node.writeout_array[i])
continue;
862 if ((*node.fab_array[i])[ilev]->contains_nan())
864 if (abort_on_nan)
Util::Abort(
INFO, nnames[nnames_cnt],
" contains nan (i=", i,
")");
867 if ((*node.fab_array[i])[ilev]->contains_inf())
869 if (abort_on_nan)
Util::Abort(
INFO, nnames[nnames_cnt],
" contains inf (i=", i,
")");
873 amrex::average_node_to_cellcenter(cplotmf[ilev], n, *(*node.fab_array[i])[ilev], 0, node.ncomp_array[i], 0);
874 n += node.ncomp_array[i];
876 if (bfcomponents > 0)
878 amrex::BoxArray ngrids = grids[ilev];
879 ngrids.convert(amrex::IntVect::TheNodeVector());
880 amrex::MultiFab bfplotmf(ngrids, dmap[ilev], bfcomponents, 0);
882 for (
unsigned int i = 0; i < m_basefields.size(); i++)
884 if (m_basefields[i]->writeout)
886 m_basefields[i]->Copy(ilev, bfplotmf, ctr, 0);
887 ctr += m_basefields[i]->NComp();
890 amrex::average_node_to_cellcenter(cplotmf[ilev], n, bfplotmf, 0, bfcomponents);
896 if (do_node_plotfile)
898 amrex::BoxArray ngrids = grids[ilev];
899 ngrids.convert(amrex::IntVect::TheNodeVector());
900 int ncomp = ncomponents + bfcomponents;
901 if (node.all) ncomp += ccomponents + bfcomponents_cell;
902 nplotmf[ilev].define(ngrids, dmap[ilev], ncomp, 0);
905 for (
int i = 0; i < node.number_of_fabs; i++)
907 if (!node.writeout_array[i])
continue;
908 if ((*node.fab_array[i])[ilev]->contains_nan())
Util::Warning(
INFO, nnames[i],
" contains nan (i=", i,
"). Resetting to zero.");
909 if ((*node.fab_array[i])[ilev]->contains_inf())
Util::Abort(
INFO, nnames[i],
" contains inf (i=", i,
")");
910 amrex::MultiFab::Copy(nplotmf[ilev], *(*node.fab_array[i])[ilev], 0, n, node.ncomp_array[i], 0);
911 n += node.ncomp_array[i];
913 for (
unsigned int i = 0; i < m_basefields.size(); i++)
915 if (m_basefields[i]->writeout)
917 m_basefields[i]->Copy(ilev, nplotmf[ilev], n, 0);
918 n += m_basefields[i]->NComp();
924 for (
int i = 0; i < cell.number_of_fabs; i++)
926 if (!cell.writeout_array[i])
continue;
927 if ((*cell.fab_array[i])[ilev]->contains_nan())
Util::Warning(
INFO, cnames[i],
" contains nan (i=", i,
"). Resetting to zero.");
928 if ((*cell.fab_array[i])[ilev]->contains_inf())
Util::Abort(
INFO, cnames[i],
" contains inf (i=", i,
")");
929 if ((*cell.fab_array[i])[ilev]->nGrow() == 0)
931 if (initial)
Util::Warning(
INFO, cnames[i],
" has no ghost cells and will not be included in nodal output");
935 n += cell.ncomp_array[i];
938 if (bfcomponents_cell > 0)
940 amrex::BoxArray cgrids = grids[ilev];
941 amrex::MultiFab bfplotmf(cgrids, dmap[ilev], bfcomponents_cell, 0);
943 for (
unsigned int i = 0; i < m_basefields_cell.size(); i++)
945 if (m_basefields_cell[i]->writeout)
947 m_basefields_cell[i]->Copy(ilev, bfplotmf, ctr, 0);
948 ctr += m_basefields_cell[i]->NComp();
952 n += bfcomponents_cell;
958 std::vector<std::string> plotfilename = PlotFileName(istep[0], prefix);
959 if (initial) plotfilename[1] = plotfilename[1] +
"init";
961 if (do_cell_plotfile)
963 amrex::Vector<std::string> allnames = cnames;
964 allnames.insert(allnames.end(), bfnames_cell.begin(), bfnames_cell.end());
966 allnames.insert(allnames.end(), nnames.begin(), nnames.end());
967 allnames.insert(allnames.end(), bfnames.begin(), bfnames.end());
969 WriteMultiLevelPlotfile(plotfilename[0] + plotfilename[1] +
"cell", nlevels, amrex::GetVecOfConstPtrs(cplotmf), allnames,
970 Geom(), time, iter, refRatio());
972 std::ofstream chkptfile;
973 chkptfile.open(plotfilename[0] + plotfilename[1] +
"cell/Checkpoint");
974 for (
int i = 0; i <= max_level; i++) boxArray(i).writeOn(chkptfile);
978 if (do_node_plotfile)
980 amrex::Vector<std::string> allnames = nnames;
981 allnames.insert(allnames.end(), bfnames.begin(), bfnames.end());
982 if (node.all) allnames.insert(allnames.end(), cnames.begin(), cnames.end());
983 WriteMultiLevelPlotfile(plotfilename[0] + plotfilename[1] +
"node", nlevels, amrex::GetVecOfConstPtrs(nplotmf), allnames,
984 Geom(), time, iter, refRatio());
986 std::ofstream chkptfile;
987 chkptfile.open(plotfilename[0] + plotfilename[1] +
"node/Checkpoint");
988 for (
int i = 0; i <= max_level; i++) boxArray(i).writeOn(chkptfile);
992 if (amrex::ParallelDescriptor::IOProcessor())
994 std::ofstream coutfile, noutfile;
997 if (do_cell_plotfile) coutfile.open(plot_file +
"/celloutput.visit", std::ios_base::out);
998 if (do_node_plotfile) noutfile.open(plot_file +
"/nodeoutput.visit", std::ios_base::out);
1002 if (do_cell_plotfile) coutfile.open(plot_file +
"/celloutput.visit", std::ios_base::app);
1003 if (do_node_plotfile) noutfile.open(plot_file +
"/nodeoutput.visit", std::ios_base::app);
1005 if (do_cell_plotfile) coutfile << plotfilename[1] +
"cell" +
"/Header" << std::endl;
1006 if (do_node_plotfile) noutfile << plotfilename[1] +
"node" +
"/Header" << std::endl;
1064 BL_PROFILE(
"Integrator::IntegrateVariables");
1065 if (!thermo.number)
return;
1067 if ((thermo.interval > 0 && (step) % thermo.interval == 0) ||
1068 ((thermo.dt > 0.0) && (std::fabs(std::remainder(time, plot_dt)) < 0.5 * dt[0])))
1071 for (
int i = 0; i < thermo.number; i++)
1073 if (thermo.extensives[i]) *thermo.vars[i] = 0;
1077 for (
int ilev = 0; ilev < max_level; ilev++)
1079 const amrex::BoxArray& cfba = amrex::coarsen(grids[ilev + 1], refRatio(ilev));
1084 for (amrex::MFIter mfi(grids[ilev], dmap[ilev],
true); mfi.isValid(); ++mfi)
1086 const amrex::Box& box = mfi.tilebox();
1087 const amrex::BoxArray& comp = amrex::complementIn(box, cfba);
1089 for (
int i = 0; i < comp.size(); i++)
1091 Integrate(ilev, time, step,
1101 for (amrex::MFIter mfi(grids[max_level], dmap[max_level],
true); mfi.isValid(); ++mfi)
1103 const amrex::Box& box = mfi.tilebox();
1104 Integrate(max_level, time, step, mfi, box);
1109 for (
int i = 0; i < thermo.number; i++)
1111 if (thermo.extensives[i])
1112 amrex::ParallelDescriptor::ReduceRealSum(*thermo.vars[i]);
1115 if (amrex::ParallelDescriptor::IOProcessor() &&
1117 (thermo.plot_int > 0 && step % thermo.plot_int == 0) ||
1118 (thermo.plot_dt > 0.0 && std::fabs(std::remainder(time, thermo.plot_dt)) < 0.5 * dt[0])
1121 std::ofstream outfile;
1124 outfile.open(plot_file +
"/thermo.dat", std::ios_base::out);
1126 for (
int i = 0; i < thermo.number; i++)
1127 outfile <<
"\t" << thermo.names[i];
1128 outfile << std::endl;
1130 else outfile.open(plot_file +
"/thermo.dat", std::ios_base::app);
1132 for (
int i = 0; i < thermo.number; i++)
1133 outfile <<
"\t" << *thermo.vars[i];
1134 outfile << std::endl;
1144 BL_PROFILE(
"Integrator::TimeStep");
1145 if (base_regrid_int <= 0 || istep[0] % base_regrid_int == 0)
1147 if (regrid_int > 0 || base_regrid_int > 0)
1149 static amrex::Vector<int> last_regrid_step(max_level + 1, 0);
1152 if (lev < max_level && istep[lev] > last_regrid_step[lev])
1154 if (istep[lev] % regrid_int == 0)
1156 regrid(lev, time,
false);
1161 SetFinestLevel(finest_level);
1163 if (Verbose() && amrex::ParallelDescriptor::IOProcessor()) {
1164 std::cout <<
"[Level " << lev
1165 <<
" step " << istep[lev] + 1 <<
"] ";
1166 std::cout <<
"ADVANCE with dt = "
1171 for (
int n = 0; n < cell.number_of_fabs; n++)
1172 if (cell.evolving_array[n]) FillPatch(lev, time, *cell.fab_array[n], *(*cell.fab_array[n])[lev], *cell.physbc_array[n], 0);
1173 for (
int n = 0; n < node.number_of_fabs; n++)
1174 if (node.evolving_array[n]) FillPatch(lev, time, *node.fab_array[n], *(*node.fab_array[n])[lev], *node.physbc_array[n], 0);
1175 for (
unsigned int n = 0; n < m_basefields_cell.size(); n++)
1176 if (m_basefields_cell[n]->evolving) m_basefields_cell[n]->FillPatch(lev, time);
1177 for (
unsigned int n = 0; n < m_basefields.size(); n++)
1178 if (m_basefields[n]->evolving) m_basefields[n]->FillPatch(lev, time);
1180 Advance(lev, time, dt[lev]);
1183 if (Verbose() && amrex::ParallelDescriptor::IOProcessor())
1185 std::cout <<
"[Level " << lev
1186 <<
" step " << istep[lev] <<
"] ";
1187 std::cout <<
"Advanced "
1193 if (lev < finest_level)
1195 for (
int i = 1; i <= nsubsteps[lev + 1]; ++i)
1196 TimeStep(lev + 1, time + (i - 1) * dt[lev + 1], i);
1198 for (
int n = 0; n < cell.number_of_fabs; n++)
1200 amrex::average_down(*(*cell.fab_array[n])[lev + 1], *(*cell.fab_array[n])[lev],
1201 geom[lev + 1], geom[lev],
1202 0, (*cell.fab_array[n])[lev]->nComp(), refRatio(lev));
1204 for (
int n = 0; n < node.number_of_fabs; n++)
1206 amrex::average_down(*(*node.fab_array[n])[lev + 1], *(*node.fab_array[n])[lev],
1207 0, (*node.fab_array[n])[lev]->nComp(), refRatio(lev));
1209 for (
unsigned int n = 0; n < m_basefields_cell.size(); n++)
1211 if (m_basefields_cell[n]->evolving)
1212 m_basefields_cell[n]->AverageDown(lev, refRatio(lev));
1214 for (
unsigned int n = 0; n < m_basefields.size(); n++)
1216 if (m_basefields[n]->evolving)
1217 m_basefields[n]->AverageDown(lev, refRatio(lev));