From 24a617ea3c143469afa0fb1d3c42871f5d8082b6 Mon Sep 17 00:00:00 2001 From: Severin Diederichs Date: Fri, 23 Jun 2023 12:39:17 +0200 Subject: [PATCH 1/4] start proper logic --- src/utils/IOUtil.H | 19 +++++++++++++++---- src/utils/IOUtil.cpp | 10 +++++----- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/utils/IOUtil.H b/src/utils/IOUtil.H index 7c32bca1ab..de0df064ee 100644 --- a/src/utils/IOUtil.H +++ b/src/utils/IOUtil.H @@ -39,7 +39,7 @@ namespace utils * (used for compatibility with the openPMD API) */ std::vector - getReversedVec( const amrex::IntVect& v ); + getReversedVec ( const amrex::IntVect& v ); /** \brief * Convert Real* pointer to a std::vector, @@ -47,11 +47,22 @@ namespace utils * (used for compatibility with the openPMD API) */ std::vector - getReversedVec( const amrex::Real* v ); + getReversedVec ( const amrex::Real* v ); + + /** \brief + * returns whether output should be writen to file + */ + bool doOutput (int output_step, int max_step, + amrex::Real output_time, amrex::Real max_time) const + { + return m_beam_output_period > 0 && m_output_beam_names.size() > 0 && ( + (output_time == max_time) || + (output_step == max_step) || + (output_step % m_beam_output_period == 0) ); #ifdef HIPACE_USE_OPENPMD std::pair< std::string, std::string > - name2openPMD( std::string const& fullName ); + name2openPMD ( std::string const& fullName ); /** Get the openPMD physical dimensionality of a record * @@ -59,7 +70,7 @@ namespace utils * @return map with base quantities and power scaling */ std::map< openPMD::UnitDimension, double > - getUnitDimension( std::string const & record_name ); + getUnitDimension ( std::string const & record_name ); #endif } diff --git a/src/utils/IOUtil.cpp b/src/utils/IOUtil.cpp index db8c145028..511e580713 100644 --- a/src/utils/IOUtil.cpp +++ b/src/utils/IOUtil.cpp @@ -14,7 +14,7 @@ std::vector< double > -utils::getRelativeCellPosition(amrex::FArrayBox const& fab) +utils::getRelativeCellPosition (amrex::FArrayBox const& fab) { amrex::Box const box = fab.box(); amrex::IndexType const idx_type = box.ixType(); @@ -31,7 +31,7 @@ utils::getRelativeCellPosition(amrex::FArrayBox const& fab) } std::vector -utils::getReversedVec( const amrex::IntVect& v ) +utils::getReversedVec ( const amrex::IntVect& v ) { // Convert the IntVect v to and std::vector u std::vector u = { @@ -49,7 +49,7 @@ utils::getReversedVec( const amrex::IntVect& v ) } std::vector -utils::getReversedVec( const amrex::Real* v ) +utils::getReversedVec ( const amrex::Real* v ) { // Convert Real* v to and std::vector u std::vector u = { @@ -68,7 +68,7 @@ utils::getReversedVec( const amrex::Real* v ) #ifdef HIPACE_USE_OPENPMD std::pair< std::string, std::string > -utils::name2openPMD( std::string const& fullName ) +utils::name2openPMD ( std::string const& fullName ) { std::string record_name = fullName; std::string component_name = openPMD::RecordComponent::SCALAR; @@ -87,7 +87,7 @@ utils::name2openPMD( std::string const& fullName ) * @return map with base quantities and power scaling */ std::map< openPMD::UnitDimension, double > -utils::getUnitDimension( std::string const & record_name ) +utils::getUnitDimension ( std::string const & record_name ) { if( record_name == "position" ) return { From 3be0c207b0085c4140ebc5607d8b85e533fa3c2f Mon Sep 17 00:00:00 2001 From: Severin Diederichs Date: Fri, 23 Jun 2023 13:16:36 +0200 Subject: [PATCH 2/4] unify outputs --- src/Hipace.cpp | 5 +++-- src/diagnostics/Diagnostic.H | 16 ++++++++-------- src/particles/beam/BeamParticleContainer.H | 9 +++------ src/particles/beam/BeamParticleContainer.cpp | 6 ------ src/particles/beam/MultiBeam.H | 7 +++++-- src/particles/beam/MultiBeam.cpp | 14 ++++++++++---- src/utils/IOUtil.H | 14 +++++++------- src/utils/IOUtil.cpp | 10 ++++++++++ 8 files changed, 46 insertions(+), 35 deletions(-) diff --git a/src/Hipace.cpp b/src/Hipace.cpp index 50f34474e7..c77e68fe57 100644 --- a/src/Hipace.cpp +++ b/src/Hipace.cpp @@ -466,7 +466,7 @@ Hipace::Evolve () // exit loop over time steps, if max time is exceeded if (m_physical_time > m_max_time) break; - m_multi_beam.InSituWriteToFile(step, m_physical_time, m_3D_geom[0]); + m_multi_beam.InSituWriteToFile(step, m_physical_time, m_3D_geom[0], m_max_step, m_max_time); m_multi_plasma.InSituWriteToFile(step, m_physical_time, m_3D_geom[0]); // printing and resetting predictor corrector loop diagnostics @@ -501,7 +501,8 @@ Hipace::SolveOneSlice (int islice, const int islice_local, int step) // for function, the parallelcontext is the transverse communicator amrex::ParallelContext::push(m_comm_xy); - m_multi_beam.InSituComputeDiags(step, islice, islice_local); + m_multi_beam.InSituComputeDiags(step, islice, islice_local, m_max_step, + m_physical_time, m_max_time); m_multi_plasma.InSituComputeDiags(step, islice); // Get this laser slice from the 3D array diff --git a/src/diagnostics/Diagnostic.H b/src/diagnostics/Diagnostic.H index 9350613651..f838bb2e82 100644 --- a/src/diagnostics/Diagnostic.H +++ b/src/diagnostics/Diagnostic.H @@ -8,6 +8,8 @@ #ifndef DIAGNOSTIC_H_ #define DIAGNOSTIC_H_ +#include "utils/IOUtil.H" + #include #include @@ -74,10 +76,9 @@ public: int output_step, int max_step, amrex::Real output_time, amrex::Real max_time) { - return fd.m_output_period > 0 && fd.m_nfields_with_laser > 0 && ( - (output_time == max_time) || - (output_step == max_step) || - (output_step % fd.m_output_period == 0) ); + return fd.m_nfields_with_laser > 0 && + utils::doOutput(fd.m_output_period, output_step, max_step, + output_time, max_time); } /** \brief determines if any field diagnostic has any output on in this time step @@ -106,10 +107,9 @@ public: bool hasBeamOutput (int output_step, int max_step, amrex::Real output_time, amrex::Real max_time) const { - return m_beam_output_period > 0 && m_output_beam_names.size() > 0 && ( - (output_time == max_time) || - (output_step == max_step) || - (output_step % m_beam_output_period == 0) ); + return m_output_beam_names.size() > 0 && + utils::doOutput(m_beam_output_period, output_step, max_step, + output_time, max_time); } /** \brief determines if any field or beam diagnostic has any output on in this time step diff --git a/src/particles/beam/BeamParticleContainer.H b/src/particles/beam/BeamParticleContainer.H index 5558901324..0e87f192ed 100644 --- a/src/particles/beam/BeamParticleContainer.H +++ b/src/particles/beam/BeamParticleContainer.H @@ -185,9 +185,9 @@ public: const int which_slice, const int islice_local, const int nghost); amrex::Long TotalNumberOfParticles (bool only_valid=true, bool only_local=false) const; - - bool doInSitu (int step); - + /** How often the insitu beam diagnostics should be computed and written + * Default is 0, meaning no output */ + int m_insitu_period {0}; private: std::string m_name; /**< name of the species */ amrex::Real m_zmin; /**< Min longitudinal particle position of the beam */ @@ -249,9 +249,6 @@ private: amrex::Vector m_insitu_sum_idata; /** Prefix/path for the output files */ std::string m_insitu_file_prefix = "diags/insitu"; - /** How often the insitu beam diagnostics should be computed and written - * Default is 0, meaning no output */ - int m_insitu_period {0}; }; #endif diff --git a/src/particles/beam/BeamParticleContainer.cpp b/src/particles/beam/BeamParticleContainer.cpp index 2d02c83a0d..745f5b6faf 100644 --- a/src/particles/beam/BeamParticleContainer.cpp +++ b/src/particles/beam/BeamParticleContainer.cpp @@ -304,12 +304,6 @@ void BeamParticleContainer::TagByLevel (const int current_N_level, ); } -bool -BeamParticleContainer::doInSitu (int step) -{ - return (m_insitu_period > 0 && step % m_insitu_period == 0); -} - void BeamParticleContainer::InSituComputeDiags (int islice, int islice_local) { diff --git a/src/particles/beam/MultiBeam.H b/src/particles/beam/MultiBeam.H index f6f40ceba4..3423fd0df2 100644 --- a/src/particles/beam/MultiBeam.H +++ b/src/particles/beam/MultiBeam.H @@ -84,8 +84,11 @@ public: * \param[in] islice current slice, on which diags are computed. * \param[in] islice_local local index of the slice */ - void InSituComputeDiags (int step, int islice, int islice_local); - void InSituWriteToFile (int step, amrex::Real time, const amrex::Geometry& geom); + void InSituComputeDiags (int step, int islice, int islice_local, + int max_step, amrex::Real physical_time, + amrex::Real max_time); + void InSituWriteToFile (int step, amrex::Real time, const amrex::Geometry& geom, + int max_step, amrex::Real max_time); /** Loop over species and init them * \param[in] geom Simulation geometry * \return physical time at which the simulation will start diff --git a/src/particles/beam/MultiBeam.cpp b/src/particles/beam/MultiBeam.cpp index 2b523072b3..689de51ab6 100644 --- a/src/particles/beam/MultiBeam.cpp +++ b/src/particles/beam/MultiBeam.cpp @@ -10,6 +10,7 @@ #include "particles/sorting/SliceSort.H" #include "particles/pusher/BeamParticleAdvance.H" #include "utils/DeprecatedInput.H" +#include "utils/IOUtil.H" #include "utils/HipaceProfilerWrapper.H" MultiBeam::MultiBeam () @@ -215,20 +216,25 @@ MultiBeam::PackLocalGhostParticles (int it) } void -MultiBeam::InSituComputeDiags (int step, int islice, int islice_local) +MultiBeam::InSituComputeDiags (int step, int islice, int islice_local, + int max_step, amrex::Real physical_time, + amrex::Real max_time) { for (int i = 0; i < m_nbeams; ++i) { - if (m_all_beams[i].doInSitu(step)) { + if (utils::doOutput(m_all_beams[i].m_insitu_period, step, + max_step, physical_time, max_time)) { m_all_beams[i].InSituComputeDiags(islice, islice_local); } } } void -MultiBeam::InSituWriteToFile (int step, amrex::Real time, const amrex::Geometry& geom) +MultiBeam::InSituWriteToFile (int step, amrex::Real time, const amrex::Geometry& geom, + int max_step, amrex::Real max_time) { for (auto& beam : m_all_beams) { - if (beam.doInSitu(step)) { + if (utils::doOutput(beam.m_insitu_period, step, + max_step, time, max_time)) { beam.InSituWriteToFile(step, time, geom); } } diff --git a/src/utils/IOUtil.H b/src/utils/IOUtil.H index de0df064ee..517d5523e3 100644 --- a/src/utils/IOUtil.H +++ b/src/utils/IOUtil.H @@ -51,14 +51,14 @@ namespace utils /** \brief * returns whether output should be writen to file + * \param[in] output_period period of the output + * \param[in] output_step current step + * \param[in] max_step maximum step of simulation + * \param[in] output_time physical time of the current step + * \param[in] max_time maximum simulation time */ - bool doOutput (int output_step, int max_step, - amrex::Real output_time, amrex::Real max_time) const - { - return m_beam_output_period > 0 && m_output_beam_names.size() > 0 && ( - (output_time == max_time) || - (output_step == max_step) || - (output_step % m_beam_output_period == 0) ); + bool doOutput (int output_period, int output_step, int max_step, + amrex::Real output_time, amrex::Real max_time); #ifdef HIPACE_USE_OPENPMD std::pair< std::string, std::string > diff --git a/src/utils/IOUtil.cpp b/src/utils/IOUtil.cpp index 511e580713..3ab2ab0595 100644 --- a/src/utils/IOUtil.cpp +++ b/src/utils/IOUtil.cpp @@ -66,6 +66,16 @@ utils::getReversedVec ( const amrex::Real* v ) return u; } +bool +utils::doOutput (int output_period, int output_step, int max_step, + amrex::Real output_time, amrex::Real max_time) +{ + return output_period > 0 && ( + (output_time == max_time) || + (output_step == max_step) || + (output_step % output_period == 0) ); +} + #ifdef HIPACE_USE_OPENPMD std::pair< std::string, std::string > utils::name2openPMD ( std::string const& fullName ) From c15700b2c29e29bb477ba0b0acfcc45751a2c240 Mon Sep 17 00:00:00 2001 From: Severin Diederichs Date: Fri, 23 Jun 2023 13:27:31 +0200 Subject: [PATCH 3/4] add plasma, fix doc --- src/Hipace.cpp | 4 ++-- src/particles/beam/MultiBeam.H | 10 ++++++++++ src/particles/beam/MultiBeam.cpp | 6 +++--- src/particles/plasma/MultiPlasma.H | 16 ++++++++++++++-- src/particles/plasma/MultiPlasma.cpp | 13 +++++++++---- src/particles/plasma/PlasmaParticleContainer.H | 8 +++----- src/particles/plasma/PlasmaParticleContainer.cpp | 6 ------ 7 files changed, 41 insertions(+), 22 deletions(-) diff --git a/src/Hipace.cpp b/src/Hipace.cpp index c77e68fe57..79e06e3649 100644 --- a/src/Hipace.cpp +++ b/src/Hipace.cpp @@ -467,7 +467,7 @@ Hipace::Evolve () if (m_physical_time > m_max_time) break; m_multi_beam.InSituWriteToFile(step, m_physical_time, m_3D_geom[0], m_max_step, m_max_time); - m_multi_plasma.InSituWriteToFile(step, m_physical_time, m_3D_geom[0]); + m_multi_plasma.InSituWriteToFile(step, m_physical_time, m_3D_geom[0], m_max_step, m_max_time); // printing and resetting predictor corrector loop diagnostics if (m_verbose>=2 && !m_explicit) amrex::AllPrint() << "Rank " << rank << @@ -503,7 +503,7 @@ Hipace::SolveOneSlice (int islice, const int islice_local, int step) m_multi_beam.InSituComputeDiags(step, islice, islice_local, m_max_step, m_physical_time, m_max_time); - m_multi_plasma.InSituComputeDiags(step, islice); + m_multi_plasma.InSituComputeDiags(step, islice, m_max_step, m_physical_time, m_max_time); // Get this laser slice from the 3D array m_multi_laser.Copy(islice, false); diff --git a/src/particles/beam/MultiBeam.H b/src/particles/beam/MultiBeam.H index 3423fd0df2..ebd1b5a4f9 100644 --- a/src/particles/beam/MultiBeam.H +++ b/src/particles/beam/MultiBeam.H @@ -83,10 +83,20 @@ public: * \param[in] step time step of simulation * \param[in] islice current slice, on which diags are computed. * \param[in] islice_local local index of the slice + * \param[in] max_step maximum time step of simulation + * \param[in] physical_time physical time at the given step + * \param[in] max_time maximum time of simulation */ void InSituComputeDiags (int step, int islice, int islice_local, int max_step, amrex::Real physical_time, amrex::Real max_time); + /** Write reduced beam diagnostics to file + * \param[in] step time step of simulation + * \param[in] time physical time at the given step + * \param[in] geom Simulation geometry + * \param[in] max_step maximum time step of simulation + * \param[in] max_time maximum time of simulation + */ void InSituWriteToFile (int step, amrex::Real time, const amrex::Geometry& geom, int max_step, amrex::Real max_time); /** Loop over species and init them diff --git a/src/particles/beam/MultiBeam.cpp b/src/particles/beam/MultiBeam.cpp index 689de51ab6..ccec477e37 100644 --- a/src/particles/beam/MultiBeam.cpp +++ b/src/particles/beam/MultiBeam.cpp @@ -220,10 +220,10 @@ MultiBeam::InSituComputeDiags (int step, int islice, int islice_local, int max_step, amrex::Real physical_time, amrex::Real max_time) { - for (int i = 0; i < m_nbeams; ++i) { - if (utils::doOutput(m_all_beams[i].m_insitu_period, step, + for (auto& beam : m_all_beams) { + if (utils::doOutput(beam.m_insitu_period, step, max_step, physical_time, max_time)) { - m_all_beams[i].InSituComputeDiags(islice, islice_local); + beam.InSituComputeDiags(islice, islice_local); } } } diff --git a/src/particles/plasma/MultiPlasma.H b/src/particles/plasma/MultiPlasma.H index 791db0614e..2ac504ea80 100644 --- a/src/particles/plasma/MultiPlasma.H +++ b/src/particles/plasma/MultiPlasma.H @@ -148,9 +148,21 @@ public: /** Compute reduced plasma diagnostics of current slice, store in member variable. * \param[in] step time step of simulation * \param[in] islice current slice, on which diags are computed. + * \param[in] max_step maximum time step of simulation + * \param[in] physical_time physical time at the given step + * \param[in] max_time maximum time of simulation */ - void InSituComputeDiags (int step, int islice); - void InSituWriteToFile (int step, amrex::Real time, const amrex::Geometry& geom); + void InSituComputeDiags (int step, int islice, int max_step, + amrex::Real physical_time, amrex::Real max_time); + /** Write reduced beam diagnostics to file + * \param[in] step time step of simulation + * \param[in] time physical time at the given step + * \param[in] geom Simulation geometry + * \param[in] max_step maximum time step of simulation + * \param[in] max_time maximum time of simulation + */ + void InSituWriteToFile (int step, amrex::Real time, const amrex::Geometry& geom, + int max_step, amrex::Real max_time); int m_sort_bin_size {32}; /**< Tile size to sort plasma particles */ diff --git a/src/particles/plasma/MultiPlasma.cpp b/src/particles/plasma/MultiPlasma.cpp index 674d904a97..068c4d5351 100644 --- a/src/particles/plasma/MultiPlasma.cpp +++ b/src/particles/plasma/MultiPlasma.cpp @@ -12,6 +12,7 @@ #include "particles/sorting/TileSort.H" #include "utils/HipaceProfilerWrapper.H" #include "utils/DeprecatedInput.H" +#include "utils/IOUtil.H" #include "Hipace.H" MultiPlasma::MultiPlasma () @@ -203,20 +204,24 @@ MultiPlasma::TagByLevel (const int current_N_level, amrex::Vector m_density_func; /**< Density function for the plasma */ @@ -186,7 +185,9 @@ public: int m_reorder_period = 0; /** 2D reordering index type. 0: cell, 1: node, 2: both */ amrex::IntVect m_reorder_idx_type = {0, 0, 0}; - + /** How often the insitu plasma diagnostics should be computed and written + * Default is 0, meaning no output */ + int m_insitu_period {0}; private: std::string m_name; /**< name of the species */ int m_nslices; /**< number of z slices of the domain */ @@ -215,9 +216,6 @@ private: amrex::Vector m_insitu_sum_idata; /** Prefix/path for the output files */ std::string m_insitu_file_prefix = "diags/plasma_insitu"; - /** How often the insitu plasma diagnostics should be computed and written - * Default is 0, meaning no output */ - int m_insitu_period {0}; }; /** \brief Iterator over boxes in a particle container */ diff --git a/src/particles/plasma/PlasmaParticleContainer.cpp b/src/particles/plasma/PlasmaParticleContainer.cpp index c3e159827f..081386500f 100644 --- a/src/particles/plasma/PlasmaParticleContainer.cpp +++ b/src/particles/plasma/PlasmaParticleContainer.cpp @@ -431,12 +431,6 @@ IonizationModule (const int lev, } } -bool -PlasmaParticleContainer::doInSitu (int step) -{ - return (m_insitu_period > 0 && step % m_insitu_period == 0); -} - void PlasmaParticleContainer::InSituComputeDiags (int islice) { From 730c30da704db5ffa783f1302777301cc3f39022 Mon Sep 17 00:00:00 2001 From: Severin Diederichs Date: Fri, 23 Jun 2023 13:50:32 +0200 Subject: [PATCH 4/4] better naming --- src/diagnostics/Diagnostic.H | 4 ++-- src/particles/beam/MultiBeam.cpp | 4 ++-- src/particles/plasma/MultiPlasma.cpp | 4 ++-- src/utils/IOUtil.H | 2 +- src/utils/IOUtil.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/diagnostics/Diagnostic.H b/src/diagnostics/Diagnostic.H index f838bb2e82..1e4559df0f 100644 --- a/src/diagnostics/Diagnostic.H +++ b/src/diagnostics/Diagnostic.H @@ -77,7 +77,7 @@ public: amrex::Real output_time, amrex::Real max_time) { return fd.m_nfields_with_laser > 0 && - utils::doOutput(fd.m_output_period, output_step, max_step, + utils::doDiagnostics(fd.m_output_period, output_step, max_step, output_time, max_time); } @@ -108,7 +108,7 @@ public: amrex::Real output_time, amrex::Real max_time) const { return m_output_beam_names.size() > 0 && - utils::doOutput(m_beam_output_period, output_step, max_step, + utils::doDiagnostics(m_beam_output_period, output_step, max_step, output_time, max_time); } diff --git a/src/particles/beam/MultiBeam.cpp b/src/particles/beam/MultiBeam.cpp index ccec477e37..f25587b451 100644 --- a/src/particles/beam/MultiBeam.cpp +++ b/src/particles/beam/MultiBeam.cpp @@ -221,7 +221,7 @@ MultiBeam::InSituComputeDiags (int step, int islice, int islice_local, amrex::Real max_time) { for (auto& beam : m_all_beams) { - if (utils::doOutput(beam.m_insitu_period, step, + if (utils::doDiagnostics(beam.m_insitu_period, step, max_step, physical_time, max_time)) { beam.InSituComputeDiags(islice, islice_local); } @@ -233,7 +233,7 @@ MultiBeam::InSituWriteToFile (int step, amrex::Real time, const amrex::Geometry& int max_step, amrex::Real max_time) { for (auto& beam : m_all_beams) { - if (utils::doOutput(beam.m_insitu_period, step, + if (utils::doDiagnostics(beam.m_insitu_period, step, max_step, time, max_time)) { beam.InSituWriteToFile(step, time, geom); } diff --git a/src/particles/plasma/MultiPlasma.cpp b/src/particles/plasma/MultiPlasma.cpp index 068c4d5351..46233015a2 100644 --- a/src/particles/plasma/MultiPlasma.cpp +++ b/src/particles/plasma/MultiPlasma.cpp @@ -208,7 +208,7 @@ MultiPlasma::InSituComputeDiags (int step, int islice, int max_step, amrex::Real physical_time, amrex::Real max_time) { for (auto& plasma : m_all_plasmas) { - if (utils::doOutput(plasma.m_insitu_period, step, + if (utils::doDiagnostics(plasma.m_insitu_period, step, max_step, physical_time, max_time)) { plasma.InSituComputeDiags(islice); } @@ -220,7 +220,7 @@ MultiPlasma::InSituWriteToFile (int step, amrex::Real time, const amrex::Geometr int max_step, amrex::Real max_time) { for (auto& plasma : m_all_plasmas) { - if (utils::doOutput(plasma.m_insitu_period, step, + if (utils::doDiagnostics(plasma.m_insitu_period, step, max_step, time, max_time)) { plasma.InSituWriteToFile(step, time, geom); } diff --git a/src/utils/IOUtil.H b/src/utils/IOUtil.H index 517d5523e3..fdfd93c82a 100644 --- a/src/utils/IOUtil.H +++ b/src/utils/IOUtil.H @@ -57,7 +57,7 @@ namespace utils * \param[in] output_time physical time of the current step * \param[in] max_time maximum simulation time */ - bool doOutput (int output_period, int output_step, int max_step, + bool doDiagnostics (int output_period, int output_step, int max_step, amrex::Real output_time, amrex::Real max_time); #ifdef HIPACE_USE_OPENPMD diff --git a/src/utils/IOUtil.cpp b/src/utils/IOUtil.cpp index 3ab2ab0595..8906b7bd3a 100644 --- a/src/utils/IOUtil.cpp +++ b/src/utils/IOUtil.cpp @@ -67,7 +67,7 @@ utils::getReversedVec ( const amrex::Real* v ) } bool -utils::doOutput (int output_period, int output_step, int max_step, +utils::doDiagnostics (int output_period, int output_step, int max_step, amrex::Real output_time, amrex::Real max_time) { return output_period > 0 && (