Skip to content

Commit

Permalink
Fix Docs for psatd.update_with_rho (#3325)
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni authored Aug 19, 2022
1 parent fcc4658 commit 23393d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1759,8 +1759,6 @@ Numerics and algorithms
If false, instead, the update equation for the electric field is expressed in terms of the current density :math:`\widehat{\boldsymbol{J}}^{\,n+1/2}` only.
If charge is expected to be conserved (by setting, for example, ``psatd.current_correction=1``), then the two formulations are expected to be equivalent.

This option is currently implemented only for the standard PSATD and Galilean PSATD schemes, while it is not yet available for the averaged Galilean PSATD scheme (activated by the input parameter ``psatd.do_time_averaging``).

If ``psatd.v_galilean`` is zero, the spectral solver used is the standard PSATD scheme described in (`Vay et al, JCP 243, 2013 <https://doi.org/10.1016/j.jcp.2013.03.010>`_):

1. if ``psatd.update_with_rho=0``, the update equation for the electric field reads
Expand Down Expand Up @@ -1822,6 +1820,8 @@ Numerics and algorithms
The coefficients :math:`C`, :math:`S`, :math:`\theta`, :math:`\nu`, :math:`\chi_1`, :math:`\chi_2`, and :math:`\chi_3` are defined in (`Lehe et al, PRE 94, 2016 <https://doi.org/10.1103/PhysRevE.94.053305>`_).

The default value for ``psatd.update_with_rho`` is ``1`` if ``psatd.v_galilean`` is non-zero and ``0`` otherwise.
The option ``psatd.update_with_rho=0`` is not implemented with the following algorithms:
comoving PSATD (``psatd.v_comoving``), time averaging (``psatd.do_time_averaging=1``), div(E) cleaning (``warpx.do_dive_cleaning=1``), and multi-J (``warpx.do_multi_J=1``).

Note that the update with and without rho is also supported in RZ geometry.

Expand Down
2 changes: 1 addition & 1 deletion Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ WarpX::ReadParameters ()
);

# ifdef WARPX_DIM_RZ
update_with_rho = true; // Must be true for RZ PSATD
update_with_rho = true;
# else
if (m_v_galilean[0] == 0. && m_v_galilean[1] == 0. && m_v_galilean[2] == 0. &&
m_v_comoving[0] == 0. && m_v_comoving[1] == 0. && m_v_comoving[2] == 0.) {
Expand Down

0 comments on commit 23393d8

Please sign in to comment.