From fe6215e0ebbf4ae1d3d75125c005a750f8a691da Mon Sep 17 00:00:00 2001 From: ChongChong He Date: Tue, 6 Aug 2024 04:04:36 +1000 Subject: [PATCH] Rename RadhydroSimulation class to QuokkaSimulation (#702) ### Description What's changed in the PR: - Renamed `RadhydroSimulation` class to `QuokkaSimulation` in all occurances inside src/. - Renamed `RadhydroSimulation.cpp/.hpp` to `QuokkaSimulation.cpp/.hpp` Why? This is the main simulation class that does all of the physics, including HD, gravity, radiation, MHD, etc. It should be given a more general and inclusive name to avoid the confusion caused by the name `RadhydroSimulation`. See #428 ### Related issues Addressed issue #428 ### Checklist _Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an `x` inside the square brackets `[ ]` in the Markdown source below:_ - [x] I have added a description (see above). - [x] I have added a link to any related issues see (see above). - [x] I have read the [Contributing Guide](https://github.com/quokka-astro/quokka/blob/development/CONTRIBUTING.md). - [ ] I have added tests for any new physics that this PR adds to the code. - [x] I have tested this PR on my local computer and all tests pass. - [x] I have manually triggered the GPU tests with the magic comment `/azp run`. - [x] I have requested a reviewer for this PR. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/QuokkaSimulation.cpp | 1 + ...droSimulation.hpp => QuokkaSimulation.hpp} | 178 +++++++++--------- src/RadhydroSimulation.cpp | 1 - src/linear_advection/AdvectionSimulation.hpp | 8 +- src/problems/Advection/test_advection.cpp | 2 +- src/problems/Advection2D/test_advection2d.cpp | 2 +- .../test_advection_semiellipse.cpp | 2 +- src/problems/BinaryOrbitCIC/binary_orbit.cpp | 12 +- src/problems/Cooling/test_cooling.cpp | 8 +- .../FCQuantities/test_fc_quantities.cpp | 10 +- .../HydroBlast2D/test_hydro2d_blast.cpp | 10 +- .../HydroBlast3D/test_hydro3d_blast.cpp | 12 +- .../HydroContact/test_hydro_contact.cpp | 10 +- .../HydroHighMach/test_hydro_highmach.cpp | 10 +- .../HydroKelvinHelmholz/test_hydro2d_kh.cpp | 8 +- .../HydroLeblanc/test_hydro_leblanc.cpp | 10 +- src/problems/HydroQuirk/test_quirk.cpp | 10 +- .../test_hydro2d_rm.cpp | 8 +- src/problems/HydroSMS/test_hydro_sms.cpp | 10 +- .../HydroShocktube/test_hydro_shocktube.cpp | 12 +- .../test_hydro_shocktube_cma.cpp | 10 +- .../HydroShuOsher/test_hydro_shuosher.cpp | 10 +- .../HydroVacuum/test_hydro_vacuum.cpp | 10 +- src/problems/HydroWave/test_hydro_wave.cpp | 8 +- src/problems/NSCBC/channel.cpp | 6 +- src/problems/NSCBC/vortex.cpp | 6 +- src/problems/PassiveScalar/test_scalars.cpp | 12 +- src/problems/PopIII/popiii.cpp | 12 +- .../PrimordialChem/test_primordial_chem.cpp | 8 +- src/problems/RadBeam/test_radiation_beam.cpp | 8 +- src/problems/RadBeam/test_radiation_beam.hpp | 2 +- .../RadForce/test_radiation_force.cpp | 6 +- .../RadMarshak/test_radiation_marshak.cpp | 6 +- .../test_radiation_marshak_asymptotic.cpp | 6 +- .../test_radiation_marshak_cgs.cpp | 4 +- .../test_radiation_marshak_cgs.hpp | 2 +- .../test_radiation_marshak_Vaytet.cpp | 6 +- .../test_radiation_matter_coupling.cpp | 8 +- .../test_radiation_matter_coupling_rsla.cpp | 8 +- .../RadPulse/test_radiation_pulse.cpp | 6 +- .../RadShadow/test_radiation_shadow.cpp | 8 +- .../RadShadow/test_radiation_shadow.hpp | 2 +- .../RadStreaming/test_radiation_streaming.cpp | 6 +- .../test_radiation_streaming_y.cpp | 6 +- .../RadSuOlson/test_radiation_SuOlson.cpp | 4 +- .../RadSuOlson/test_radiation_SuOlson.hpp | 2 +- .../RadTophat/test_radiation_tophat.cpp | 6 +- .../RadTophat/test_radiation_tophat.hpp | 2 +- src/problems/RadTube/test_radiation_tube.cpp | 8 +- src/problems/RadhydroBB/test_radhydro_bb.cpp | 6 +- src/problems/RadhydroBB/test_radhydro_bb.hpp | 2 +- .../RadhydroPulse/test_radhydro_pulse.cpp | 10 +- .../test_radhydro_pulse_dyn.cpp | 10 +- .../test_radhydro_pulse_grey.cpp | 10 +- .../test_radhydro_pulse_MG_const_kappa.cpp | 10 +- .../test_radhydro_pulse_MG_int.cpp | 10 +- .../RadhydroShell/test_radhydro_shell.cpp | 12 +- .../RadhydroShock/test_radhydro_shock.cpp | 6 +- .../test_radhydro_shock_cgs.cpp | 4 +- .../test_radhydro_shock_cgs.hpp | 2 +- .../test_radhydro_shock_multigroup.cpp | 4 +- .../test_radhydro_shock_multigroup.hpp | 2 +- .../test_radhydro_uniform_advecting.cpp | 6 +- src/problems/RandomBlast/blast.cpp | 18 +- .../RayleighTaylor2D/test_hydro2d_rt.cpp | 10 +- .../RayleighTaylor3D/test_hydro3d_rt.cpp | 12 +- src/problems/ShockCloud/cloud.cpp | 18 +- .../SphericalCollapse/spherical_collapse.cpp | 12 +- src/problems/StarCluster/star_cluster.cpp | 12 +- src/simulation.hpp | 6 +- 70 files changed, 346 insertions(+), 348 deletions(-) create mode 100644 src/QuokkaSimulation.cpp rename src/{RadhydroSimulation.hpp => QuokkaSimulation.hpp} (89%) delete mode 100644 src/RadhydroSimulation.cpp diff --git a/src/QuokkaSimulation.cpp b/src/QuokkaSimulation.cpp new file mode 100644 index 000000000..b073faba0 --- /dev/null +++ b/src/QuokkaSimulation.cpp @@ -0,0 +1 @@ +#include "QuokkaSimulation.hpp" diff --git a/src/RadhydroSimulation.hpp b/src/QuokkaSimulation.hpp similarity index 89% rename from src/RadhydroSimulation.hpp rename to src/QuokkaSimulation.hpp index efe75241f..9e890aad2 100644 --- a/src/RadhydroSimulation.hpp +++ b/src/QuokkaSimulation.hpp @@ -5,7 +5,7 @@ // Copyright 2020 Benjamin Wibking. // Released under the MIT license. See LICENSE file included in the GitHub repo. //============================================================================== -/// \file RadhydroSimulation.hpp +/// \file QuokkaSimulation.hpp /// \brief Implements classes and functions to organise the overall setup, /// timestepping, solving, and I/O of a simulation for radiation moments. @@ -61,7 +61,7 @@ #include "simulation.hpp" // Simulation class should be initialized only once per program (i.e., is a singleton) -template class RadhydroSimulation : public AMRSimulation +template class QuokkaSimulation : public AMRSimulation { public: using AMRSimulation::state_old_cc_; @@ -142,12 +142,12 @@ template class RadhydroSimulation : public AMRSimulation &BCs_cc, amrex::Vector &BCs_fc) : AMRSimulation(BCs_cc, BCs_fc) + explicit QuokkaSimulation(amrex::Vector &BCs_cc, amrex::Vector &BCs_fc) : AMRSimulation(BCs_cc, BCs_fc) { initialize(); } - explicit RadhydroSimulation(amrex::Vector &BCs_cc) : AMRSimulation(BCs_cc) { initialize(); } + explicit QuokkaSimulation(amrex::Vector &BCs_cc) : AMRSimulation(BCs_cc) { initialize(); } inline void initialize() { @@ -173,8 +173,8 @@ template class RadhydroSimulation : public AMRSimulation amrex::Real override; void preCalculateInitialConditions() override; - void setInitialConditionsOnGrid(quokka::grid grid_elem) override; - void setInitialConditionsOnGridFaceVars(quokka::grid grid_elem) override; + void setInitialConditionsOnGrid(quokka::grid const &grid_elem) override; + void setInitialConditionsOnGridFaceVars(quokka::grid const &grid_elem) override; void createInitialParticles() override; void advanceSingleTimestepAtLevel(int lev, amrex::Real time, amrex::Real dt_lev, int ncycle) override; void computeBeforeTimestep() override; @@ -279,7 +279,7 @@ template class RadhydroSimulation : public AMRSimulation void RadhydroSimulation::defineComponentNames() +template void QuokkaSimulation::defineComponentNames() { // cell-centred @@ -319,7 +319,7 @@ template void RadhydroSimulation::defineComponen } } -template auto RadhydroSimulation::getScalarVariableNames() -> std::vector +template auto QuokkaSimulation::getScalarVariableNames() -> std::vector { // return vector of names for the passive scalars // this can be specialized by the user to provide more descriptive names @@ -335,7 +335,7 @@ template auto RadhydroSimulation::getScalarVaria return names; } -template void RadhydroSimulation::readParmParse() +template void QuokkaSimulation::readParmParse() { // set hydro runtime parameters { @@ -390,7 +390,7 @@ template void RadhydroSimulation::readParmParse( } } -template auto RadhydroSimulation::computeNumberOfRadiationSubsteps(int lev, amrex::Real dt_lev_hydro) -> int +template auto QuokkaSimulation::computeNumberOfRadiationSubsteps(int lev, amrex::Real dt_lev_hydro) -> int { // compute radiation timestep auto const &dx = geom[lev].CellSizeArray(); @@ -401,9 +401,9 @@ template auto RadhydroSimulation::computeNumberO return nsubSteps; } -template void RadhydroSimulation::computeMaxSignalLocal(int const level) +template void QuokkaSimulation::computeMaxSignalLocal(int const level) { - BL_PROFILE("RadhydroSimulation::computeMaxSignalLocal()"); + BL_PROFILE("QuokkaSimulation::computeMaxSignalLocal()"); // hydro: loop over local grids, compute CFL timestep for (amrex::MFIter iter(state_new_cc_[level]); iter.isValid(); ++iter) { @@ -436,9 +436,9 @@ template void RadhydroSimulation::computeMaxSign } } -template auto RadhydroSimulation::computeExtraPhysicsTimestep(int const /*level*/) -> amrex::Real +template auto QuokkaSimulation::computeExtraPhysicsTimestep(int const /*level*/) -> amrex::Real { - BL_PROFILE("RadhydroSimulation::computeExtraPhysicsTimestep()"); + BL_PROFILE("QuokkaSimulation::computeExtraPhysicsTimestep()"); // users can override this to enforce additional timestep constraints return std::numeric_limits::max(); } @@ -449,9 +449,9 @@ template auto RadhydroSimulation::computeExtraPh #define CHECK_HYDRO_STATES(mf) #endif -template void RadhydroSimulation::checkHydroStates(amrex::MultiFab &mf, char const *file, int line) +template void QuokkaSimulation::checkHydroStates(amrex::MultiFab &mf, char const *file, int line) { - BL_PROFILE("RadhydroSimulation::checkHydroStates()"); + BL_PROFILE("QuokkaSimulation::checkHydroStates()"); bool validStates = HydroSystem::CheckStatesValid(mf); amrex::ParallelDescriptor::ReduceBoolAnd(validStates); @@ -465,55 +465,55 @@ template void RadhydroSimulation::checkHydroStat } } -template void RadhydroSimulation::preCalculateInitialConditions() +template void QuokkaSimulation::preCalculateInitialConditions() { // default empty implementation // user should implement using problem-specific template specialization } -template void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // default empty implementation // user should implement using problem-specific template specialization } -template void RadhydroSimulation::setInitialConditionsOnGridFaceVars(quokka::grid grid_elem) +template void QuokkaSimulation::setInitialConditionsOnGridFaceVars(quokka::grid const &grid_elem) { // default empty implementation // user should implement using problem-specific template specialization // note: an implementation is only required if face-centered vars are used } -template void RadhydroSimulation::createInitialParticles() +template void QuokkaSimulation::createInitialParticles() { // default empty implementation // user should implement using problem-specific template specialization // note: an implementation is only required if particles are used } -template void RadhydroSimulation::computeBeforeTimestep() +template void QuokkaSimulation::computeBeforeTimestep() { // do nothing -- user should implement if desired } -template void RadhydroSimulation::computeAfterTimestep() +template void QuokkaSimulation::computeAfterTimestep() { // do nothing -- user should implement if desired } -template void RadhydroSimulation::computeAfterLevelAdvance(int lev, amrex::Real time, amrex::Real dt_lev, int ncycle) +template void QuokkaSimulation::computeAfterLevelAdvance(int lev, amrex::Real time, amrex::Real dt_lev, int ncycle) { // user should implement if desired } -template void RadhydroSimulation::addStrangSplitSources(amrex::MultiFab &state, int lev, amrex::Real time, amrex::Real dt) +template void QuokkaSimulation::addStrangSplitSources(amrex::MultiFab &state, int lev, amrex::Real time, amrex::Real dt) { // user should implement // (when Strang splitting is enabled, dt is actually 0.5*dt_lev) } template -auto RadhydroSimulation::addStrangSplitSourcesWithBuiltin(amrex::MultiFab &state, int lev, amrex::Real time, amrex::Real dt) -> bool +auto QuokkaSimulation::addStrangSplitSourcesWithBuiltin(amrex::MultiFab &state, int lev, amrex::Real time, amrex::Real dt) -> bool { // start by assuming cooling integrator is successful. bool cool_success = true; @@ -543,39 +543,38 @@ auto RadhydroSimulation::addStrangSplitSourcesWithBuiltin(amrex::Mult return (burn_success && cool_success); } -template -void RadhydroSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp) const +template void QuokkaSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp) const { // compute derived variables and save in 'mf' -- user should implement } template -auto RadhydroSimulation::ComputeProjections(int /*dir*/) const -> std::unordered_map> +auto QuokkaSimulation::ComputeProjections(int /*dir*/) const -> std::unordered_map> { // compute projections and return as unordered_map -- user should implement return std::unordered_map>{}; } -template auto RadhydroSimulation::ComputeStatistics() -> std::map +template auto QuokkaSimulation::ComputeStatistics() -> std::map { // compute statistics and return a std::map -- user should implement // IMPORTANT: the user is responsible for performing any necessary MPI reductions before returning return std::map{}; } -template void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // tag cells for refinement -- user should implement } template -void RadhydroSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, - amrex::GpuArray const &prob_lo) +void QuokkaSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, + amrex::GpuArray const &prob_lo) { // user should implement } -template void RadhydroSimulation::computeAfterEvolve(amrex::Vector &initSumCons) +template void QuokkaSimulation::computeAfterEvolve(amrex::Vector &initSumCons) { amrex::GpuArray const &dx0 = geom[0].CellSizeArray(); amrex::Real const vol = AMREX_D_TERM(dx0[0], *dx0[1], *dx0[2]); @@ -647,9 +646,9 @@ template void RadhydroSimulation::computeAfterEv amrex::Print() << '\n'; } -template void RadhydroSimulation::advanceSingleTimestepAtLevel(int lev, amrex::Real time, amrex::Real dt_lev, int ncycle) +template void QuokkaSimulation::advanceSingleTimestepAtLevel(int lev, amrex::Real time, amrex::Real dt_lev, int ncycle) { - BL_PROFILE("RadhydroSimulation::advanceSingleTimestepAtLevel()"); + BL_PROFILE("QuokkaSimulation::advanceSingleTimestepAtLevel()"); // get flux registers amrex::YAFluxRegister *fr_as_crse = nullptr; @@ -703,7 +702,7 @@ template void RadhydroSimulation::advanceSingleT AMREX_ASSERT(!state_new_cc_[lev].contains_nan(0, state_new_cc_[lev].nComp())); } -template void RadhydroSimulation::fillPoissonRhsAtLevel(amrex::MultiFab &rhs_mf, const int lev) +template void QuokkaSimulation::fillPoissonRhsAtLevel(amrex::MultiFab &rhs_mf, const int lev) { // add hydro density to Poisson rhs auto const &state = state_new_cc_[lev].const_arrays(); @@ -718,7 +717,7 @@ template void RadhydroSimulation::fillPoissonRhs amrex::Gpu::streamSynchronizeAll(); } -template void RadhydroSimulation::applyPoissonGravityAtLevel(amrex::MultiFab const &phi_mf, const int lev, const amrex::Real dt) +template void QuokkaSimulation::applyPoissonGravityAtLevel(amrex::MultiFab const &phi_mf, const int lev, const amrex::Real dt) { if constexpr (AMREX_SPACEDIM == 3) { // apply Poisson gravity operator on level 'lev' @@ -755,9 +754,9 @@ template void RadhydroSimulation::applyPoissonGr // fix-up any unphysical states created by AMR operations // (e.g., caused by the flux register or from interpolation) -template void RadhydroSimulation::FixupState(int lev) +template void QuokkaSimulation::FixupState(int lev) { - BL_PROFILE("RadhydroSimulation::FixupState()"); + BL_PROFILE("QuokkaSimulation::FixupState()"); // fix hydro state HydroSystem::EnforceLimits(densityFloor_, tempFloor_, state_new_cc_[lev]); @@ -771,8 +770,8 @@ template void RadhydroSimulation::FixupState(int // NOTE: This has to be implemented here because PreInterpState and PostInterpState // are implemented in this class (and must be *static* functions). template -void RadhydroSimulation::FillPatch(int lev, amrex::Real time, amrex::MultiFab &mf, int icomp, int ncomp, quokka::centering cen, - quokka::direction dir, FillPatchType fptype) +void QuokkaSimulation::FillPatch(int lev, amrex::Real time, amrex::MultiFab &mf, int icomp, int ncomp, quokka::centering cen, quokka::direction dir, + FillPatchType fptype) { BL_PROFILE("AMRSimulation::FillPatch()"); @@ -798,9 +797,9 @@ void RadhydroSimulation::FillPatch(int lev, amrex::Real time, amrex:: } } -template void RadhydroSimulation::PreInterpState(amrex::MultiFab &mf, int /*scomp*/, int /*ncomp*/) +template void QuokkaSimulation::PreInterpState(amrex::MultiFab &mf, int /*scomp*/, int /*ncomp*/) { - BL_PROFILE("RadhydroSimulation::PreInterpState()"); + BL_PROFILE("QuokkaSimulation::PreInterpState()"); auto const &cons = mf.arrays(); amrex::ParallelFor(mf, [=] AMREX_GPU_DEVICE(int bx, int i, int j, int k) { @@ -817,9 +816,9 @@ template void RadhydroSimulation::PreInterpState }); } -template void RadhydroSimulation::PostInterpState(amrex::MultiFab &mf, int /*scomp*/, int /*ncomp*/) +template void QuokkaSimulation::PostInterpState(amrex::MultiFab &mf, int /*scomp*/, int /*ncomp*/) { - BL_PROFILE("RadhydroSimulation::PostInterpState()"); + BL_PROFILE("QuokkaSimulation::PostInterpState()"); auto const &cons = mf.arrays(); amrex::ParallelFor(mf, [=] AMREX_GPU_DEVICE(int bx, int i, int j, int k) { @@ -839,10 +838,10 @@ template void RadhydroSimulation::PostInterpStat template template -auto RadhydroSimulation::computeAxisAlignedProfile(const int axis, F const &user_f) -> amrex::Gpu::HostVector +auto QuokkaSimulation::computeAxisAlignedProfile(const int axis, F const &user_f) -> amrex::Gpu::HostVector { // compute a 1D profile of user_f(i, j, k, state) along the given axis. - BL_PROFILE("RadhydroSimulation::computeAxisAlignedProfile()"); + BL_PROFILE("QuokkaSimulation::computeAxisAlignedProfile()"); // allocate temporary multifabs amrex::Vector q; @@ -880,8 +879,8 @@ auto RadhydroSimulation::computeAxisAlignedProfile(const int axis, F } template -void RadhydroSimulation::advanceHydroAtLevelWithRetries(int lev, amrex::Real time, amrex::Real dt_lev, amrex::YAFluxRegister *fr_as_crse, - amrex::YAFluxRegister *fr_as_fine) +void QuokkaSimulation::advanceHydroAtLevelWithRetries(int lev, amrex::Real time, amrex::Real dt_lev, amrex::YAFluxRegister *fr_as_crse, + amrex::YAFluxRegister *fr_as_fine) { BL_PROFILE_REGION("HydroSolver"); // timestep retries @@ -986,7 +985,7 @@ void RadhydroSimulation::advanceHydroAtLevelWithRetries(int lev, amre } } -template auto RadhydroSimulation::isCflViolated(int lev, amrex::Real /*time*/, amrex::Real dt_actual) -> bool +template auto QuokkaSimulation::isCflViolated(int lev, amrex::Real /*time*/, amrex::Real dt_actual) -> bool { // check whether dt_actual would violate CFL condition using the post-update hydro state @@ -1009,7 +1008,7 @@ template auto RadhydroSimulation::isCflViolated( return cflViolation; } -template void RadhydroSimulation::printCoordinates(int lev, const amrex::IntVect &cell_idx) +template void QuokkaSimulation::printCoordinates(int lev, const amrex::IntVect &cell_idx) { amrex::Real x_coord = geom[lev].ProbLo(0) + (cell_idx[0] + 0.5) * geom[lev].CellSize(0); @@ -1027,10 +1026,10 @@ template void RadhydroSimulation::printCoordinat } template -auto RadhydroSimulation::advanceHydroAtLevel(amrex::MultiFab &state_old_cc_tmp, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, - int lev, amrex::Real time, amrex::Real dt_lev) -> bool +auto QuokkaSimulation::advanceHydroAtLevel(amrex::MultiFab &state_old_cc_tmp, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, + int lev, amrex::Real time, amrex::Real dt_lev) -> bool { - BL_PROFILE("RadhydroSimulation::advanceHydroAtLevel()"); + BL_PROFILE("QuokkaSimulation::advanceHydroAtLevel()"); amrex::Real fluxScaleFactor = NAN; if (integratorOrder_ == 2) { @@ -1319,10 +1318,10 @@ auto RadhydroSimulation::advanceHydroAtLevel(amrex::MultiFab &state_o } template -void RadhydroSimulation::replaceFluxes(std::array &fluxes, std::array &FOfluxes, - amrex::iMultiFab &redoFlag) +void QuokkaSimulation::replaceFluxes(std::array &fluxes, std::array &FOfluxes, + amrex::iMultiFab &redoFlag) { - BL_PROFILE("RadhydroSimulation::replaceFluxes()"); + BL_PROFILE("QuokkaSimulation::replaceFluxes()"); for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) { // loop over dimension // ensure that flux arrays have the same number of components @@ -1365,10 +1364,10 @@ void RadhydroSimulation::replaceFluxes(std::array -void RadhydroSimulation::addFluxArrays(std::array &dstfluxes, - std::array &srcfluxes, const int srccomp, const int dstcomp) +void QuokkaSimulation::addFluxArrays(std::array &dstfluxes, std::array &srcfluxes, + const int srccomp, const int dstcomp) { - BL_PROFILE("RadhydroSimulation::addFluxArrays()"); + BL_PROFILE("QuokkaSimulation::addFluxArrays()"); for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) { auto const &srcflux = srcfluxes[idim]; @@ -1378,10 +1377,10 @@ void RadhydroSimulation::addFluxArrays(std::array -auto RadhydroSimulation::expandFluxArrays(std::array &fluxes, const int nstartNew, - const int ncompNew) -> std::array +auto QuokkaSimulation::expandFluxArrays(std::array &fluxes, const int nstartNew, + const int ncompNew) -> std::array { - BL_PROFILE("RadhydroSimulation::expandFluxArrays()"); + BL_PROFILE("QuokkaSimulation::expandFluxArrays()"); // This is needed because reflux arrays must have the same number of components as // state_new_cc_[lev] @@ -1398,10 +1397,10 @@ auto RadhydroSimulation::expandFluxArrays(std::array -auto RadhydroSimulation::computeHydroFluxes(amrex::MultiFab const &consVar, const int nvars, const int lev) +auto QuokkaSimulation::computeHydroFluxes(amrex::MultiFab const &consVar, const int nvars, const int lev) -> std::pair, std::array> { - BL_PROFILE("RadhydroSimulation::computeHydroFluxes()"); + BL_PROFILE("QuokkaSimulation::computeHydroFluxes()"); auto ba = grids[lev]; auto dm = dmap[lev]; @@ -1488,9 +1487,9 @@ auto RadhydroSimulation::computeHydroFluxes(amrex::MultiFab const &co template template -void RadhydroSimulation::hydroFluxFunction(amrex::MultiFab const &primVar, amrex::MultiFab &leftState, amrex::MultiFab &rightState, - amrex::MultiFab &flux, amrex::MultiFab &faceVel, amrex::MultiFab const &x1Flat, - amrex::MultiFab const &x2Flat, amrex::MultiFab const &x3Flat, const int ng_reconstruct, const int nvars) +void QuokkaSimulation::hydroFluxFunction(amrex::MultiFab const &primVar, amrex::MultiFab &leftState, amrex::MultiFab &rightState, + amrex::MultiFab &flux, amrex::MultiFab &faceVel, amrex::MultiFab const &x1Flat, + amrex::MultiFab const &x2Flat, amrex::MultiFab const &x3Flat, const int ng_reconstruct, const int nvars) { if (reconstructionOrder_ == 3) { HyperbolicSystem::template ReconstructStatesPPM(primVar, leftState, rightState, ng_reconstruct, nvars); @@ -1514,10 +1513,10 @@ void RadhydroSimulation::hydroFluxFunction(amrex::MultiFab const &pri } template -auto RadhydroSimulation::computeFOHydroFluxes(amrex::MultiFab const &consVar, const int nvars, const int lev) +auto QuokkaSimulation::computeFOHydroFluxes(amrex::MultiFab const &consVar, const int nvars, const int lev) -> std::pair, std::array> { - BL_PROFILE("RadhydroSimulation::computeFOHydroFluxes()"); + BL_PROFILE("QuokkaSimulation::computeFOHydroFluxes()"); auto ba = grids[lev]; auto dm = dmap[lev]; @@ -1555,8 +1554,8 @@ auto RadhydroSimulation::computeFOHydroFluxes(amrex::MultiFab const & template template -void RadhydroSimulation::hydroFOFluxFunction(amrex::MultiFab const &primVar, amrex::MultiFab &leftState, amrex::MultiFab &rightState, - amrex::MultiFab &flux, amrex::MultiFab &faceVel, const int ng_reconstruct, const int nvars) +void QuokkaSimulation::hydroFOFluxFunction(amrex::MultiFab const &primVar, amrex::MultiFab &leftState, amrex::MultiFab &rightState, + amrex::MultiFab &flux, amrex::MultiFab &faceVel, const int ng_reconstruct, const int nvars) { // donor-cell reconstruction HydroSystem::template ReconstructStatesConstant(primVar, leftState, rightState, ng_reconstruct, nvars); @@ -1564,15 +1563,15 @@ void RadhydroSimulation::hydroFOFluxFunction(amrex::MultiFab const &p HydroSystem::template ComputeFluxes(flux, faceVel, leftState, rightState, primVar, artificialViscosityK_); } -template void RadhydroSimulation::swapRadiationState(amrex::MultiFab &stateOld, amrex::MultiFab const &stateNew) +template void QuokkaSimulation::swapRadiationState(amrex::MultiFab &stateOld, amrex::MultiFab const &stateNew) { // copy radiation state variables from stateNew to stateOld amrex::MultiFab::Copy(stateOld, stateNew, nstartHyperbolic_, nstartHyperbolic_, ncompHyperbolic_, 0); } template -void RadhydroSimulation::subcycleRadiationAtLevel(int lev, amrex::Real time, amrex::Real dt_lev_hydro, amrex::YAFluxRegister *fr_as_crse, - amrex::YAFluxRegister *fr_as_fine) +void QuokkaSimulation::subcycleRadiationAtLevel(int lev, amrex::Real time, amrex::Real dt_lev_hydro, amrex::YAFluxRegister *fr_as_crse, + amrex::YAFluxRegister *fr_as_fine) { // compute radiation timestep int nsubSteps = 0; @@ -1655,9 +1654,8 @@ void RadhydroSimulation::subcycleRadiationAtLevel(int lev, amrex::Rea } template -void RadhydroSimulation::advanceRadiationSubstepAtLevel(int lev, amrex::Real time, amrex::Real dt_radiation, int const iter_count, - int const /*nsubsteps*/, amrex::YAFluxRegister *fr_as_crse, - amrex::YAFluxRegister *fr_as_fine) +void QuokkaSimulation::advanceRadiationSubstepAtLevel(int lev, amrex::Real time, amrex::Real dt_radiation, int const iter_count, + int const /*nsubsteps*/, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine) { if (Verbose()) { amrex::Print() << "\tsubstep " << iter_count << " t = " << time << '\n'; @@ -1722,8 +1720,8 @@ void RadhydroSimulation::advanceRadiationSubstepAtLevel(int lev, amre } template -void RadhydroSimulation::advanceRadiationForwardEuler(int lev, amrex::Real time, amrex::Real dt_radiation, int const /*iter_count*/, - int const /*nsubsteps*/, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine) +void QuokkaSimulation::advanceRadiationForwardEuler(int lev, amrex::Real time, amrex::Real dt_radiation, int const /*iter_count*/, + int const /*nsubsteps*/, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine) { // get cell sizes auto const &dx = geom[lev].CellSizeArray(); @@ -1755,8 +1753,8 @@ void RadhydroSimulation::advanceRadiationForwardEuler(int lev, amrex: } template -void RadhydroSimulation::advanceRadiationMidpointRK2(int lev, amrex::Real time, amrex::Real dt_radiation, int const /*iter_count*/, - int const /*nsubsteps*/, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine) +void QuokkaSimulation::advanceRadiationMidpointRK2(int lev, amrex::Real time, amrex::Real dt_radiation, int const /*iter_count*/, + int const /*nsubsteps*/, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine) { auto const &dx = geom[lev].CellSizeArray(); @@ -1791,10 +1789,10 @@ void RadhydroSimulation::advanceRadiationMidpointRK2(int lev, amrex:: } template -void RadhydroSimulation::operatorSplitSourceTerms(amrex::Array4 const &stateNew, const amrex::Box &indexRange, const amrex::Real time, - const double dt, const int stage, amrex::GpuArray const &dx, - amrex::GpuArray const &prob_lo, - amrex::GpuArray const &prob_hi) +void QuokkaSimulation::operatorSplitSourceTerms(amrex::Array4 const &stateNew, const amrex::Box &indexRange, const amrex::Real time, + const double dt, const int stage, amrex::GpuArray const &dx, + amrex::GpuArray const &prob_lo, + amrex::GpuArray const &prob_hi) { amrex::FArrayBox radEnergySource(indexRange, Physics_Traits::nGroups, amrex::The_Async_Arena()); // cell-centered scalar @@ -1809,8 +1807,8 @@ void RadhydroSimulation::operatorSplitSourceTerms(amrex::Array4 -auto RadhydroSimulation::computeRadiationFluxes(amrex::Array4 const &consVar, const amrex::Box &indexRange, const int nvars, - amrex::GpuArray dx) +auto QuokkaSimulation::computeRadiationFluxes(amrex::Array4 const &consVar, const amrex::Box &indexRange, const int nvars, + amrex::GpuArray dx) -> std::tuple, std::array> { amrex::Box const &x1FluxRange = amrex::surroundingNodes(indexRange, 0); @@ -1840,8 +1838,8 @@ auto RadhydroSimulation::computeRadiationFluxes(amrex::Array4 template -void RadhydroSimulation::fluxFunction(amrex::Array4 const &consState, amrex::FArrayBox &x1Flux, amrex::FArrayBox &x1FluxDiffusive, - const amrex::Box &indexRange, const int nvars, amrex::GpuArray dx) +void QuokkaSimulation::fluxFunction(amrex::Array4 const &consState, amrex::FArrayBox &x1Flux, amrex::FArrayBox &x1FluxDiffusive, + const amrex::Box &indexRange, const int nvars, amrex::GpuArray dx) { int dir = 0; if constexpr (DIR == FluxDir::X1) { diff --git a/src/RadhydroSimulation.cpp b/src/RadhydroSimulation.cpp deleted file mode 100644 index 1a7fc0f42..000000000 --- a/src/RadhydroSimulation.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "RadhydroSimulation.hpp" diff --git a/src/linear_advection/AdvectionSimulation.hpp b/src/linear_advection/AdvectionSimulation.hpp index fd4c002f1..c26d5afdc 100644 --- a/src/linear_advection/AdvectionSimulation.hpp +++ b/src/linear_advection/AdvectionSimulation.hpp @@ -63,8 +63,8 @@ template class AdvectionSimulation : public AMRSimulation

amrex::Real override; void preCalculateInitialConditions() override; - void setInitialConditionsOnGrid(quokka::grid grid_elem) override; - void setInitialConditionsOnGridFaceVars(quokka::grid grid_elem) override; + void setInitialConditionsOnGrid(quokka::grid const &grid_elem) override; + void setInitialConditionsOnGridFaceVars(quokka::grid const &grid_elem) override; void createInitialParticles() override; void advanceSingleTimestepAtLevel(int lev, amrex::Real time, amrex::Real dt_lev, int /*ncycle*/) override; void computeBeforeTimestep() override; @@ -137,13 +137,13 @@ template void AdvectionSimulation::preCalculateI // user should implement using problem-specific template specialization } -template void AdvectionSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template void AdvectionSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // default empty implementation // user should implement using problem-specific template specialization } -template void AdvectionSimulation::setInitialConditionsOnGridFaceVars(quokka::grid grid_elem) +template void AdvectionSimulation::setInitialConditionsOnGridFaceVars(quokka::grid const &grid_elem) { // default empty implementation // user should implement using problem-specific template specialization diff --git a/src/problems/Advection/test_advection.cpp b/src/problems/Advection/test_advection.cpp index bfe8aef2c..460c028d1 100644 --- a/src/problems/Advection/test_advection.cpp +++ b/src/problems/Advection/test_advection.cpp @@ -47,7 +47,7 @@ AMREX_GPU_DEVICE void ComputeExactSolution(int i, int j, int k, int n, amrex::Ar exact_arr(i, j, k, n) = value; } -template <> void AdvectionSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void AdvectionSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; diff --git a/src/problems/Advection2D/test_advection2d.cpp b/src/problems/Advection2D/test_advection2d.cpp index 0aba8edfa..4b9f0b1d9 100644 --- a/src/problems/Advection2D/test_advection2d.cpp +++ b/src/problems/Advection2D/test_advection2d.cpp @@ -57,7 +57,7 @@ AMREX_GPU_DEVICE AMREX_FORCE_INLINE auto exactSolutionAtIndex(int i, int j, amre return rho; } -template <> void AdvectionSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void AdvectionSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; diff --git a/src/problems/AdvectionSemiellipse/test_advection_semiellipse.cpp b/src/problems/AdvectionSemiellipse/test_advection_semiellipse.cpp index 4d2eea383..e2bd8250f 100644 --- a/src/problems/AdvectionSemiellipse/test_advection_semiellipse.cpp +++ b/src/problems/AdvectionSemiellipse/test_advection_semiellipse.cpp @@ -46,7 +46,7 @@ AMREX_GPU_DEVICE void ComputeExactSolution(int i, int j, int k, int n, amrex::Ar exact_arr(i, j, k, n) = dens; } -template <> void AdvectionSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void AdvectionSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; diff --git a/src/problems/BinaryOrbitCIC/binary_orbit.cpp b/src/problems/BinaryOrbitCIC/binary_orbit.cpp index f563be013..7878d0d0f 100644 --- a/src/problems/BinaryOrbitCIC/binary_orbit.cpp +++ b/src/problems/BinaryOrbitCIC/binary_orbit.cpp @@ -23,7 +23,7 @@ #include "AMReX_REAL.H" #include "AMReX_ccse-mpi.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "binary_orbit.hpp" #include "hydro/hydro_system.hpp" #include @@ -56,7 +56,7 @@ template <> struct SimulationData { std::vector dist{}; }; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { const amrex::Box &indexRange = grid_elem.indexRange_; const amrex::Array4 &state_cc = grid_elem.array_; @@ -72,7 +72,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(quo }); } -template <> void RadhydroSimulation::createInitialParticles() +template <> void QuokkaSimulation::createInitialParticles() { // read particles from ASCII file const int nreal_extra = 4; // mass vx vy vz @@ -80,7 +80,7 @@ template <> void RadhydroSimulation::createInitialParticles() CICParticles->InitFromAsciiFile("BinaryOrbit_particles.txt", nreal_extra, nullptr); } -template <> void RadhydroSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_cc_in) const +template <> void QuokkaSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_cc_in) const { // compute derived variables and save in 'mf' if (dname == "gpot") { @@ -91,7 +91,7 @@ template <> void RadhydroSimulation::ComputeDerivedVar(int lev, std } } -template <> void RadhydroSimulation::computeAfterTimestep() +template <> void QuokkaSimulation::computeAfterTimestep() { // every N cycles, save particle statistics static int cycle = 1; @@ -167,7 +167,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.doPoissonSolve_ = 1; // enable self-gravity sim.initDt_ = 1.0e3; // s diff --git a/src/problems/Cooling/test_cooling.cpp b/src/problems/Cooling/test_cooling.cpp index 8be419612..87e058aa7 100644 --- a/src/problems/Cooling/test_cooling.cpp +++ b/src/problems/Cooling/test_cooling.cpp @@ -13,7 +13,7 @@ #include "AMReX_GpuDevice.H" #include "AMReX_TableData.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "radiation/radiation_system.hpp" using amrex::Real; @@ -53,7 +53,7 @@ const int kmin = 0; const int kmax = 16; Real const A = 0.05 / kmax; -template <> void RadhydroSimulation::preCalculateInitialConditions() +template <> void QuokkaSimulation::preCalculateInitialConditions() { // generate random phases amrex::Array tlo{kmin, kmin, kmin}; // lower bounds @@ -81,7 +81,7 @@ template <> void RadhydroSimulation::preCalculateInitialConditions( amrex::Gpu::streamSynchronize(); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // set initial conditions amrex::GpuArray dx = grid_elem.dx_; @@ -195,7 +195,7 @@ auto problem_main() -> int #endif } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); // Standard PPM gives unphysically enormous temperatures when used for // this problem (e.g., ~1e14 K or higher), but can be fixed by diff --git a/src/problems/FCQuantities/test_fc_quantities.cpp b/src/problems/FCQuantities/test_fc_quantities.cpp index 310f5e7d7..eb8820960 100644 --- a/src/problems/FCQuantities/test_fc_quantities.cpp +++ b/src/problems/FCQuantities/test_fc_quantities.cpp @@ -16,7 +16,7 @@ #include "AMReX_Print.H" #include "AMReX_REAL.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "grid.hpp" #include "physics_info.hpp" #include "test_fc_quantities.hpp" @@ -71,7 +71,7 @@ AMREX_GPU_DEVICE void computeWaveSolution(int i, int j, int k, amrex::Array4::internalEnergy_index) = Eint; } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract grid information amrex::GpuArray dx = grid_elem.dx_; @@ -89,7 +89,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(qu }); } -template <> void RadhydroSimulation::setInitialConditionsOnGridFaceVars(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGridFaceVars(quokka::grid const &grid_elem) { // extract grid information const amrex::Array4 &state = grid_elem.array_; @@ -155,12 +155,12 @@ auto problem_main() -> int } } - RadhydroSimulation sim_write(BCs_cc, BCs_fc); + QuokkaSimulation sim_write(BCs_cc, BCs_fc); sim_write.setInitialConditions(); amrex::Vector> const &state_new_fc_write = sim_write.getNewMF_fc(); amrex::Print() << "\n"; - RadhydroSimulation sim_restart(BCs_cc, BCs_fc); + QuokkaSimulation sim_restart(BCs_cc, BCs_fc); sim_restart.setChkFile("chk00000"); sim_restart.setInitialConditions(); amrex::Vector> const &state_new_fc_restart = sim_restart.getNewMF_fc(); diff --git a/src/problems/HydroBlast2D/test_hydro2d_blast.cpp b/src/problems/HydroBlast2D/test_hydro2d_blast.cpp index 951fc0a83..bc4548f1a 100644 --- a/src/problems/HydroBlast2D/test_hydro2d_blast.cpp +++ b/src/problems/HydroBlast2D/test_hydro2d_blast.cpp @@ -18,7 +18,7 @@ #include "AMReX_REAL.H" #include "AMReX_TagBox.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "test_hydro2d_blast.hpp" @@ -42,7 +42,7 @@ template <> struct Physics_Traits { static constexpr int nGroups = 1; // number of radiation groups }; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -94,7 +94,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(qu }); } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // tag cells for refinement @@ -143,7 +143,7 @@ auto problem_main() -> int return false; }; - const int ncomp_cc = RadhydroSimulation::nvarTotal_cc_; + const int ncomp_cc = QuokkaSimulation::nvarTotal_cc_; amrex::Vector BCs_cc(ncomp_cc); for (int n = 0; n < ncomp_cc; ++n) { for (int i = 0; i < AMREX_SPACEDIM; ++i) { @@ -164,7 +164,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.stopTime_ = 0.1; // 1.5; sim.cflNumber_ = 0.3; diff --git a/src/problems/HydroBlast3D/test_hydro3d_blast.cpp b/src/problems/HydroBlast3D/test_hydro3d_blast.cpp index 2f5ab553e..9d601462b 100644 --- a/src/problems/HydroBlast3D/test_hydro3d_blast.cpp +++ b/src/problems/HydroBlast3D/test_hydro3d_blast.cpp @@ -15,7 +15,7 @@ #include "AMReX_Print.H" #include "AMReX_SPACE.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "radiation/radiation_system.hpp" @@ -52,14 +52,14 @@ template <> struct Physics_Traits { const double rho = 1.0; // g cm^-3 double E_blast = 0.851072; // ergs -template <> void RadhydroSimulation::preCalculateInitialConditions() +template <> void QuokkaSimulation::preCalculateInitialConditions() { if constexpr (!simulate_full_box) { E_blast /= 8.0; // only one octant, so 1/8 of the total energy } } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // initialize a Sedov test problem using parameters from // Richard Klein and J. Bolstad @@ -115,7 +115,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(qu }); } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // tag cells for refinement @@ -150,7 +150,7 @@ template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagB } } -template <> void RadhydroSimulation::computeAfterEvolve(amrex::Vector &initSumCons) +template <> void QuokkaSimulation::computeAfterEvolve(amrex::Vector &initSumCons) { amrex::GpuArray const &dx0 = geom[0].CellSizeArray(); amrex::Real const vol = AMREX_D_TERM(dx0[0], *dx0[1], *dx0[2]); @@ -254,7 +254,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.reconstructionOrder_ = 3; // 2=PLM, 3=PPM sim.stopTime_ = 1.0; // seconds diff --git a/src/problems/HydroContact/test_hydro_contact.cpp b/src/problems/HydroContact/test_hydro_contact.cpp index 7461cc265..47bf32f20 100644 --- a/src/problems/HydroContact/test_hydro_contact.cpp +++ b/src/problems/HydroContact/test_hydro_contact.cpp @@ -12,7 +12,7 @@ #include "AMReX_MultiFab.H" #include "AMReX_ParmParse.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "radiation/radiation_system.hpp" #include "test_hydro_contact.hpp" @@ -40,7 +40,7 @@ template <> struct Physics_Traits { constexpr double v_contact = 0.0; // contact wave velocity -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -83,8 +83,8 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid( } template <> -void RadhydroSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, - amrex::GpuArray const &prob_lo) +void QuokkaSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, + amrex::GpuArray const &prob_lo) { for (amrex::MFIter iter(ref); iter.isValid(); ++iter) { const amrex::Box &indexRange = iter.validbox(); @@ -195,7 +195,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.stopTime_ = 2.0; sim.cflNumber_ = 0.8; diff --git a/src/problems/HydroHighMach/test_hydro_highmach.cpp b/src/problems/HydroHighMach/test_hydro_highmach.cpp index 6e3cd4e7d..f70c05355 100644 --- a/src/problems/HydroHighMach/test_hydro_highmach.cpp +++ b/src/problems/HydroHighMach/test_hydro_highmach.cpp @@ -12,7 +12,7 @@ #include "AMReX_MultiFab.H" #include "AMReX_ParmParse.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "util/fextract.hpp" #ifdef HAVE_PYTHON @@ -45,7 +45,7 @@ template <> struct Physics_Traits { static constexpr int nGroups = 1; // number of radiation groups }; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -81,8 +81,8 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid } template <> -void RadhydroSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, - amrex::GpuArray const &prob_lo) +void QuokkaSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, + amrex::GpuArray const &prob_lo) { // extract solution @@ -258,7 +258,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.computeReferenceSolution_ = true; diff --git a/src/problems/HydroKelvinHelmholz/test_hydro2d_kh.cpp b/src/problems/HydroKelvinHelmholz/test_hydro2d_kh.cpp index 31e9685f8..e292bdce9 100644 --- a/src/problems/HydroKelvinHelmholz/test_hydro2d_kh.cpp +++ b/src/problems/HydroKelvinHelmholz/test_hydro2d_kh.cpp @@ -15,7 +15,7 @@ #include "AMReX_ParmParse.H" #include "AMReX_Print.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "test_hydro2d_kh.hpp" @@ -43,7 +43,7 @@ template <> struct Physics_Traits { static constexpr int nGroups = 1; // number of radiation groups }; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -87,7 +87,7 @@ template <> void RadhydroSimulation::setInitialConditions }); } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // tag cells for refinement @@ -132,7 +132,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.stopTime_ = 1.5; sim.cflNumber_ = 0.4; diff --git a/src/problems/HydroLeblanc/test_hydro_leblanc.cpp b/src/problems/HydroLeblanc/test_hydro_leblanc.cpp index 84649f553..e9c9199a4 100644 --- a/src/problems/HydroLeblanc/test_hydro_leblanc.cpp +++ b/src/problems/HydroLeblanc/test_hydro_leblanc.cpp @@ -15,7 +15,7 @@ #include "AMReX_BC_TYPES.H" #include "AMReX_BLassert.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "radiation/radiation_system.hpp" #include "test_hydro_leblanc.hpp" @@ -45,7 +45,7 @@ template <> struct Physics_Traits { static constexpr int nGroups = 1; // number of radiation groups }; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -139,8 +139,8 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVec } template <> -void RadhydroSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, - amrex::GpuArray const &prob_lo) +void QuokkaSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, + amrex::GpuArray const &prob_lo) { // read in exact solution @@ -353,7 +353,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.cflNumber_ = CFL_number; sim.maxDt_ = max_dt; diff --git a/src/problems/HydroQuirk/test_quirk.cpp b/src/problems/HydroQuirk/test_quirk.cpp index 6ee15e3c6..a60ada952 100644 --- a/src/problems/HydroQuirk/test_quirk.cpp +++ b/src/problems/HydroQuirk/test_quirk.cpp @@ -26,7 +26,7 @@ #include "AMReX_Print.H" #include "AMReX_REAL.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "radiation/radiation_system.hpp" @@ -64,7 +64,7 @@ constexpr Real ur = -5.0; constexpr Real pr = 0.6; int ishock_g = 0; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -129,7 +129,7 @@ auto getDeltaEntropyVector() -> std::vector & return delta_s_vec; } -template <> void RadhydroSimulation::computeAfterTimestep() +template <> void QuokkaSimulation::computeAfterTimestep() { if (amrex::ParallelDescriptor::IOProcessor()) { // it should be sufficient examine a single box on level 0 @@ -182,7 +182,7 @@ template <> void RadhydroSimulation::computeAfterTimestep() } } -template <> void RadhydroSimulation::computeAfterEvolve(amrex::Vector & /*initSumCons*/) +template <> void QuokkaSimulation::computeAfterEvolve(amrex::Vector & /*initSumCons*/) { if (amrex::ParallelDescriptor::IOProcessor()) { auto const &deltas_vec = getDeltaEntropyVector(); @@ -259,7 +259,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.reconstructionOrder_ = 2; // PLM sim.stopTime_ = 0.4; diff --git a/src/problems/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp b/src/problems/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp index bcc9fb7f0..09b48ba60 100644 --- a/src/problems/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp +++ b/src/problems/HydroRichtmeyerMeshkov/test_hydro2d_rm.cpp @@ -13,7 +13,7 @@ #include "AMReX_ParmParse.H" #include "AMReX_Print.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" struct RichtmeyerMeshkovProblem { @@ -40,7 +40,7 @@ template <> struct Physics_Traits { static constexpr int nGroups = 1; // number of radiation groups }; -template <> void RadhydroSimulation::computeAfterTimestep() +template <> void QuokkaSimulation::computeAfterTimestep() { const int ncomp_cc = Physics_Indices::nvarTotal_cc; @@ -99,7 +99,7 @@ template <> void RadhydroSimulation::computeAfterTimes } } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -173,7 +173,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.stopTime_ = 2.5; sim.cflNumber_ = 0.4; diff --git a/src/problems/HydroSMS/test_hydro_sms.cpp b/src/problems/HydroSMS/test_hydro_sms.cpp index 7695f327e..7d2baeafc 100644 --- a/src/problems/HydroSMS/test_hydro_sms.cpp +++ b/src/problems/HydroSMS/test_hydro_sms.cpp @@ -9,7 +9,7 @@ #include "AMReX_BC_TYPES.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "test_hydro_sms.hpp" #include "util/ArrayUtil.hpp" @@ -38,7 +38,7 @@ template <> struct Physics_Traits { static constexpr int nGroups = 1; // number of radiation groups }; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -130,8 +130,8 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVec } template <> -void RadhydroSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, - amrex::GpuArray const &prob_lo) +void QuokkaSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, + amrex::GpuArray const &prob_lo) { auto const box = geom[0].Domain(); @@ -274,7 +274,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.cflNumber_ = CFL_number; sim.constantDt_ = fixed_dt; diff --git a/src/problems/HydroShocktube/test_hydro_shocktube.cpp b/src/problems/HydroShocktube/test_hydro_shocktube.cpp index 566af7b30..cc19860de 100644 --- a/src/problems/HydroShocktube/test_hydro_shocktube.cpp +++ b/src/problems/HydroShocktube/test_hydro_shocktube.cpp @@ -13,7 +13,7 @@ #include "AMReX_BC_TYPES.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "radiation/radiation_system.hpp" #include "test_hydro_shocktube.hpp" @@ -49,7 +49,7 @@ constexpr amrex::Real P_L = 100.0; constexpr amrex::Real rho_R = 1.0; constexpr amrex::Real P_R = 1.0; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -143,7 +143,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVec } } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, Real /*time*/, int /*ngrow*/) { // tag cells for refinement @@ -170,8 +170,8 @@ template <> void RadhydroSimulation::ErrorEst(int lev, amrex:: } template <> -void RadhydroSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, - amrex::GpuArray const &prob_lo) +void QuokkaSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, + amrex::GpuArray const &prob_lo) { // read in exact solution @@ -360,7 +360,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); // sim.cflNumber_ = CFL_number; // sim.maxDt_ = max_dt; diff --git a/src/problems/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp b/src/problems/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp index 20492bcfa..e5495455e 100644 --- a/src/problems/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp +++ b/src/problems/HydroShocktubeCMA/test_hydro_shocktube_cma.cpp @@ -14,7 +14,7 @@ #include "AMReX_BC_TYPES.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "radiation/radiation_system.hpp" #include "test_hydro_shocktube_cma.hpp" @@ -54,7 +54,7 @@ constexpr amrex::Real P_L = 1.0; constexpr amrex::Real rho_R = 0.125; constexpr amrex::Real P_R = 0.1; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -176,7 +176,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVec } } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, Real /*time*/, int /*ngrow*/) { // tag cells for refinement @@ -202,7 +202,7 @@ template <> void RadhydroSimulation::ErrorEst(int lev, amrex:: } } -template <> void RadhydroSimulation::computeAfterTimestep() +template <> void QuokkaSimulation::computeAfterTimestep() { auto [position, values] = fextract(state_new_cc_[0], Geom(0), 0, 0.5); const int nx = static_cast(position.size()); // number of cells along the x direction @@ -253,7 +253,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.stopTime_ = max_time; sim.maxTimesteps_ = max_timesteps; diff --git a/src/problems/HydroShuOsher/test_hydro_shuosher.cpp b/src/problems/HydroShuOsher/test_hydro_shuosher.cpp index 97f578723..ef847a179 100644 --- a/src/problems/HydroShuOsher/test_hydro_shuosher.cpp +++ b/src/problems/HydroShuOsher/test_hydro_shuosher.cpp @@ -11,7 +11,7 @@ #include #include "AMReX_BC_TYPES.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "radiation/radiation_system.hpp" #include "test_hydro_shuosher.hpp" @@ -40,7 +40,7 @@ template <> struct Physics_Traits { static constexpr int nGroups = 1; // number of radiation groups }; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -131,8 +131,8 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVec } template <> -void RadhydroSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, - amrex::GpuArray const &prob_lo) +void QuokkaSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, + amrex::GpuArray const &prob_lo) { // read in exact solution @@ -294,7 +294,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.cflNumber_ = CFL_number; sim.constantDt_ = fixed_dt; diff --git a/src/problems/HydroVacuum/test_hydro_vacuum.cpp b/src/problems/HydroVacuum/test_hydro_vacuum.cpp index 5d0d73e95..14774aa05 100644 --- a/src/problems/HydroVacuum/test_hydro_vacuum.cpp +++ b/src/problems/HydroVacuum/test_hydro_vacuum.cpp @@ -12,7 +12,7 @@ #include "AMReX_BC_TYPES.H" #include "AMReX_BLassert.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "radiation/radiation_system.hpp" #include "test_hydro_vacuum.hpp" @@ -42,7 +42,7 @@ template <> struct Physics_Traits { static constexpr int nGroups = 1; // number of radiation groups }; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -135,8 +135,8 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVec } template <> -void RadhydroSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, - amrex::GpuArray const &prob_lo) +void QuokkaSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, + amrex::GpuArray const &prob_lo) { auto const box = geom[0].Domain(); @@ -316,7 +316,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.cflNumber_ = CFL_number; sim.maxDt_ = max_dt; diff --git a/src/problems/HydroWave/test_hydro_wave.cpp b/src/problems/HydroWave/test_hydro_wave.cpp index 1c678f007..00d329e4b 100644 --- a/src/problems/HydroWave/test_hydro_wave.cpp +++ b/src/problems/HydroWave/test_hydro_wave.cpp @@ -13,7 +13,7 @@ #include "AMReX_Array4.H" #include "AMReX_REAL.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "test_hydro_wave.hpp" #include "util/fextract.hpp" @@ -67,7 +67,7 @@ AMREX_GPU_DEVICE void computeWaveSolution(int i, int j, int k, amrex::Array4::internalEnergy_index) = Eint; } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -106,7 +106,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.cflNumber_ = CFL_number; sim.stopTime_ = max_time; @@ -126,7 +126,7 @@ auto problem_main() -> int // compute error norm amrex::Real err_sq = 0.; - for (int n = 0; n < RadhydroSimulation::ncompHydro_; ++n) { + for (int n = 0; n < QuokkaSimulation::ncompHydro_; ++n) { if (n == HydroSystem::internalEnergy_index) { continue; } diff --git a/src/problems/NSCBC/channel.cpp b/src/problems/NSCBC/channel.cpp index 2e2c7efde..59b6d5e7d 100644 --- a/src/problems/NSCBC/channel.cpp +++ b/src/problems/NSCBC/channel.cpp @@ -27,7 +27,7 @@ #include "AMReX_REAL.H" #include "AMReX_SPACE.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "channel.hpp" #include "fundamental_constants.H" #include "hydro/EOS.hpp" @@ -81,7 +81,7 @@ AMREX_GPU_MANAGED amrex::GpuArray::numPassiveScala }; // namespace #endif -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // set initial conditions const amrex::Box &indexRange = grid_elem.indexRange_; @@ -144,7 +144,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); amrex::ParmParse const pp("channel"); // initial condition parameters diff --git a/src/problems/NSCBC/vortex.cpp b/src/problems/NSCBC/vortex.cpp index eed572dec..c5742f4a8 100644 --- a/src/problems/NSCBC/vortex.cpp +++ b/src/problems/NSCBC/vortex.cpp @@ -27,7 +27,7 @@ #include "AMReX_REAL.H" #include "AMReX_SPACE.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "fundamental_constants.H" #include "hydro/EOS.hpp" #include "hydro/HydroState.hpp" @@ -73,7 +73,7 @@ AMREX_GPU_MANAGED amrex::Real w0 = NAN; // NOLINT(cppcoreguidelines-av AMREX_GPU_MANAGED amrex::GpuArray::nscalars_> s0{}; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) }; // namespace -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // set initial conditions const amrex::Box &indexRange = grid_elem.indexRange_; @@ -171,7 +171,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); amrex::ParmParse const pp("vortex"); // initial condition parameters diff --git a/src/problems/PassiveScalar/test_scalars.cpp b/src/problems/PassiveScalar/test_scalars.cpp index 0a5a9479a..7861834a2 100644 --- a/src/problems/PassiveScalar/test_scalars.cpp +++ b/src/problems/PassiveScalar/test_scalars.cpp @@ -12,7 +12,7 @@ #include "AMReX_MultiFab.H" #include "AMReX_ParmParse.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "radiation/radiation_system.hpp" #include "test_scalars.hpp" @@ -42,7 +42,7 @@ template <> struct Physics_Traits { constexpr double v_contact = 2.0; // contact wave velocity -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -84,8 +84,8 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(q } template <> -void RadhydroSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, - amrex::GpuArray const &prob_lo) +void QuokkaSimulation::computeReferenceSolution(amrex::MultiFab &ref, amrex::GpuArray const &dx, + amrex::GpuArray const &prob_lo) { for (amrex::MFIter iter(ref); iter.isValid(); ++iter) { const amrex::Box &indexRange = iter.validbox(); @@ -210,7 +210,7 @@ void RadhydroSimulation::computeReferenceSolution(amrex::MultiFab #endif } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // tag cells for refinement @@ -252,7 +252,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.computeReferenceSolution_ = true; diff --git a/src/problems/PopIII/popiii.cpp b/src/problems/PopIII/popiii.cpp index 876e87703..d1ff9d069 100644 --- a/src/problems/PopIII/popiii.cpp +++ b/src/problems/PopIII/popiii.cpp @@ -18,7 +18,7 @@ #include "AMReX_REAL.H" #include "AMReX_TableData.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "SimulationData.hpp" #include "hydro/hydro_system.hpp" #include "popiii.hpp" @@ -83,7 +83,7 @@ template <> struct SimulationData { amrex::Real primary_species_14{}; }; -template <> void RadhydroSimulation::preCalculateInitialConditions() +template <> void QuokkaSimulation::preCalculateInitialConditions() { // initialize microphysics routines @@ -170,7 +170,7 @@ template <> void RadhydroSimulation::preCalculateInitialConditions() } } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // set initial conditions amrex::GpuArray const dx = grid_elem.dx_; @@ -322,7 +322,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka:: }); } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // read-in jeans length refinement runtime params @@ -358,7 +358,7 @@ template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArra } } -template <> void RadhydroSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_cc_in) const +template <> void QuokkaSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_cc_in) const { // compute derived variables and save in 'mf' if (dname == "temperature") { @@ -446,7 +446,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.doPoissonSolve_ = 1; // enable self-gravity sim.tempFloor_ = 2.73 * (30.0 + 1.0); diff --git a/src/problems/PrimordialChem/test_primordial_chem.cpp b/src/problems/PrimordialChem/test_primordial_chem.cpp index 76746ff0e..9d9d83aef 100644 --- a/src/problems/PrimordialChem/test_primordial_chem.cpp +++ b/src/problems/PrimordialChem/test_primordial_chem.cpp @@ -23,7 +23,7 @@ #include "AMReX_SPACE.H" #include "AMReX_TableData.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "SimulationData.hpp" #include "hydro/hydro_system.hpp" #include "radiation/radiation_system.hpp" @@ -71,7 +71,7 @@ template <> struct SimulationData { amrex::Real primary_species_14; }; -template <> void RadhydroSimulation::preCalculateInitialConditions() +template <> void QuokkaSimulation::preCalculateInitialConditions() { // initialize microphysics routines init_extern_parameters(); @@ -121,7 +121,7 @@ template <> void RadhydroSimulation::preCalculateInitialCond network_init(); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // set initial conditions const amrex::Box &indexRange = grid_elem.indexRange_; @@ -261,7 +261,7 @@ auto problem_main() -> int #endif } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); // Standard PPM gives unphysically enormous temperatures when used for // this problem (e.g., ~1e14 K or higher), but can be fixed by diff --git a/src/problems/RadBeam/test_radiation_beam.cpp b/src/problems/RadBeam/test_radiation_beam.cpp index 45d6c7096..df9cc02a8 100644 --- a/src/problems/RadBeam/test_radiation_beam.cpp +++ b/src/problems/RadBeam/test_radiation_beam.cpp @@ -12,7 +12,7 @@ #include "AMReX_IntVect.H" #include "AMReX_REAL.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "radiation/radiation_system.hpp" struct BeamProblem { @@ -207,7 +207,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVect &iv } } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object const amrex::Box &indexRange = grid_elem.indexRange_; @@ -232,7 +232,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(quo }); } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // tag cells for refinement @@ -286,7 +286,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.stopTime_ = max_time; sim.radiationCflNumber_ = CFL_number; diff --git a/src/problems/RadBeam/test_radiation_beam.hpp b/src/problems/RadBeam/test_radiation_beam.hpp index 5a5f63aed..598d0dfed 100644 --- a/src/problems/RadBeam/test_radiation_beam.hpp +++ b/src/problems/RadBeam/test_radiation_beam.hpp @@ -14,7 +14,7 @@ #include // internal headers -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "radiation/radiation_system.hpp" // function definitions diff --git a/src/problems/RadForce/test_radiation_force.cpp b/src/problems/RadForce/test_radiation_force.cpp index 9943123e1..d5934ebb4 100644 --- a/src/problems/RadForce/test_radiation_force.cpp +++ b/src/problems/RadForce/test_radiation_force.cpp @@ -16,7 +16,7 @@ #include "AMReX_Box.H" #include "AMReX_REAL.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "math/interpolate.hpp" #include "physics_info.hpp" @@ -80,7 +80,7 @@ template <> AMREX_GPU_HOST_DEVICE auto RadSystem::ComputeFluxMeanOp return kappa0; } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object const amrex::Box &indexRange = grid_elem.indexRange_; @@ -195,7 +195,7 @@ auto problem_main() -> int pp.query("max_dt", max_dt); // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 3; // PPM sim.reconstructionOrder_ = 3; // PPM diff --git a/src/problems/RadMarshak/test_radiation_marshak.cpp b/src/problems/RadMarshak/test_radiation_marshak.cpp index e1a753bd7..007af7b89 100644 --- a/src/problems/RadMarshak/test_radiation_marshak.cpp +++ b/src/problems/RadMarshak/test_radiation_marshak.cpp @@ -12,7 +12,7 @@ #include "AMReX_BLassert.H" #include "AMReX_ParallelDescriptor.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "test_radiation_marshak.hpp" #include "util/fextract.hpp" @@ -159,7 +159,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVect consVar(i, j, k, RadSystem::x3GasMomentum_index) = 0.; } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { const amrex::Box &indexRange = grid_elem.indexRange_; const amrex::Array4 &state_cc = grid_elem.array_; @@ -213,7 +213,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.stopTime_ = max_time; sim.radiationCflNumber_ = CFL_number; diff --git a/src/problems/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp b/src/problems/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp index 4f6d18a4d..e32e29abd 100644 --- a/src/problems/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp +++ b/src/problems/RadMarshakAsymptotic/test_radiation_marshak_asymptotic.cpp @@ -9,7 +9,7 @@ #include "AMReX_BLassert.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "test_radiation_marshak_asymptotic.hpp" #include "util/fextract.hpp" @@ -145,7 +145,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVe consVar(i, j, k, RadSystem::x3GasMomentum_index) = 0.; } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { const amrex::Box &indexRange = grid_elem.indexRange_; const amrex::Array4 &state_cc = grid_elem.array_; @@ -227,7 +227,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 3; // PPM sim.stopTime_ = max_time; diff --git a/src/problems/RadMarshakCGS/test_radiation_marshak_cgs.cpp b/src/problems/RadMarshakCGS/test_radiation_marshak_cgs.cpp index 61b5a2544..aed8d04bb 100644 --- a/src/problems/RadMarshakCGS/test_radiation_marshak_cgs.cpp +++ b/src/problems/RadMarshakCGS/test_radiation_marshak_cgs.cpp @@ -172,7 +172,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVe consVar(i, j, k, RadSystem::x3GasMomentum_index) = 0.; } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { const amrex::Box &indexRange = grid_elem.indexRange_; const amrex::Array4 &state_cc = grid_elem.array_; @@ -227,7 +227,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.stopTime_ = max_time; sim.radiationCflNumber_ = CFL_number; diff --git a/src/problems/RadMarshakCGS/test_radiation_marshak_cgs.hpp b/src/problems/RadMarshakCGS/test_radiation_marshak_cgs.hpp index 50e7798c6..157f447cc 100644 --- a/src/problems/RadMarshakCGS/test_radiation_marshak_cgs.hpp +++ b/src/problems/RadMarshakCGS/test_radiation_marshak_cgs.hpp @@ -18,7 +18,7 @@ // internal headers -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "math/interpolate.hpp" #include "radiation/radiation_system.hpp" diff --git a/src/problems/RadMarshakVaytet/test_radiation_marshak_Vaytet.cpp b/src/problems/RadMarshakVaytet/test_radiation_marshak_Vaytet.cpp index f156a87df..d9d8027b4 100644 --- a/src/problems/RadMarshakVaytet/test_radiation_marshak_Vaytet.cpp +++ b/src/problems/RadMarshakVaytet/test_radiation_marshak_Vaytet.cpp @@ -4,7 +4,7 @@ #include "AMReX_BLassert.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "radiation/radiation_system.hpp" #include "test_radiation_marshak_Vaytet.hpp" #include "util/fextract.hpp" @@ -219,7 +219,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVe } } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { const amrex::Box &indexRange = grid_elem.indexRange_; const amrex::Array4 &state_cc = grid_elem.array_; @@ -272,7 +272,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 3; // PPM sim.stopTime_ = max_time; diff --git a/src/problems/RadMatterCoupling/test_radiation_matter_coupling.cpp b/src/problems/RadMatterCoupling/test_radiation_matter_coupling.cpp index 9558af50b..5010bb1ed 100644 --- a/src/problems/RadMatterCoupling/test_radiation_matter_coupling.cpp +++ b/src/problems/RadMatterCoupling/test_radiation_matter_coupling.cpp @@ -11,7 +11,7 @@ #include "AMReX_BC_TYPES.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "radiation/radiation_system.hpp" #include "test_radiation_matter_coupling.hpp" #include "util/fextract.hpp" @@ -102,7 +102,7 @@ constexpr double Erad0 = 1.0e12; // erg cm^-3 constexpr double Egas0 = 1.0e2; // erg cm^-3 constexpr double rho0 = 1.0e-7; // g cm^-3 -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { const amrex::Box &indexRange = grid_elem.indexRange_; const amrex::Array4 &state_cc = grid_elem.array_; @@ -122,7 +122,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid }); } -template <> void RadhydroSimulation::computeAfterTimestep() +template <> void QuokkaSimulation::computeAfterTimestep() { auto [position, values] = fextract(state_new_cc_[0], Geom(0), 0, 0.5); @@ -164,7 +164,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.cflNumber_ = CFL_number; sim.radiationCflNumber_ = CFL_number; diff --git a/src/problems/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp b/src/problems/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp index c91689c6e..475c2a284 100644 --- a/src/problems/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp +++ b/src/problems/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp @@ -8,7 +8,7 @@ /// #include "test_radiation_matter_coupling_rsla.hpp" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "radiation/radiation_system.hpp" #include "util/fextract.hpp" #ifdef HAVE_PYTHON @@ -104,7 +104,7 @@ constexpr double Erad0 = 1.0e12; // erg cm^-3 constexpr double Egas0 = 1.0e2; // erg cm^-3 constexpr double rho0 = 1.0e-7; // g cm^-3 -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { const amrex::Box &indexRange = grid_elem.indexRange_; const amrex::Array4 &state_cc = grid_elem.array_; @@ -124,7 +124,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid }); } -template <> void RadhydroSimulation::computeAfterTimestep() +template <> void QuokkaSimulation::computeAfterTimestep() { auto [position, values] = fextract(state_new_cc_[0], Geom(0), 0, 0.5); @@ -166,7 +166,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.cflNumber_ = CFL_number; sim.radiationCflNumber_ = CFL_number; diff --git a/src/problems/RadPulse/test_radiation_pulse.cpp b/src/problems/RadPulse/test_radiation_pulse.cpp index ba5e7f5ac..cde6a25cc 100644 --- a/src/problems/RadPulse/test_radiation_pulse.cpp +++ b/src/problems/RadPulse/test_radiation_pulse.cpp @@ -10,7 +10,7 @@ #include "test_radiation_pulse.hpp" #include "AMReX_BC_TYPES.H" #include "AMReX_Print.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "physics_info.hpp" #include "util/fextract.hpp" @@ -76,7 +76,7 @@ template <> AMREX_GPU_HOST_DEVICE auto RadSystem::ComputeFluxMeanO return ComputePlanckOpacity(rho, Tgas); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -139,7 +139,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 3; // PPM sim.stopTime_ = max_time; diff --git a/src/problems/RadShadow/test_radiation_shadow.cpp b/src/problems/RadShadow/test_radiation_shadow.cpp index 0bd617898..f4e583ac2 100644 --- a/src/problems/RadShadow/test_radiation_shadow.cpp +++ b/src/problems/RadShadow/test_radiation_shadow.cpp @@ -12,7 +12,7 @@ #include "AMReX_Print.H" #include "AMReX_REAL.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "physics_info.hpp" #include "radiation/radiation_system.hpp" #include "simulation.hpp" @@ -110,7 +110,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVect & } } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -146,7 +146,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(q }); } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // tag cells for refinement @@ -237,7 +237,7 @@ auto problem_main() -> int // const double resid_tol = 1.0e-15; // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.stopTime_ = max_time; sim.radiationCflNumber_ = CFL_number; sim.maxTimesteps_ = max_timesteps; diff --git a/src/problems/RadShadow/test_radiation_shadow.hpp b/src/problems/RadShadow/test_radiation_shadow.hpp index 3399ad90f..5cffbabaa 100644 --- a/src/problems/RadShadow/test_radiation_shadow.hpp +++ b/src/problems/RadShadow/test_radiation_shadow.hpp @@ -18,7 +18,7 @@ // internal headers -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "radiation/radiation_system.hpp" // function definitions diff --git a/src/problems/RadStreaming/test_radiation_streaming.cpp b/src/problems/RadStreaming/test_radiation_streaming.cpp index fe386ab9a..1746e9e5b 100644 --- a/src/problems/RadStreaming/test_radiation_streaming.cpp +++ b/src/problems/RadStreaming/test_radiation_streaming.cpp @@ -9,7 +9,7 @@ #include "test_radiation_streaming.hpp" #include "AMReX.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "util/fextract.hpp" #include "util/valarray.hpp" @@ -58,7 +58,7 @@ template <> AMREX_GPU_HOST_DEVICE auto RadSystem::ComputeFluxM return kappa0; } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { const amrex::Box &indexRange = grid_elem.indexRange_; const amrex::Array4 &state_cc = grid_elem.array_; @@ -176,7 +176,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 3; // PPM sim.stopTime_ = tmax; diff --git a/src/problems/RadStreamingY/test_radiation_streaming_y.cpp b/src/problems/RadStreamingY/test_radiation_streaming_y.cpp index 33b7d949e..2c6894291 100644 --- a/src/problems/RadStreamingY/test_radiation_streaming_y.cpp +++ b/src/problems/RadStreamingY/test_radiation_streaming_y.cpp @@ -10,7 +10,7 @@ #include "test_radiation_streaming_y.hpp" #include "AMReX.H" #include "AMReX_BLassert.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "util/fextract.hpp" #include "util/valarray.hpp" @@ -61,7 +61,7 @@ template <> AMREX_GPU_HOST_DEVICE auto RadSystem::ComputeFluxM return kappa0; } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { const amrex::Box &indexRange = grid_elem.indexRange_; const amrex::Array4 &state_cc = grid_elem.array_; @@ -186,7 +186,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); // read tmax from inputs file amrex::ParmParse pp; // NOLINT diff --git a/src/problems/RadSuOlson/test_radiation_SuOlson.cpp b/src/problems/RadSuOlson/test_radiation_SuOlson.cpp index 0b63249e9..b6204e5db 100644 --- a/src/problems/RadSuOlson/test_radiation_SuOlson.cpp +++ b/src/problems/RadSuOlson/test_radiation_SuOlson.cpp @@ -144,7 +144,7 @@ void RadSystem::SetRadEnergySource(array_t &radEnergySource, amr }); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { const amrex::Box &indexRange = grid_elem.indexRange_; const amrex::Array4 &state_cc = grid_elem.array_; @@ -217,7 +217,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.cflNumber_ = CFL_number; sim.radiationCflNumber_ = CFL_number; diff --git a/src/problems/RadSuOlson/test_radiation_SuOlson.hpp b/src/problems/RadSuOlson/test_radiation_SuOlson.hpp index e2b2c3124..3d0c9a5c5 100644 --- a/src/problems/RadSuOlson/test_radiation_SuOlson.hpp +++ b/src/problems/RadSuOlson/test_radiation_SuOlson.hpp @@ -18,7 +18,7 @@ // internal headers -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "math/interpolate.hpp" #include "radiation/radiation_system.hpp" diff --git a/src/problems/RadTophat/test_radiation_tophat.cpp b/src/problems/RadTophat/test_radiation_tophat.cpp index f79a92761..eff81e77d 100644 --- a/src/problems/RadTophat/test_radiation_tophat.cpp +++ b/src/problems/RadTophat/test_radiation_tophat.cpp @@ -13,7 +13,7 @@ #include "AMReX_IntVect.H" #include "AMReX_REAL.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "radiation/radiation_system.hpp" #include "simulation.hpp" @@ -187,7 +187,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVect & } } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -273,7 +273,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 2; // PLM sim.stopTime_ = max_time; diff --git a/src/problems/RadTophat/test_radiation_tophat.hpp b/src/problems/RadTophat/test_radiation_tophat.hpp index 50e7798c6..157f447cc 100644 --- a/src/problems/RadTophat/test_radiation_tophat.hpp +++ b/src/problems/RadTophat/test_radiation_tophat.hpp @@ -18,7 +18,7 @@ // internal headers -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "math/interpolate.hpp" #include "radiation/radiation_system.hpp" diff --git a/src/problems/RadTube/test_radiation_tube.cpp b/src/problems/RadTube/test_radiation_tube.cpp index 07a964a27..80c9770a4 100644 --- a/src/problems/RadTube/test_radiation_tube.cpp +++ b/src/problems/RadTube/test_radiation_tube.cpp @@ -14,7 +14,7 @@ #include "AMReX_BC_TYPES.H" #include "AMReX_ValLocPair.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "math/interpolate.hpp" #include "physics_info.hpp" #include "radiation/radiation_system.hpp" @@ -97,7 +97,7 @@ amrex::Gpu::DeviceVector rho_arr_g; amrex::Gpu::DeviceVector Pgas_arr_g; amrex::Gpu::DeviceVector Erad_arr_g; -template <> void RadhydroSimulation::preCalculateInitialConditions() +template <> void QuokkaSimulation::preCalculateInitialConditions() { // map initial conditions to the global variables std::string filename = "../extern/pressure_tube/initial_conditions.txt"; @@ -136,7 +136,7 @@ template <> void RadhydroSimulation::preCalculateInitialConditions( amrex::Gpu::streamSynchronizeAll(); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -276,7 +276,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 3; // PPM sim.reconstructionOrder_ = 3; // PPM diff --git a/src/problems/RadhydroBB/test_radhydro_bb.cpp b/src/problems/RadhydroBB/test_radhydro_bb.cpp index 261a00593..a969fe3ef 100644 --- a/src/problems/RadhydroBB/test_radhydro_bb.cpp +++ b/src/problems/RadhydroBB/test_radhydro_bb.cpp @@ -17,7 +17,7 @@ // #include "AMReX_BC_TYPES.H" #include "AMReX_IntVect.H" #include "AMReX_Print.H" -// #include "RadhydroSimulation.hpp" +// #include "QuokkaSimulation.hpp" // #include "util/fextract.hpp" #include "physics_info.hpp" // #include "radiation/radiation_system.hpp" @@ -158,7 +158,7 @@ auto compute_exact_bb(const double nu, const double T) -> double return coeff * planck_integral / (std::pow(PI, 4) / 15.0) * (a_rad * std::pow(T, 4)); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object const amrex::Box &indexRange = grid_elem.indexRange_; @@ -213,7 +213,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 3; // PPM sim.stopTime_ = max_time; diff --git a/src/problems/RadhydroBB/test_radhydro_bb.hpp b/src/problems/RadhydroBB/test_radhydro_bb.hpp index 898f9631d..e9e416bea 100644 --- a/src/problems/RadhydroBB/test_radhydro_bb.hpp +++ b/src/problems/RadhydroBB/test_radhydro_bb.hpp @@ -18,7 +18,7 @@ // internal headers -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "math/interpolate.hpp" #include "radiation/radiation_system.hpp" diff --git a/src/problems/RadhydroPulse/test_radhydro_pulse.cpp b/src/problems/RadhydroPulse/test_radhydro_pulse.cpp index 3e8ab3c7b..181ed8821 100644 --- a/src/problems/RadhydroPulse/test_radhydro_pulse.cpp +++ b/src/problems/RadhydroPulse/test_radhydro_pulse.cpp @@ -5,7 +5,7 @@ #include "test_radhydro_pulse.hpp" #include "AMReX_BC_TYPES.H" #include "AMReX_Print.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "physics_info.hpp" #include "util/fextract.hpp" @@ -113,7 +113,7 @@ template <> AMREX_GPU_HOST_DEVICE auto RadSystem::ComputeFluxMe return ComputePlanckOpacity(rho, Tgas); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -144,7 +144,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(qu state_cc(i, j, k, RadSystem::x3GasMomentum_index) = 0.; }); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -214,7 +214,7 @@ auto problem_main() -> int // Problem 1: non-advecting pulse // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); double max_time = 4.8e-5; amrex::ParmParse pp; // NOLINT @@ -267,7 +267,7 @@ auto problem_main() -> int // Problem 2: advecting pulse // Problem initialization - RadhydroSimulation sim2(BCs_cc); + QuokkaSimulation sim2(BCs_cc); sim2.radiationReconstructionOrder_ = 3; // PPM sim2.stopTime_ = max_time; diff --git a/src/problems/RadhydroPulseDyn/test_radhydro_pulse_dyn.cpp b/src/problems/RadhydroPulseDyn/test_radhydro_pulse_dyn.cpp index efa107512..2415c3e84 100644 --- a/src/problems/RadhydroPulseDyn/test_radhydro_pulse_dyn.cpp +++ b/src/problems/RadhydroPulseDyn/test_radhydro_pulse_dyn.cpp @@ -5,7 +5,7 @@ #include "test_radhydro_pulse_dyn.hpp" #include "AMReX_BC_TYPES.H" #include "AMReX_Print.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "physics_info.hpp" #include "util/fextract.hpp" @@ -114,7 +114,7 @@ template <> AMREX_GPU_HOST_DEVICE auto RadSystem::ComputeFluxMe return ComputePlanckOpacity(rho, Tgas); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -145,7 +145,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(qu state_cc(i, j, k, RadSystem::x3GasMomentum_index) = 0.; }); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -215,7 +215,7 @@ auto problem_main() -> int // Problem 1: non-advecting pulse // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); double max_time = 4.8e-6; amrex::ParmParse pp; // NOLINT @@ -268,7 +268,7 @@ auto problem_main() -> int // Problem 2: advecting pulse // Problem initialization - RadhydroSimulation sim2(BCs_cc); + QuokkaSimulation sim2(BCs_cc); sim2.radiationReconstructionOrder_ = 3; // PPM sim2.stopTime_ = max_time; diff --git a/src/problems/RadhydroPulseGrey/test_radhydro_pulse_grey.cpp b/src/problems/RadhydroPulseGrey/test_radhydro_pulse_grey.cpp index 5f46b01c9..8c6536e0f 100644 --- a/src/problems/RadhydroPulseGrey/test_radhydro_pulse_grey.cpp +++ b/src/problems/RadhydroPulseGrey/test_radhydro_pulse_grey.cpp @@ -5,7 +5,7 @@ #include "test_radhydro_pulse_grey.hpp" #include "AMReX_BC_TYPES.H" #include "AMReX_Print.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "physics_info.hpp" #include "util/fextract.hpp" @@ -120,7 +120,7 @@ template <> AMREX_GPU_HOST_DEVICE auto RadSystem::ComputeFluxMe return sigma / rho; } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -151,7 +151,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(qu state_cc(i, j, k, RadSystem::x3GasMomentum_index) = 0.; }); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -211,7 +211,7 @@ auto problem_main() -> int // Problem 1: non-advecting pulse // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); double max_time = 4.8e-5; amrex::ParmParse pp; // NOLINT @@ -262,7 +262,7 @@ auto problem_main() -> int // Problem 2: advecting radiation // Problem initialization - RadhydroSimulation sim2(BCs_cc); + QuokkaSimulation sim2(BCs_cc); sim2.radiationReconstructionOrder_ = 3; // PPM sim2.stopTime_ = max_time; diff --git a/src/problems/RadhydroPulseMGconst/test_radhydro_pulse_MG_const_kappa.cpp b/src/problems/RadhydroPulseMGconst/test_radhydro_pulse_MG_const_kappa.cpp index e2ec0b8a8..b920b6fdf 100644 --- a/src/problems/RadhydroPulseMGconst/test_radhydro_pulse_MG_const_kappa.cpp +++ b/src/problems/RadhydroPulseMGconst/test_radhydro_pulse_MG_const_kappa.cpp @@ -6,7 +6,7 @@ #include "test_radhydro_pulse_MG_const_kappa.hpp" #include "AMReX_BC_TYPES.H" #include "AMReX_Print.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "physics_info.hpp" #include "util/fextract.hpp" @@ -120,7 +120,7 @@ template <> AMREX_GPU_HOST_DEVICE auto RadSystem::ComputeFluxMeanOpac return ComputePlanckOpacity(rho, Tgas); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -198,7 +198,7 @@ RadSystem::DefineOpacityExponentsAndLowerValues(amrex::GpuArray void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -264,7 +264,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 3; // PPM sim.stopTime_ = max_time; @@ -325,7 +325,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim2(BCs_cc2); + QuokkaSimulation sim2(BCs_cc2); sim2.radiationReconstructionOrder_ = 3; // PPM sim2.stopTime_ = max_time; diff --git a/src/problems/RadhydroPulseMGint/test_radhydro_pulse_MG_int.cpp b/src/problems/RadhydroPulseMGint/test_radhydro_pulse_MG_int.cpp index f7d779df0..7be6a2a14 100644 --- a/src/problems/RadhydroPulseMGint/test_radhydro_pulse_MG_int.cpp +++ b/src/problems/RadhydroPulseMGint/test_radhydro_pulse_MG_int.cpp @@ -7,7 +7,7 @@ #include "AMReX_Array.H" #include "AMReX_BC_TYPES.H" #include "AMReX_Print.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "physics_info.hpp" #include "radiation/planck_integral.hpp" #include "radiation/radiation_system.hpp" @@ -215,7 +215,7 @@ template <> AMREX_GPU_HOST_DEVICE auto RadSystem::ComputeFluxMeanO return sigma / rho; } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -256,7 +256,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokk state_cc(i, j, k, RadSystem::x3GasMomentum_index) = 0.; }); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -315,7 +315,7 @@ auto problem_main() -> int // Problem 1: advecting pulse with multigroup integration // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 3; // PPM sim.stopTime_ = max_time; @@ -385,7 +385,7 @@ auto problem_main() -> int // Problem 2: exact opacity // Problem initialization - RadhydroSimulation sim2(BCs_cc); + QuokkaSimulation sim2(BCs_cc); sim2.radiationReconstructionOrder_ = 3; // PPM sim2.stopTime_ = max_time; diff --git a/src/problems/RadhydroShell/test_radhydro_shell.cpp b/src/problems/RadhydroShell/test_radhydro_shell.cpp index f17544b4d..13bfc1e86 100644 --- a/src/problems/RadhydroShell/test_radhydro_shell.cpp +++ b/src/problems/RadhydroShell/test_radhydro_shell.cpp @@ -25,7 +25,7 @@ #include "AMReX_REAL.H" #include "AMReX_Vector.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "math/interpolate.hpp" #include "radiation/radiation_system.hpp" @@ -145,7 +145,7 @@ amrex::Gpu::DeviceVector r_arr_g; amrex::Gpu::DeviceVector Erad_arr_g; amrex::Gpu::DeviceVector Frad_arr_g; -template <> void RadhydroSimulation::preCalculateInitialConditions() +template <> void QuokkaSimulation::preCalculateInitialConditions() { std::string filename = "./initial_conditions.txt"; std::ifstream fstream(filename, std::ios::in); @@ -179,7 +179,7 @@ template <> void RadhydroSimulation::preCalculateInitialConditions amrex::Gpu::streamSynchronizeAll(); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -264,7 +264,7 @@ AMREX_GPU_DEVICE AMREX_FORCE_INLINE auto vec_dot_r(amrex::GpuArray void RadhydroSimulation::computeAfterTimestep() { +template <> void QuokkaSimulation::computeAfterTimestep() { // compute radial momentum for gas, radiation on level 0 // (assuming octant symmetry) @@ -318,7 +318,7 @@ template <> void RadhydroSimulation::computeAfterTimestep() { } #endif -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // tag cells for refinement @@ -406,7 +406,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.cflNumber_ = 0.3; sim.densityFloor_ = 1.0e-8 * rho_0; diff --git a/src/problems/RadhydroShock/test_radhydro_shock.cpp b/src/problems/RadhydroShock/test_radhydro_shock.cpp index 75d952f51..dd04e87a9 100644 --- a/src/problems/RadhydroShock/test_radhydro_shock.cpp +++ b/src/problems/RadhydroShock/test_radhydro_shock.cpp @@ -11,7 +11,7 @@ #include "AMReX_BLassert.H" #include "AMReX_ParallelDescriptor.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "test_radhydro_shock.hpp" #include "util/fextract.hpp" @@ -159,7 +159,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVect &i } } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -239,7 +239,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.cflNumber_ = CFL_number; sim.radiationCflNumber_ = CFL_number; diff --git a/src/problems/RadhydroShockCGS/test_radhydro_shock_cgs.cpp b/src/problems/RadhydroShockCGS/test_radhydro_shock_cgs.cpp index 371fb0020..940054e7b 100644 --- a/src/problems/RadhydroShockCGS/test_radhydro_shock_cgs.cpp +++ b/src/problems/RadhydroShockCGS/test_radhydro_shock_cgs.cpp @@ -156,7 +156,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVect &i } } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -240,7 +240,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.cflNumber_ = CFL_number; sim.radiationCflNumber_ = CFL_number; diff --git a/src/problems/RadhydroShockCGS/test_radhydro_shock_cgs.hpp b/src/problems/RadhydroShockCGS/test_radhydro_shock_cgs.hpp index cc2e2d49f..c88740e4f 100644 --- a/src/problems/RadhydroShockCGS/test_radhydro_shock_cgs.hpp +++ b/src/problems/RadhydroShockCGS/test_radhydro_shock_cgs.hpp @@ -17,7 +17,7 @@ #include // internal headers -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "math/interpolate.hpp" #include "radiation/radiation_system.hpp" diff --git a/src/problems/RadhydroShockMultigroup/test_radhydro_shock_multigroup.cpp b/src/problems/RadhydroShockMultigroup/test_radhydro_shock_multigroup.cpp index bc7b720d3..d45ac1246 100644 --- a/src/problems/RadhydroShockMultigroup/test_radhydro_shock_multigroup.cpp +++ b/src/problems/RadhydroShockMultigroup/test_radhydro_shock_multigroup.cpp @@ -164,7 +164,7 @@ AMRSimulation::setCustomBoundaryConditions(const amrex::IntVect &i } } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray const dx = grid_elem.dx_; @@ -240,7 +240,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 3; // PPM sim.reconstructionOrder_ = 3; // PPM diff --git a/src/problems/RadhydroShockMultigroup/test_radhydro_shock_multigroup.hpp b/src/problems/RadhydroShockMultigroup/test_radhydro_shock_multigroup.hpp index d08606a08..942c5d01e 100644 --- a/src/problems/RadhydroShockMultigroup/test_radhydro_shock_multigroup.hpp +++ b/src/problems/RadhydroShockMultigroup/test_radhydro_shock_multigroup.hpp @@ -17,7 +17,7 @@ #include // internal headers -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "math/interpolate.hpp" #include "radiation/radiation_system.hpp" diff --git a/src/problems/RadhydroUniformAdvecting/test_radhydro_uniform_advecting.cpp b/src/problems/RadhydroUniformAdvecting/test_radhydro_uniform_advecting.cpp index f35364ad5..c1085a384 100644 --- a/src/problems/RadhydroUniformAdvecting/test_radhydro_uniform_advecting.cpp +++ b/src/problems/RadhydroUniformAdvecting/test_radhydro_uniform_advecting.cpp @@ -5,7 +5,7 @@ #include "test_radhydro_uniform_advecting.hpp" #include "AMReX_BC_TYPES.H" #include "AMReX_Print.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "physics_info.hpp" #include "util/fextract.hpp" @@ -85,7 +85,7 @@ template <> AMREX_GPU_HOST_DEVICE auto RadSystem::ComputeFluxMeanO return ComputePlanckOpacity(rho, Tgas); } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object const amrex::Box &indexRange = grid_elem.indexRange_; @@ -154,7 +154,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.radiationReconstructionOrder_ = 3; // PPM sim.stopTime_ = max_time; diff --git a/src/problems/RandomBlast/blast.cpp b/src/problems/RandomBlast/blast.cpp index 7b1dbd7fd..bcf749315 100644 --- a/src/problems/RandomBlast/blast.cpp +++ b/src/problems/RandomBlast/blast.cpp @@ -22,7 +22,7 @@ #include "AMReX_TableData.H" #include "AMReX_iMultiFab.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "blast.hpp" #include "cooling/GrackleLikeCooling.hpp" #include "fundamental_constants.H" @@ -74,7 +74,7 @@ template <> struct SimulationData { int use_periodic_bc = 1; // default is periodic }; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // set initial conditions const amrex::Box &indexRange = grid_elem.indexRange_; @@ -103,7 +103,7 @@ void injectEnergy(amrex::MultiFab &mf, amrex::GpuArray con amrex::GpuArray const &dx, SimulationData const &userData) { // inject energy into cells with stochastic sampling - const BL_PROFILE("RadhydroSimulation::injectEnergy()"); + const BL_PROFILE("QuokkaSimulation::injectEnergy()"); const Real cell_vol = AMREX_D_TERM(dx[0], *dx[1], *dx[2]); // cm^3 const Real rho_eint_blast = userData.E_blast / cell_vol; // ergs cm^-3 @@ -162,7 +162,7 @@ void injectEnergy(amrex::MultiFab &mf, amrex::GpuArray con } } -template <> void RadhydroSimulation::computeBeforeTimestep() +template <> void QuokkaSimulation::computeBeforeTimestep() { // compute how many (and where) SNe will go off on the this coarse timestep // sample from Poisson distribution @@ -197,13 +197,13 @@ template <> void RadhydroSimulation::computeBeforeTimestep() // TODO(ben): need to force refinement to highest level for cells near particles } -template <> void RadhydroSimulation::computeAfterLevelAdvance(int lev, Real /*time*/, Real /*dt_lev*/, int /*ncycle*/) +template <> void QuokkaSimulation::computeAfterLevelAdvance(int lev, Real /*time*/, Real /*dt_lev*/, int /*ncycle*/) { // compute operator split physics injectEnergy(state_new_cc_[lev], geom[lev].ProbLoArray(), geom[lev].ProbHiArray(), geom[lev].CellSizeArray(), userData_); } -template <> void RadhydroSimulation::computeAfterTimestep() +template <> void QuokkaSimulation::computeAfterTimestep() { // check conservation of mass static auto const &dx = geom[0].CellSizeArray(); @@ -225,7 +225,7 @@ template <> void RadhydroSimulation::computeAfterTimestep() } } -template <> void RadhydroSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_cc_in) const +template <> void QuokkaSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_cc_in) const { // compute derived variables and save in 'mf' if (dname == "temperature") { @@ -252,7 +252,7 @@ template <> void RadhydroSimulation::ComputeDerivedVar(int lev, std } } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, Real /*time*/, int /*ngrow*/) { // tag cells for refinement const Real q_min = 1e-5 * rho0; // minimum density for refinement @@ -338,7 +338,7 @@ auto problem_main() -> int } } - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.densityFloor_ = 1.0e-5 * rho0; // density floor (to prevent vacuum) sim.userData_.SN_rate_per_vol = SN_rate_per_vol; sim.userData_.refine_threshold = refine_threshold; diff --git a/src/problems/RayleighTaylor2D/test_hydro2d_rt.cpp b/src/problems/RayleighTaylor2D/test_hydro2d_rt.cpp index c7089f942..231742451 100644 --- a/src/problems/RayleighTaylor2D/test_hydro2d_rt.cpp +++ b/src/problems/RayleighTaylor2D/test_hydro2d_rt.cpp @@ -12,7 +12,7 @@ #include "AMReX_BLassert.H" #include "AMReX_ParmParse.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" struct RTProblem { @@ -43,7 +43,7 @@ amrex::Real constexpr g_x = 0; amrex::Real constexpr g_y = -0.1; amrex::Real constexpr g_z = 0; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -95,7 +95,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokk } template <> -void RadhydroSimulation::addStrangSplitSources(amrex::MultiFab &state_mf, const int /*lev*/, const amrex::Real /*time*/, const amrex::Real dt) +void QuokkaSimulation::addStrangSplitSources(amrex::MultiFab &state_mf, const int /*lev*/, const amrex::Real /*time*/, const amrex::Real dt) { // add gravitational source terms const auto state = state_mf.arrays(); @@ -127,7 +127,7 @@ void RadhydroSimulation::addStrangSplitSources(amrex::MultiFab &state amrex::Gpu::streamSynchronize(); } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // tag cells for refinement @@ -193,7 +193,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); // initialize sim.setInitialConditions(); diff --git a/src/problems/RayleighTaylor3D/test_hydro3d_rt.cpp b/src/problems/RayleighTaylor3D/test_hydro3d_rt.cpp index 42deb026d..f4ab35faa 100644 --- a/src/problems/RayleighTaylor3D/test_hydro3d_rt.cpp +++ b/src/problems/RayleighTaylor3D/test_hydro3d_rt.cpp @@ -13,7 +13,7 @@ #include "AMReX_ParallelDescriptor.H" #include "AMReX_ParmParse.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" struct RTProblem { @@ -44,7 +44,7 @@ amrex::Real constexpr g_x = 0; amrex::Real constexpr g_y = 0; amrex::Real constexpr g_z = -0.1; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // extract variables required from the geom object amrex::GpuArray dx = grid_elem.dx_; @@ -96,7 +96,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokk } template <> -void RadhydroSimulation::addStrangSplitSources(amrex::MultiFab &state_mf, const int /*lev*/, const amrex::Real /*time*/, const amrex::Real dt) +void QuokkaSimulation::addStrangSplitSources(amrex::MultiFab &state_mf, const int /*lev*/, const amrex::Real /*time*/, const amrex::Real dt) { // add gravitational source terms const auto state = state_mf.arrays(); @@ -127,7 +127,7 @@ void RadhydroSimulation::addStrangSplitSources(amrex::MultiFab &state amrex::Gpu::streamSynchronize(); } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // tag cells for refinement @@ -160,7 +160,7 @@ template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxA amrex::Gpu::streamSynchronize(); } -template <> void RadhydroSimulation::computeAfterTimestep() +template <> void QuokkaSimulation::computeAfterTimestep() { // compute 1D mixing profile, save to text file static amrex::Long cycle = 0; @@ -224,7 +224,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); // initialize sim.setInitialConditions(); diff --git a/src/problems/ShockCloud/cloud.cpp b/src/problems/ShockCloud/cloud.cpp index 7f8ece6e3..5a2bf7f69 100644 --- a/src/problems/ShockCloud/cloud.cpp +++ b/src/problems/ShockCloud/cloud.cpp @@ -22,7 +22,7 @@ #include "AMReX_Reduce.H" #include "AMReX_SPACE.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "cooling/TabulatedCooling.hpp" #include "fundamental_constants.H" #include "hydro/EOS.hpp" @@ -77,7 +77,7 @@ AMREX_GPU_MANAGED Real v_wind = 0; // NOLINT(cppcoreguidelines-avoid-non-const- AMREX_GPU_MANAGED Real P_wind = 0; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) AMREX_GPU_MANAGED Real delta_vx = 0; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid) { amrex::GpuArray const dx = grid.dx_; amrex::GpuArray prob_lo = grid.prob_lo_; @@ -198,7 +198,7 @@ AMREX_GPU_DEVICE AMREX_FORCE_INLINE void AMRSimulation::setCustomBou } } -template <> void RadhydroSimulation::computeAfterTimestep() +template <> void QuokkaSimulation::computeAfterTimestep() { const amrex::Real dt_coarse = dt_[0]; const amrex::Real time = tNew_[0]; @@ -266,7 +266,7 @@ template <> void RadhydroSimulation::computeAfterTimestep() } } -template <> void RadhydroSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_in) const +template <> void QuokkaSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_in) const { // compute derived variables and save in 'mf' @@ -450,7 +450,7 @@ AMREX_GPU_DEVICE AMREX_FORCE_INLINE auto ComputeCellTemp(int i, int j, int k, am return quokka::TabulatedCooling::ComputeTgasFromEgas(rho, Eint, gamma, tables); } -template <> auto RadhydroSimulation::ComputeStatistics() -> std::map +template <> auto QuokkaSimulation::ComputeStatistics() -> std::map { // compute scalar statistics std::map stats; @@ -600,7 +600,7 @@ template <> auto RadhydroSimulation::ComputeStatistics() -> std::map return stats; } -template <> auto RadhydroSimulation::ComputeProjections(const int dir) const -> std::unordered_map> +template <> auto QuokkaSimulation::ComputeProjections(const int dir) const -> std::unordered_map> { std::unordered_map> proj; @@ -633,7 +633,7 @@ template <> auto RadhydroSimulation::ComputeProjections(const int di return proj; } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, Real /*time*/, int /*ngrow*/) { // tag cells for refinement const int Ncells_per_lcool = 10; @@ -665,7 +665,7 @@ template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBox auto problem_main() -> int { // Problem initialization - constexpr int nvars = RadhydroSimulation::nvarTotal_cc_; + constexpr int nvars = QuokkaSimulation::nvarTotal_cc_; amrex::Vector boundaryConditions(nvars); for (int n = 0; n < nvars; ++n) { boundaryConditions[n].setLo(0, amrex::BCType::ext_dir); // Dirichlet @@ -677,7 +677,7 @@ auto problem_main() -> int boundaryConditions[n].setLo(2, amrex::BCType::int_dir); boundaryConditions[n].setHi(2, amrex::BCType::int_dir); } - RadhydroSimulation sim(boundaryConditions); + QuokkaSimulation sim(boundaryConditions); // Read problem parameters amrex::ParmParse const pp; diff --git a/src/problems/SphericalCollapse/spherical_collapse.cpp b/src/problems/SphericalCollapse/spherical_collapse.cpp index 2c7ff18c2..5e87b9ef6 100644 --- a/src/problems/SphericalCollapse/spherical_collapse.cpp +++ b/src/problems/SphericalCollapse/spherical_collapse.cpp @@ -19,7 +19,7 @@ #include "AMReX_Print.H" #include "AMReX_SPACE.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/hydro_system.hpp" #include "spherical_collapse.hpp" @@ -47,7 +47,7 @@ template <> struct Physics_Traits { static constexpr int nGroups = 1; // number of radiation groups }; -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // set initial conditions amrex::GpuArray dx = grid_elem.dx_; @@ -85,7 +85,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid }); } -template <> void RadhydroSimulation::createInitialParticles() +template <> void QuokkaSimulation::createInitialParticles() { // add particles at random positions in the box const bool generate_on_root_rank = true; @@ -98,7 +98,7 @@ template <> void RadhydroSimulation::createInitialParticles() CICParticles->InitRandom(num_particles, iseed, pdata, generate_on_root_rank); } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // tag cells for refinement const Real q_min = 5.0; // minimum density for refinement @@ -118,7 +118,7 @@ template <> void RadhydroSimulation::ErrorEst(int lev, amrex::T } } -template <> void RadhydroSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_cc_in) const +template <> void QuokkaSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_cc_in) const { // compute derived variables and save in 'mf' if (dname == "gpot") { @@ -159,7 +159,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.doPoissonSolve_ = 1; // enable self-gravity // initialize diff --git a/src/problems/StarCluster/star_cluster.cpp b/src/problems/StarCluster/star_cluster.cpp index 29188afe8..84127f519 100644 --- a/src/problems/StarCluster/star_cluster.cpp +++ b/src/problems/StarCluster/star_cluster.cpp @@ -23,7 +23,7 @@ #include "AMReX_SPACE.H" #include "AMReX_TableData.H" -#include "RadhydroSimulation.hpp" +#include "QuokkaSimulation.hpp" #include "hydro/EOS.hpp" #include "hydro/hydro_system.hpp" #include "star_cluster.hpp" @@ -71,7 +71,7 @@ template <> struct SimulationData { Real alpha_vir{}; }; -template <> void RadhydroSimulation::preCalculateInitialConditions() +template <> void QuokkaSimulation::preCalculateInitialConditions() { static bool isSamplingDone = false; if (!isSamplingDone) { @@ -115,7 +115,7 @@ template <> void RadhydroSimulation::preCalculateInitialConditions( } } -template <> void RadhydroSimulation::setInitialConditionsOnGrid(quokka::grid grid_elem) +template <> void QuokkaSimulation::setInitialConditionsOnGrid(quokka::grid const &grid_elem) { // set initial conditions amrex::GpuArray const dx = grid_elem.dx_; @@ -165,7 +165,7 @@ template <> void RadhydroSimulation::setInitialConditionsOnGrid(quo }); } -template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) +template <> void QuokkaSimulation::ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real /*time*/, int /*ngrow*/) { // refine on Jeans length const int N_cells = 4; // inverse of the 'Jeans number' [Truelove et al. (1997)] @@ -186,7 +186,7 @@ template <> void RadhydroSimulation::ErrorEst(int lev, amrex::TagBo }); } -template <> void RadhydroSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_cc_in) const +template <> void QuokkaSimulation::ComputeDerivedVar(int lev, std::string const &dname, amrex::MultiFab &mf, const int ncomp_cc_in) const { // compute derived variables and save in 'mf' if (dname == "log_density") { @@ -229,7 +229,7 @@ auto problem_main() -> int } // Problem initialization - RadhydroSimulation sim(BCs_cc); + QuokkaSimulation sim(BCs_cc); sim.doPoissonSolve_ = 1; // enable self-gravity sim.densityFloor_ = 0.01; diff --git a/src/simulation.hpp b/src/simulation.hpp index f9cdf5211..6f52f1871 100644 --- a/src/simulation.hpp +++ b/src/simulation.hpp @@ -221,8 +221,8 @@ template class AMRSimulation : public amrex::AmrCore virtual auto computeExtraPhysicsTimestep(int lev) -> amrex::Real = 0; virtual void advanceSingleTimestepAtLevel(int lev, amrex::Real time, amrex::Real dt_lev, int ncycle) = 0; virtual void preCalculateInitialConditions() = 0; - virtual void setInitialConditionsOnGrid(quokka::grid grid_elem) = 0; - virtual void setInitialConditionsOnGridFaceVars(quokka::grid grid_elem) = 0; + virtual void setInitialConditionsOnGrid(quokka::grid const &grid_elem) = 0; + virtual void setInitialConditionsOnGridFaceVars(quokka::grid const &grid_elem) = 0; virtual void createInitialParticles() = 0; virtual void computeBeforeTimestep() = 0; virtual void computeAfterTimestep() = 0; @@ -1576,7 +1576,7 @@ AMRSimulation::setCustomBoundaryConditionsFaceVar(const amrex::IntVec // Compute a new multifab 'mf' by copying in state from valid region and filling // ghost cells // NOTE: This implementation is only used by AdvectionSimulation. -// RadhydroSimulation provides its own implementation. +// QuokkaSimulation provides its own implementation. template void AMRSimulation::FillPatch(int lev, amrex::Real time, amrex::MultiFab &mf, int icomp, int ncomp, quokka::centering cen, quokka::direction dir, FillPatchType fptype)