aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp')
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp b/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
index 73ec84d02..9b7e2195f 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
+++ b/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
@@ -159,8 +159,35 @@ FlushFormatCheckpoint::CheckpointParticles (
const amrex::Vector<ParticleDiag>& particle_diags) const
{
for (unsigned i = 0, n = particle_diags.size(); i < n; ++i) {
- particle_diags[i].getParticleContainer()->Checkpoint(
- dir, particle_diags[i].getSpeciesName());
+ WarpXParticleContainer* pc = particle_diags[i].getParticleContainer();
+
+ Vector<std::string> real_names;
+ Vector<std::string> int_names;
+ Vector<int> int_flags;
+ Vector<int> real_flags;
+
+ real_names.push_back("weight");
+
+ real_names.push_back("momentum_x");
+ real_names.push_back("momentum_y");
+ real_names.push_back("momentum_z");
+
+#ifdef WARPX_DIM_RZ
+ real_names.push_back("theta");
+#endif
+
+ // get the names of the real comps
+ real_names.resize(pc->NumRealComps());
+ auto runtime_rnames = pc->getParticleRuntimeComps();
+ for (auto const& x : runtime_rnames) { real_names[x.second+PIdx::nattribs] = x.first; }
+
+ // and the int comps
+ int_names.resize(pc->NumIntComps());
+ auto runtime_inames = pc->getParticleRuntimeiComps();
+ for (auto const& x : runtime_inames) { int_names[x.second+0] = x.first; }
+
+ pc->Checkpoint(dir, particle_diags[i].getSpeciesName(), true,
+ real_names, int_names);
}
}