aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/WarpXOpenPMD.cpp
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2022-10-05 16:01:57 -0700
committerGravatar GitHub <noreply@github.com> 2022-10-05 23:01:57 +0000
commitb13b27ea90d8741185ff8f0bef5af59e33470fb2 (patch)
treed7d8752ed60532ec32bbb405c1b314be1e328903 /Source/Diagnostics/WarpXOpenPMD.cpp
parent43c110c3c3e2e5a1279fe6612c1540713744911f (diff)
downloadWarpX-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.cpp5
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 );
}