Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,9 @@ Particle push, charge and current deposition, field gathering
Available options are: ``direct``, ``esirkepov``, and ``vay``. The default choice
is ``esirkepov`` for FDTD maxwell solvers but ``direct`` for standard or
Galilean PSATD solver (i.e. with ``algo.maxwell_solver = psatd``) and
for the hybrid-PIC solver (i.e. with ``algo.maxwell_solver = hybrid``).
for the hybrid-PIC solver (i.e. with ``algo.maxwell_solver = hybrid``) and for
diagnostics output with the electrostatic solvers (i.e., with
``warpx.do_electrostatic = ...``).
Note that ``vay`` is only available for ``algo.maxwell_solver = psatd``.

1. ``direct``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"Ex": 3710588.849989976,
"Ey": 0.0,
"Ez": 646727.8074440088,
"jx": 4745.078379617619,
Copy link
Member

@roelof-groenewald roelof-groenewald Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are surprisingly large! It is interesting to see how much of a difference the two methods have when noise is very high (the particle count is very low).

"jy": 368.4331779923921,
"jz": 632.1508106460103
"jx": 15259.034603501308,
"jy": 650.139263398662,
"jz": 943.0244062246846
},
"electrons": {
"particle_momentum_x": 8.78764082600202e-23,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"Ex": 9.882421146615367e-06,
"Ey": 1.0440261046714249e-05,
"Ez": 1.003739697324731e-05,
"jx": 2.9148662809570633e-10,
"jy": 8.46582291468749e-19,
"jz": 3.823492756863969e-08
"jx": 2.914866280957325e-10,
"jy": 8.46605718473121e-19,
"jz": 3.82349275686397e-08
},
"electron": {
"particle_momentum_x": 2.0819392991319055e-25,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"Ex": 6.0282565190090465e-05,
"Ey": 6.38479659567398e-05,
"Ez": 7.880459213065183e-05,
"jx": 1.1659465170956616e-09,
"jy": 2.6115239381823616e-17,
"jz": 1.5293971084510288e-07
"jx": 1.1659465170956563e-09,
"jy": 1.3057688751494639e-17,
"jz": 1.5293971084510282e-07
},
"electron": {
"particle_momentum_x": 2.0819392998019267e-25,
Expand Down
3 changes: 2 additions & 1 deletion Source/Utils/WarpXAlgorithmSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ GetAlgorithmInteger(const amrex::ParmParse& pp, const char* pp_search_key ){
} else if (0 == std::strcmp(pp_search_key, "current_deposition")) {
algo_to_int = current_deposition_algo_to_int;
if (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD ||
WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::HybridPIC)
WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::HybridPIC ||
WarpX::electrostatic_solver_id != ElectrostaticSolverAlgo::None)
algo_to_int["default"] = CurrentDepositionAlgo::Direct;
} else if (0 == std::strcmp(pp_search_key, "charge_deposition")) {
algo_to_int = charge_deposition_algo_to_int;
Expand Down
3 changes: 2 additions & 1 deletion Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,8 @@ WarpX::ReadParameters ()
}
#endif

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