From be559b9988e90ffb7b8b18ef68cf942c4e3f36df Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 21 Mar 2022 21:47:34 -0700 Subject: 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> --- .../FlushFormats/FlushFormatOpenPMD.cpp | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp') 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); -- cgit v1.2.3