diff options
Diffstat (limited to 'Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp')
-rw-r--r-- | Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp index dea1c37ac..c63c3a0ad 100644 --- a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp +++ b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp @@ -29,7 +29,9 @@ FlushFormatOpenPMD::WriteToFile ( const amrex::Vector<int> iteration, const double time, const amrex::Vector<ParticleDiag>& particle_diags, int /*nlev*/, const std::string prefix, bool plot_raw_fields, - bool plot_raw_fields_guards, bool plot_raw_rho, bool plot_raw_F) const + bool plot_raw_fields_guards, bool plot_raw_rho, bool plot_raw_F, + bool isBTD, int snapshotID, const amrex::Geometry& full_BTD_snapshot, + bool isLastBTDFlush) const { WARPX_PROFILE("FlushFormatOpenPMD::WriteToFile()"); @@ -37,18 +39,25 @@ FlushFormatOpenPMD::WriteToFile ( !plot_raw_fields && !plot_raw_fields_guards && !plot_raw_rho && !plot_raw_F, "Cannot plot raw data with OpenPMD output format. Use plotfile instead."); + // we output at full steps of the coarsest level + int output_iteration = iteration[0]; + // in backtransformed diagnostics (BTD), we dump into a series of labframe + // snapshots + if( isBTD ) + output_iteration = snapshotID; + // Set step and output directory name. - m_OpenPMDPlotWriter->SetStep(iteration[0], prefix); + m_OpenPMDPlotWriter->SetStep(output_iteration, prefix, isBTD); // fields: only dumped for coarse level m_OpenPMDPlotWriter->WriteOpenPMDFields( - varnames, mf[0], geom[0], iteration[0], time); + varnames, mf[0], geom[0], output_iteration, time, isBTD, full_BTD_snapshot); // particles: all (reside only on locally finest level) m_OpenPMDPlotWriter->WriteOpenPMDParticles(particle_diags); // signal that no further updates will be written to this iteration - m_OpenPMDPlotWriter->CloseStep(); + m_OpenPMDPlotWriter->CloseStep(isBTD, isLastBTDFlush); } FlushFormatOpenPMD::~FlushFormatOpenPMD (){ |