diff options
author | 2022-10-05 16:01:57 -0700 | |
---|---|---|
committer | 2022-10-05 23:01:57 +0000 | |
commit | b13b27ea90d8741185ff8f0bef5af59e33470fb2 (patch) | |
tree | d7d8752ed60532ec32bbb405c1b314be1e328903 /Source/Diagnostics/WarpXOpenPMD.cpp | |
parent | 43c110c3c3e2e5a1279fe6612c1540713744911f (diff) | |
download | WarpX-b13b27ea90d8741185ff8f0bef5af59e33470fb2.tar.gz WarpX-b13b27ea90d8741185ff8f0bef5af59e33470fb2.tar.zst WarpX-b13b27ea90d8741185ff8f0bef5af59e33470fb2.zip |
openPMD: Shape of Constant Particle Records (#3451)
We forgot to set the shape (particle number) of constant
particle records. This violates the openPMD standard and
complicates post-processing.
Diffstat (limited to 'Source/Diagnostics/WarpXOpenPMD.cpp')
-rw-r--r-- | Source/Diagnostics/WarpXOpenPMD.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Diagnostics/WarpXOpenPMD.cpp b/Source/Diagnostics/WarpXOpenPMD.cpp index 1432a9820..6a2817e88 100644 --- a/Source/Diagnostics/WarpXOpenPMD.cpp +++ b/Source/Diagnostics/WarpXOpenPMD.cpp @@ -1004,15 +1004,18 @@ WarpXOpenPMDPlot::SetConstParticleRecordsEDPIC ( amrex::ParticleReal const mass) { auto realType = openPMD::Dataset(openPMD::determineDatatype<amrex::ParticleReal>(), {np}); + auto const scalar = openPMD::RecordComponent::SCALAR; + // define record shape to be number of particles auto const positionComponents = detail::getParticlePositionComponentLabels(); for( auto const& comp : positionComponents ) { currSpecies["positionOffset"][comp].resetDataset( realType ); } + currSpecies["charge"][scalar].resetDataset( realType ); + currSpecies["mass"][scalar].resetDataset( realType ); // make constant using namespace amrex::literals; - auto const scalar = openPMD::RecordComponent::SCALAR; for( auto const& comp : positionComponents ) { currSpecies["positionOffset"][comp].makeConstant( 0._prt ); } |