namespace rgpot_sw¶
Overview¶
Stillinger-Weber potential in gather form. More…
namespace rgpot_sw {
// global variables
real(wp), parameter exp_floor = -300.0_wp;
// global functions
subroutine, public sw_energy_forces(real(wp), dimension(:, :), intent(in), contiguous positions, real(wp), dimension(3, 3), intent(in) cell, type(sw_params_t), intent(in) par, type(neighbor_table_t), intent(inout) table, real(wp), intent(out) energy, real(wp), dimension(:, :), intent(out), contiguous forces, integer, intent(out) status, character(len=:), intent(out), allocatable errmsg);
} // namespace rgpot_sw
Detailed Documentation¶
Stillinger-Weber potential in gather form.
The published SW expression sums a two-body term over pairs and a three-body term over triplets centred on each atom. Written as a scatter (one triplet updating three atoms) the atom loop carries dependencies; written as a gather each atom accumulates only its own force and the loop runs under do concurrent.
An atom i collects three-body force in two roles:
as the centre of a triplet
(j, i, k), taking-(f_j + f_k);as an end of a triplet centred on a neighbour
m, taking the end-atom force of(i, m, k)for every other neighbourkofm.
The two roles together reproduce the scatter sum exactly, at the cost of walking each neighbour’s neighbour list. Energy accrues to the centre atom only, so it is counted once.
Global Variables¶
real(wp), parameter exp_floor = -300.0_wp
Exponential arguments below this underflow to zero; guarding keeps exp out of its denormal range for pairs at the cutoff.
Global Functions¶
subroutine, public sw_energy_forces(real(wp), dimension(:, :), intent(in), contiguous positions, real(wp), dimension(3, 3), intent(in) cell, type(sw_params_t), intent(in) par, type(neighbor_table_t), intent(inout) table, real(wp), intent(out) energy, real(wp), dimension(:, :), intent(out), contiguous forces, integer, intent(out) status, character(len=:), intent(out), allocatable errmsg)
Energy and forces for positions (3 x natoms) in cell.