From 1a55de802493eef4c515be0e198e4ddb23e5cda9 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:09:13 -0700 Subject: Continuous injection of moving plasma (#3958) * Continuous injection of moving plasma * Fix const correctness * Fix bugs in calculation of v_bulk * Fix restart * Use range-based for loops where possible * Apply suggestions from code review * Fix bug related to managed memory * Apply suggestions from code review * Exclude case with `moving_window_v = 0` * Add to WarpXParticleContainer virtual function that returns pointer to plasma injector * Add to WarpXParticleContainer member variable for current injection position * Fix bugs * Fix bug: use continue instead of return --- Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp') diff --git a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp index 3ea631292..28033b3ac 100644 --- a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp +++ b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp @@ -302,7 +302,12 @@ FlushFormatPlotfile::WriteWarpXHeader( warpx.GetPartContainer().WriteHeader(HeaderFile); - HeaderFile << warpx.getcurrent_injection_position() << "\n"; + MultiParticleContainer& mypc = warpx.GetPartContainer(); + const int n_species = mypc.nSpecies(); + for (int i=0; i