IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
TruncatedGreenParticleInteraction.h
Go to the documentation of this file.
1//
2// Class TruncatedGreenParticleInteraction
3// This class implements the short range interaction part of the green function splitting obtained
4// by taking the gradient of [forceConstant * (1 - erf(alpha * r)) / r]. The long range part is
5// handled by FFTTruncatedGreenPeriodicSolver.
6//
7// It assumes that ParticleContainer implements a function forAllPairs() to iterate over all
8// relevant particle pairs.
9//
10
11#ifndef IPPL_TRUNCATEDGREEN_SHORTRANGE_H
12#define IPPL_TRUNCATEDGREEN_SHORTRANGE_H
13
15
16namespace ippl {
25 template <typename ParticleContainer, typename VectorAttribute, typename ScalarAttribute>
27 public:
29 using Vector_t = typename VectorAttribute::value_type;
30 using Scalar_t = typename ScalarAttribute::value_type;
31 using execution_space = typename VectorAttribute::execution_space;
32 static_assert(std::is_same_v<execution_space, typename ScalarAttribute::execution_space>);
33
34 public:
45 const VectorAttribute& R, const ScalarAttribute& QM,
46 const ParameterList& params)
47 : Base(pc, params)
48 , Field_m(F)
49 , R_m(R)
50 , QM_m(QM) {}
51
53
58 void solve() override;
59
60 private:
65 KOKKOS_INLINE_FUNCTION static constexpr Vector_t fieldFromPair(const Vector_t& dist,
66 Scalar_t r2, Scalar_t alpha,
67 Scalar_t forceConstant,
68 Scalar_t qm);
69
71 VectorAttribute& Field_m;
73 const VectorAttribute& R_m;
75 const ScalarAttribute& QM_m;
76 };
77} // namespace ippl
78
80
81#endif // IPPL_TRUNCATEDGREEN_SHORTRANGE_H
Definition Archive.h:20
ParticleInteractionBase(const ParticleContainer &pc, const ParameterList &params)
VectorAttribute & Field_m
! The electric or gravitational field
const ScalarAttribute & QM_m
! Charge or Mass of the particles
TruncatedGreenParticleInteraction(const ParticleContainer &pc, VectorAttribute &F, const VectorAttribute &R, const ScalarAttribute &QM, const ParameterList &params)
typename VectorAttribute::execution_space execution_space
const VectorAttribute & R_m
! Positions of the particles
static KOKKOS_INLINE_FUNCTION constexpr Vector_t fieldFromPair(const Vector_t &dist, Scalar_t r2, Scalar_t alpha, Scalar_t forceConstant, Scalar_t qm)
ParticleInteractionBase< ParticleContainer > Base
~TruncatedGreenParticleInteraction() override=default