aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
diff options
context:
space:
mode:
authorGravatar Edoardo Zoni <59625522+EZoni@users.noreply.github.com> 2021-07-21 16:58:00 -0700
committerGravatar GitHub <noreply@github.com> 2021-07-21 23:58:00 +0000
commita5fe0b4959e3fb5da816790a1fdc8b92384ae81e (patch)
treea668c984604db53f10932e438d94b934fa6a5ddd /Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
parent37120212d1c233a4830e9b600aed26075a9e78c5 (diff)
downloadWarpX-a5fe0b4959e3fb5da816790a1fdc8b92384ae81e.tar.gz
WarpX-a5fe0b4959e3fb5da816790a1fdc8b92384ae81e.tar.zst
WarpX-a5fe0b4959e3fb5da816790a1fdc8b92384ae81e.zip
Multi-J Algo: Make div(E)/div(B) Cleaning Optional (#2116)
* Multi-J Algo: Make div(E)/div(B) Cleaning Optional * Remove Unnecessary Newlines
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
index e50eae92e..7caa6fe51 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
@@ -66,8 +66,15 @@ SpectralFieldIndex::SpectralFieldIndex (const bool update_with_rho,
{
Jx_new = c++; Jy_new = c++; Jz_new = c++;
- // TODO Allocate F and G only when needed
- F = c++; G = c++;
+ if (dive_cleaning)
+ {
+ F = c++;
+ }
+
+ if (divb_cleaning)
+ {
+ G = c++;
+ }
}
}
else // PML