aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
diff options
context:
space:
mode:
authorGravatar Edoardo Zoni <59625522+EZoni@users.noreply.github.com> 2022-12-07 15:40:02 -0800
committerGravatar GitHub <noreply@github.com> 2022-12-07 15:40:02 -0800
commit4073384c7b66b1848bcc94e6c986f7d532c7da11 (patch)
treea3a7d152098eff3f8c049638ac40b93a40551108 /Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
parent02447ce0f59e729865a8cbe9502bf6ca0c91e2cd (diff)
downloadWarpX-4073384c7b66b1848bcc94e6c986f7d532c7da11.tar.gz
WarpX-4073384c7b66b1848bcc94e6c986f7d532c7da11.tar.zst
WarpX-4073384c7b66b1848bcc94e6c986f7d532c7da11.zip
PSATD: Implement First-Order Equations (#3466)
* Implement First-Order PSATD Equations * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix Unused Parameter Warning * Fix RZ Build * Fix Normalization of G to Match PML * Add CI Test: 3D Uniform Plasma * Cleaning * Update 2D CI Checksums * Update 3D CI Checksums * Add F,G to CI Checksums of `uniform_plasma_multiJ` * Allow User to Choose First-Order v. Second-Order * Add WARPX_ALWAYS_ASSERT_WITH_MESSAGE * Rename New Class `PsatdAlgorithmFirstOrder` * Remove Inline Comment * Update RZ CI Checksums * Fix inline comment * Use auxiliary variables to avoid divisions * Use auxiliary variables to avoid divisions * Make `nci_psatd_stability` dir and merge inputs * Move all Galilean tests to `nci_psatd_stability` * Fix CI * Fix index for backward FFT of J Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
index 56189e0ff..e1db4e5ab 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
@@ -51,10 +51,8 @@ SpectralFieldIndex::SpectralFieldIndex (const bool update_with_rho,
{
Ex = c++; Ey = c++; Ez = c++;
Bx = c++; By = c++; Bz = c++;
- Jx = c++; Jy = c++; Jz = c++;
// TODO Allocate rho_old and rho_new only when needed
- rho_old = c++; rho_new = c++;
// Reuse data corresponding to index Bx = 3 to avoid storing extra memory
divE = 3;
@@ -69,17 +67,25 @@ SpectralFieldIndex::SpectralFieldIndex (const bool update_with_rho,
if (divb_cleaning) G = c++;
- if (J_in_time == JInTime::Linear)
+ if (J_in_time == JInTime::Constant)
{
- Jx_new = c++;
- Jy_new = c++;
- Jz_new = c++;
+ Jx_mid = c++; Jy_mid = c++; Jz_mid = c++;
+ }
+ else if (J_in_time == JInTime::Linear)
+ {
+ Jx_old = c++; Jy_old = c++; Jz_old = c++;
+ Jx_new = c++; Jy_new = c++; Jz_new = c++;
}
- if (rho_in_time == RhoInTime::Quadratic)
+ if (rho_in_time == RhoInTime::Constant)
{
rho_mid = c++;
}
+ else if (rho_in_time == RhoInTime::Linear)
+ {
+ rho_old = c++;
+ rho_new = c++;
+ }
if (pml_rz)
{