aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
diff options
context:
space:
mode:
authorGravatar Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com> 2023-08-24 15:50:50 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-24 22:50:50 +0000
commita5d25b72c46ff40688a4761171d2c88e9614030c (patch)
treebf3848fd3c211fefc95f92472f4b090ae9cf11c8 /Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
parentb88db1668e1882f6542c5f2bd04ca3ef4cf2034f (diff)
downloadWarpX-a5d25b72c46ff40688a4761171d2c88e9614030c.tar.gz
WarpX-a5d25b72c46ff40688a4761171d2c88e9614030c.tar.zst
WarpX-a5d25b72c46ff40688a4761171d2c88e9614030c.zip
fix pc for BTD plotfile (#4228)
Diffstat (limited to '')
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
index 744aad019..96b75bbaa 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
+++ b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
@@ -344,8 +344,9 @@ FlushFormatPlotfile::WriteParticles(const std::string& dir,
for (auto& part_diag : particle_diags) {
WarpXParticleContainer* pc = part_diag.getParticleContainer();
+ PinnedMemoryParticleContainer* pinned_pc = part_diag.getPinnedParticleContainer();
auto tmp = isBTD ?
- part_diag.getPinnedParticleContainer()->make_alike<amrex::PinnedArenaAllocator>() :
+ pinned_pc->make_alike<amrex::PinnedArenaAllocator>() :
pc->make_alike<amrex::PinnedArenaAllocator>();
Vector<std::string> real_names;
@@ -364,21 +365,21 @@ FlushFormatPlotfile::WriteParticles(const std::string& dir,
#endif
// get the names of the real comps
- real_names.resize(pc->NumRealComps());
- auto runtime_rnames = pc->getParticleRuntimeComps();
+ real_names.resize(tmp.NumRealComps());
+ auto runtime_rnames = tmp.getParticleRuntimeComps();
for (auto const& x : runtime_rnames) { real_names[x.second+PIdx::nattribs] = x.first; }
// plot any "extra" fields by default
real_flags = part_diag.m_plot_flags;
- real_flags.resize(pc->NumRealComps(), 1);
+ real_flags.resize(tmp.NumRealComps(), 1);
// and the names
- int_names.resize(pc->NumIntComps());
- auto runtime_inames = pc->getParticleRuntimeiComps();
+ int_names.resize(tmp.NumIntComps());
+ auto runtime_inames = tmp.getParticleRuntimeiComps();
for (auto const& x : runtime_inames) { int_names[x.second+0] = x.first; }
// plot by default
- int_flags.resize(pc->NumIntComps(), 1);
+ int_flags.resize(tmp.NumIntComps(), 1);
const auto mass = pc->AmIA<PhysicalSpecies::photon>() ? PhysConst::m_e : pc->getMass();
RandomFilter const random_filter(part_diag.m_do_random_filter,
@@ -405,7 +406,6 @@ FlushFormatPlotfile::WriteParticles(const std::string& dir,
}, true);
particlesConvertUnits(ConvertDirection::SI_to_WarpX, pc, mass);
} else {
- PinnedMemoryParticleContainer* pinned_pc = part_diag.getPinnedParticleContainer();
tmp.copyParticles(*pinned_pc, true);
particlesConvertUnits(ConvertDirection::WarpX_to_SI, &tmp, mass);
}