diff options
author | 2021-07-07 16:37:03 -0700 | |
---|---|---|
committer | 2021-07-07 16:37:03 -0700 | |
commit | 3df5954c8f56eb281e599a2ca1af9847bcafe812 (patch) | |
tree | 2f68bc5bca454f601f7dcf6d1f4101dbd9e0c881 /Source/Initialization/WarpXInitData.cpp | |
parent | 64702b8a12a6e7fbc76b2c6eac24f93f4547aa1e (diff) | |
download | WarpX-3df5954c8f56eb281e599a2ca1af9847bcafe812.tar.gz WarpX-3df5954c8f56eb281e599a2ca1af9847bcafe812.tar.zst WarpX-3df5954c8f56eb281e599a2ca1af9847bcafe812.zip |
Fix ES Init & Filter (#2064)
Move the calculation of initial space charge fields further down
in `WarpX::InitData` and out of `InitFromScratch`.
This call runs already MLMG routines that rely on a filtered rho,
whose stencils are not initialized if called to early.
Diffstat (limited to '')
-rw-r--r-- | Source/Initialization/WarpXInitData.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 0c4a6426d..6460860f0 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -163,6 +163,11 @@ WarpX::InitData () if (restart_chkfile.empty()) { + // Loop through species and calculate their space-charge field + bool const reset_fields = false; // Do not erase previous user-specified values on the grid + ComputeSpaceChargeField(reset_fields); + + // Write full diagnostics before the first iteration. multi_diags->FilterComputePackFlush( -1 ); // Write reduced diagnostics before the first iteration. @@ -212,10 +217,6 @@ WarpX::InitFromScratch () mypc->AllocData(); mypc->InitData(); - // Loop through species and calculate their space-charge field - bool const reset_fields = false; // Do not erase previous user-specified values on the grid - ComputeSpaceChargeField(reset_fields); - InitPML(); } |