aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp
diff options
context:
space:
mode:
authorGravatar Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com> 2021-02-21 10:25:53 -0800
committerGravatar GitHub <noreply@github.com> 2021-02-21 10:25:53 -0800
commitce00b5f347cb20979a07d20073442aec667775d1 (patch)
tree0fa864c2fa19007ad7dcc9b1b1801d297a919071 /Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp
parent8aac5d31e800cd7f661b5f535eff6c36698802a6 (diff)
downloadWarpX-ce00b5f347cb20979a07d20073442aec667775d1.tar.gz
WarpX-ce00b5f347cb20979a07d20073442aec667775d1.tar.zst
WarpX-ce00b5f347cb20979a07d20073442aec667775d1.zip
Backtransformed Diags with openPMD (#1717)
* add geometry object and plotfile variables for BTD * fixing buffer and snapshot definitions and emptying/refilling of buffers * Adding Plotfile capability for BTD * fix eol * add comments and remove commented line in OpnPMD * remove unnecesary print statement * read header without bcast within io scope and modify fabname in first fabheader * remove tab * add empty line back * Adding snapshot geom and BTD parameters for openpmd interface * eol * remove print statement * eol * openPMD: BTD write support - open series only once - declare iteration in labframe only once - including fields & extents - use proper global lab-frame meta-data and write only once * fix the right path for openpmd BTD data * eol fix * Spaces & a comment * rename to first_write_to_iteration for clarity just me being picky about my choice of variable name * Fix write condition (first) Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp')
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp17
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 (){