diff options
author | 2021-05-21 09:39:51 -0700 | |
---|---|---|
committer | 2021-05-21 09:39:51 -0700 | |
commit | d25046408da891d3de9d2c22bdb642c5d9f3c67c (patch) | |
tree | 1127ccdcfdb45daa24e69ad154898d60e31a2d31 /Source/Diagnostics/WarpXOpenPMD.cpp | |
parent | e5c7cf562fa5809f56841b693ba3ee007b86a323 (diff) | |
download | WarpX-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.cpp | 13 |
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 ); |