aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
diff options
context:
space:
mode:
authorGravatar Edoardo Zoni <59625522+EZoni@users.noreply.github.com> 2023-06-30 12:09:13 -0700
committerGravatar GitHub <noreply@github.com> 2023-06-30 19:09:13 +0000
commit1a55de802493eef4c515be0e198e4ddb23e5cda9 (patch)
treee7938d009a51a144f46195bf649649ace96dfb58 /Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
parent5baa09ceadc6291f67839c7842fd1756edfc1186 (diff)
downloadWarpX-1a55de802493eef4c515be0e198e4ddb23e5cda9.tar.gz
WarpX-1a55de802493eef4c515be0e198e4ddb23e5cda9.tar.zst
WarpX-1a55de802493eef4c515be0e198e4ddb23e5cda9.zip
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
Diffstat (limited to 'Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp')
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp7
1 files changed, 6 insertions, 1 deletions
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<n_species; i++)
+ {
+ HeaderFile << mypc.GetParticleContainer(i).m_current_injection_position << "\n";
+ }
HeaderFile << warpx.getdo_moving_window() << "\n";