aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/WarpXOpenPMD.cpp
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2021-05-21 09:39:51 -0700
committerGravatar GitHub <noreply@github.com> 2021-05-21 09:39:51 -0700
commitd25046408da891d3de9d2c22bdb642c5d9f3c67c (patch)
tree1127ccdcfdb45daa24e69ad154898d60e31a2d31 /Source/Diagnostics/WarpXOpenPMD.cpp
parente5c7cf562fa5809f56841b693ba3ee007b86a323 (diff)
downloadWarpX-d25046408da891d3de9d2c22bdb642c5d9f3c67c.tar.gz
WarpX-d25046408da891d3de9d2c22bdb642c5d9f3c67c.tar.zst
WarpX-d25046408da891d3de9d2c22bdb642c5d9f3c67c.zip
openPMD: Fix Weighting Attributes (#1975)
The weighting attributes of the particle "weighting" record are fixed by the standard. This fixes their values.
Diffstat (limited to 'Source/Diagnostics/WarpXOpenPMD.cpp')
-rw-r--r--Source/Diagnostics/WarpXOpenPMD.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/Diagnostics/WarpXOpenPMD.cpp b/Source/Diagnostics/WarpXOpenPMD.cpp
index 9676df501..792600ea5 100644
--- a/Source/Diagnostics/WarpXOpenPMD.cpp
+++ b/Source/Diagnostics/WarpXOpenPMD.cpp
@@ -614,11 +614,14 @@ WarpXOpenPMDPlot::SetupRealProperties (openPMD::ParticleSpecies& currSpecies,
std::tie(std::ignore, newRecord) = addedRecords.insert(record_name);
if( newRecord ) {
currRecord.setUnitDimension( detail::getUnitDimension(record_name) );
- currRecord.setAttribute( "macroWeighted", 0u );
- if( record_name == "momentum" )
- currRecord.setAttribute( "weightingPower", 1.0 );
+ if( record_name == "weighting" )
+ currRecord.setAttribute( "macroWeighted", 1u );
+ else
+ currRecord.setAttribute( "macroWeighted", 0u );
+ if( record_name == "momentum" || record_name == "weighting" )
+ currRecord.setAttribute( "weightingPower", 1.0 );
else
- currRecord.setAttribute( "weightingPower", 0.0 );
+ currRecord.setAttribute( "weightingPower", 0.0 );
}
}
}
@@ -636,7 +639,7 @@ WarpXOpenPMDPlot::SetupRealProperties (openPMD::ParticleSpecies& currSpecies,
if( newRecord ) {
currRecord.setUnitDimension( detail::getUnitDimension(record_name) );
currRecord.setAttribute( "macroWeighted", 0u );
- if( record_name == "momentum" )
+ if( record_name == "momentum" || record_name == "weighting" )
currRecord.setAttribute( "weightingPower", 1.0 );
else
currRecord.setAttribute( "weightingPower", 0.0 );