aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2022-03-21 21:47:34 -0700
committerGravatar GitHub <noreply@github.com> 2022-03-21 21:47:34 -0700
commitbe559b9988e90ffb7b8b18ef68cf942c4e3f36df (patch)
tree346d1064e36ec49162307a8f687260db4e5f5e1b /Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp
parentaf55efab7afb1fbaaa84dcf561342957fc3e71f0 (diff)
downloadWarpX-be559b9988e90ffb7b8b18ef68cf942c4e3f36df.tar.gz
WarpX-be559b9988e90ffb7b8b18ef68cf942c4e3f36df.tar.zst
WarpX-be559b9988e90ffb7b8b18ef68cf942c4e3f36df.zip
openPMD: Handle Zero Particles Well (#2980)
* openPMD: Handle Zero Particles Well When a time step for output encounters zero particles in a species, then we still want to dump them as "empty" species in openPMD. That simplifies post-processing a lot and we have the mechanisms in openPMD for it :) * openPMD: Emtpy Particle Writes Write empty records for iterations (steps or lab steps for BTD, respectively) without particles in a species. * Re-order: ED-PIC & Constant Particle Records - set attributes once - set constant records once - clean up into appropriate functions * Enable BTD for ADIOS :) Works now as well :tada: * Fix lingo in comments (Reva) Thank you!! :) Co-authored-by: Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com> Co-authored-by: Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com>
Diffstat (limited to 'Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp')
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp
index 951013555..4c31dbecd 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp
+++ b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp
@@ -100,26 +100,6 @@ FlushFormatOpenPMD::FlushFormatOpenPMD (const std::string& diag_name)
engine_type, engine_parameters,
warpx.getPMLdirections()
);
-
- // Temporarily adding Abort for adios filetype if species is selected for BTD output
- bool species_output = true;
- int write_species = 1;
- std::vector< std::string > output_species_names;
- bool species_specified = pp_diag_name.queryarr("species", output_species_names);
- if (species_specified == true and output_species_names.size() > 0) {
- species_output = true;
- } else {
- // By default species output is computed for all diagnostics, if write_species is not set to 0
- species_output = true;
- }
- // Check user-defined option to turn off species output
- pp_diag_name.query("write_species", write_species);
- if (write_species == 0) species_output = false;
- if (diag_type_str == "BackTransformed" and species_output == true) {
- if (m_OpenPMDPlotWriter->OpenPMDFileType() == "bp") {
- amrex::Abort(" Currently BackTransformed diagnostics type does not support species output for ADIOS backend. Please select h5 as openpmd backend");
- }
- }
}
void
@@ -155,7 +135,7 @@ FlushFormatOpenPMD::WriteToFile (
varnames, mf, geom, output_levels, output_iteration, time, isBTD, full_BTD_snapshot);
// particles: all (reside only on locally finest level)
- m_OpenPMDPlotWriter->WriteOpenPMDParticles(particle_diags, isBTD, totalParticlesFlushedAlready);
+ m_OpenPMDPlotWriter->WriteOpenPMDParticles(particle_diags, isBTD, isLastBTDFlush, totalParticlesFlushedAlready);
// signal that no further updates will be written to this iteration
m_OpenPMDPlotWriter->CloseStep(isBTD, isLastBTDFlush);