Skip to content

Commit d07e8bb

Browse files
authored
Electrostatic Diagnostics for j: Default to Direct Deposition (#4362)
* Change Default: Direct Current Deposition for ES Used as a diagnostics for `j`. * Reset j in Benchmarks Esirkepov -> Direct Deposition
1 parent 807f0da commit d07e8bb

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

Docs/source/usage/parameters.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1824,7 +1824,9 @@ Particle push, charge and current deposition, field gathering
18241824
Available options are: ``direct``, ``esirkepov``, and ``vay``. The default choice
18251825
is ``esirkepov`` for FDTD maxwell solvers but ``direct`` for standard or
18261826
Galilean PSATD solver (i.e. with ``algo.maxwell_solver = psatd``) and
1827-
for the hybrid-PIC solver (i.e. with ``algo.maxwell_solver = hybrid``).
1827+
for the hybrid-PIC solver (i.e. with ``algo.maxwell_solver = hybrid``) and for
1828+
diagnostics output with the electrostatic solvers (i.e., with
1829+
``warpx.do_electrostatic = ...``).
18281830
Note that ``vay`` is only available for ``algo.maxwell_solver = psatd``.
18291831

18301832
1. ``direct``

Regression/Checksum/benchmarks_json/Python_prev_positions.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"Ex": 3710588.849989976,
77
"Ey": 0.0,
88
"Ez": 646727.8074440088,
9-
"jx": 4745.078379617619,
10-
"jy": 368.4331779923921,
11-
"jz": 632.1508106460103
9+
"jx": 15259.034603501308,
10+
"jy": 650.139263398662,
11+
"jz": 943.0244062246846
1212
},
1313
"electrons": {
1414
"particle_momentum_x": 8.78764082600202e-23,

Regression/Checksum/benchmarks_json/hard_edged_quadrupoles.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"Ex": 9.882421146615367e-06,
77
"Ey": 1.0440261046714249e-05,
88
"Ez": 1.003739697324731e-05,
9-
"jx": 2.9148662809570633e-10,
10-
"jy": 8.46582291468749e-19,
11-
"jz": 3.823492756863969e-08
9+
"jx": 2.914866280957325e-10,
10+
"jy": 8.46605718473121e-19,
11+
"jz": 3.82349275686397e-08
1212
},
1313
"electron": {
1414
"particle_momentum_x": 2.0819392991319055e-25,

Regression/Checksum/benchmarks_json/hard_edged_quadrupoles_moving.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"Ex": 6.0282565190090465e-05,
77
"Ey": 6.38479659567398e-05,
88
"Ez": 7.880459213065183e-05,
9-
"jx": 1.1659465170956616e-09,
10-
"jy": 2.6115239381823616e-17,
11-
"jz": 1.5293971084510288e-07
9+
"jx": 1.1659465170956563e-09,
10+
"jy": 1.3057688751494639e-17,
11+
"jz": 1.5293971084510282e-07
1212
},
1313
"electron": {
1414
"particle_momentum_x": 2.0819392998019267e-25,

Source/Utils/WarpXAlgorithmSelection.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ GetAlgorithmInteger(const amrex::ParmParse& pp, const char* pp_search_key ){
158158
} else if (0 == std::strcmp(pp_search_key, "current_deposition")) {
159159
algo_to_int = current_deposition_algo_to_int;
160160
if (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD ||
161-
WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::HybridPIC)
161+
WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::HybridPIC ||
162+
WarpX::electrostatic_solver_id != ElectrostaticSolverAlgo::None)
162163
algo_to_int["default"] = CurrentDepositionAlgo::Direct;
163164
} else if (0 == std::strcmp(pp_search_key, "charge_deposition")) {
164165
algo_to_int = charge_deposition_algo_to_int;

Source/WarpX.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,8 @@ WarpX::ReadParameters ()
11301130
}
11311131
#endif
11321132

1133-
// note: current_deposition must be set after maxwell_solver is already determined,
1133+
// note: current_deposition must be set after maxwell_solver (electromagnetic_solver_id) or
1134+
// do_electrostatic (electrostatic_solver_id) are already determined,
11341135
// because its default depends on the solver selection
11351136
current_deposition_algo = GetAlgorithmInteger(pp_algo, "current_deposition");
11361137
charge_deposition_algo = GetAlgorithmInteger(pp_algo, "charge_deposition");

0 commit comments

Comments
 (0)