aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.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/WarpX.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/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 579387433..e51197089 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -120,6 +120,7 @@ short WarpX::charge_deposition_algo;
short WarpX::field_gathering_algo;
short WarpX::particle_pusher_algo;
short WarpX::electromagnetic_solver_id;
+short WarpX::psatd_solution_type;
short WarpX::J_in_time;
short WarpX::rho_in_time;
short WarpX::load_balance_costs_update_algo;
@@ -1148,6 +1149,11 @@ WarpX::ReadParameters ()
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(noz_fft > 0, "PSATD order must be finite unless psatd.periodic_single_box_fft is used");
}
+ // Integer that corresponds to the order of the PSATD solution
+ // (whether the PSATD equations are derived from first-order or
+ // second-order solution)
+ psatd_solution_type = GetAlgorithmInteger(pp_psatd, "solution_type");
+
// Integers that correspond to the time dependency of J (constant, linear)
// and rho (linear, quadratic) for the PSATD algorithm
J_in_time = GetAlgorithmInteger(pp_psatd, "J_in_time");
@@ -1311,13 +1317,6 @@ WarpX::ReadParameters ()
);
}
- if (J_in_time == JInTime::Constant)
- {
- WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
- rho_in_time == RhoInTime::Linear,
- "psatd.J_in_time=constant supports only psatd.rho_in_time=linear");
- }
-
if (J_in_time == JInTime::Linear)
{
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
@@ -1331,6 +1330,14 @@ WarpX::ReadParameters ()
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
v_comoving_is_zero,
"psatd.J_in_time=linear not implemented with comoving PSATD");
+
+ WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
+ !current_correction,
+ "psatd.current_correction=1 not implemented with psatd.J_in_time=linear");
+
+ WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
+ current_deposition_algo != CurrentDepositionAlgo::Vay,
+ "algo.current_deposition=vay not implemented with psatd.J_in_time=linear");
}
for (int dir = 0; dir < AMREX_SPACEDIM; dir++)
@@ -2334,6 +2341,7 @@ void WarpX::AllocLevelSpectralSolver (amrex::Vector<std::unique_ptr<SpectralSolv
fft_periodic_single_box,
update_with_rho,
fft_do_time_averaging,
+ psatd_solution_type,
J_in_time,
rho_in_time,
do_dive_cleaning,