12 template <
typename ParticleContainer,
typename ScalarAttribute,
typename VectorAttribute>
13 KOKKOS_INLINE_FUNCTION
constexpr
17 VectorAttribute>::fieldFromPair(
const Vector_t& dist,
25 return forceConstant * qm * (dist / r)
28 + (1.0 - Kokkos::erf(
alpha * r)) / r2);
31 template <
typename ParticleContainer,
typename ScalarAttribute,
typename VectorAttribute>
38 auto&
Field = Field_m;
40 const auto& QM = QM_m;
43 const auto rcut2 = std::pow<Scalar_t>(this->params_m.template get<Scalar_t>(
"rcut"), 2);
44 const auto alpha = this->params_m.template get<Scalar_t>(
"alpha");
45 const auto forceConstant = this->params_m.template get<Scalar_t>(
"force_constant");
47 const auto& particleLayout = this->pc_m.getLayout();
49 particleLayout.template forEachPair<execution_space>(
50 KOKKOS_LAMBDA(
const size_t& i,
const size_t& j) {
51 const Vector_t dist_ij = R(i) - R(j);
52 const Scalar_t rsq_ij = dist_ij.dot(dist_ij);
54 if (rsq_ij >= rcut2) {
58 const auto F_ij = fieldFromPair(dist_ij, rsq_ij,
alpha, forceConstant, QM(j));
62 Kokkos::atomic_sub(&
Field(i), F_ij);
ippl::Field< T, Dim, Mesh_t< Dim >, Centering_t< Dim >, ViewArgs... > Field
void solve(double *Matrix, double *Solution, double *rightHandSide, const int &M, const int &N)
constexpr double alpha
The fine structure constant, no dimension.
Implementations for FFT constructor/destructor and transforms.
typename ScalarAttribute::value_type Scalar_t
typename VectorAttribute::value_type Vector_t
Timing::TimerRef TimerRef
static TimerRef getTimer(const char *nm)
static void stopTimer(TimerRef t)
static void startTimer(TimerRef t)