aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
diff options
context:
space:
mode:
authorGravatar Edoardo Zoni <59625522+EZoni@users.noreply.github.com> 2022-09-20 16:28:39 -0700
committerGravatar GitHub <noreply@github.com> 2022-09-20 16:28:39 -0700
commit5761b4bf998eab84ea0f7e4b132026593f3ddf9f (patch)
tree39a60a20ac3fac7368231b66f49fad063321f624 /Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
parent2fed2828933831ee464f0ca5d02a23dd2df54aad (diff)
downloadWarpX-5761b4bf998eab84ea0f7e4b132026593f3ddf9f.tar.gz
WarpX-5761b4bf998eab84ea0f7e4b132026593f3ddf9f.tar.zst
WarpX-5761b4bf998eab84ea0f7e4b132026593f3ddf9f.zip
PSATD: More Options for Time Dependency of J, Rho (#3242)
* Rename PsatdAlgorithm as PsatdAlgorithmJConstantInTime * Add New Inputs: psatd.J_in_time, psatd.rho_in_time * Update PSATD Classes * Fix Bug for FDTD Build * Fix Warning for RZ PSATD Build * Fix Multi-J Loop w/ J Constant in Time * Clean up * Fix Error Message * Fix Time of Charge Deposition for Rho Linear * Add 3D Langmuir CI Tests w/ Multi-J Algo * Fix Checksums of New CI Tests * Remove Extra CI Tests (added in #3363) * Fix CI Tests w/ Multi-J PSATD * Add Docs for New Input Parameters * Galilean/Comoving PSATD Not Compatible w/ J Linear
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralSolver.cpp')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolver.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
index 75c82319c..c0d7b8941 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
@@ -8,7 +8,7 @@
#include "FieldSolver/SpectralSolver/SpectralFieldData.H"
#include "SpectralAlgorithms/PsatdAlgorithmComoving.H"
#include "SpectralAlgorithms/PsatdAlgorithmPml.H"
-#include "SpectralAlgorithms/PsatdAlgorithm.H"
+#include "SpectralAlgorithms/PsatdAlgorithmJConstantInTime.H"
#include "SpectralAlgorithms/PsatdAlgorithmJLinearInTime.H"
#include "SpectralKSpace.H"
#include "SpectralSolver.H"
@@ -30,7 +30,8 @@ SpectralSolver::SpectralSolver(
const bool pml, const bool periodic_single_box,
const bool update_with_rho,
const bool fft_do_time_averaging,
- const bool do_multi_J,
+ const int J_in_time,
+ const int rho_in_time,
const bool dive_cleaning,
const bool divb_cleaning)
{
@@ -41,8 +42,9 @@ SpectralSolver::SpectralSolver(
// as well as the value of the corresponding k coordinates)
const SpectralKSpace k_space= SpectralKSpace(realspace_ba, dm, dx);
- m_spectral_index = SpectralFieldIndex(update_with_rho, fft_do_time_averaging,
- do_multi_J, dive_cleaning, divb_cleaning, pml);
+ m_spectral_index = SpectralFieldIndex(
+ update_with_rho, fft_do_time_averaging, J_in_time, rho_in_time,
+ dive_cleaning, divb_cleaning, pml);
// - Select the algorithm depending on the input parameters
// Initialize the corresponding coefficients over k space
@@ -64,18 +66,18 @@ SpectralSolver::SpectralSolver(
}
else // PSATD algorithms: standard, Galilean, averaged Galilean, multi-J
{
- if (do_multi_J)
+ if (J_in_time == JInTime::Constant)
{
- algorithm = std::make_unique<PsatdAlgorithmJLinearInTime>(
+ algorithm = std::make_unique<PsatdAlgorithmJConstantInTime>(
k_space, dm, m_spectral_index, norder_x, norder_y, norder_z, nodal,
- dt, fft_do_time_averaging, dive_cleaning, divb_cleaning);
+ v_galilean, dt, update_with_rho, fft_do_time_averaging,
+ dive_cleaning, divb_cleaning);
}
- else // standard, Galilean, averaged Galilean
+ else // J linear in time
{
- algorithm = std::make_unique<PsatdAlgorithm>(
+ algorithm = std::make_unique<PsatdAlgorithmJLinearInTime>(
k_space, dm, m_spectral_index, norder_x, norder_y, norder_z, nodal,
- v_galilean, dt, update_with_rho, fft_do_time_averaging,
- dive_cleaning, divb_cleaning);
+ dt, fft_do_time_averaging, dive_cleaning, divb_cleaning);
}
}
}