IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
TruncatedGreenParticleInteraction.h
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
14#include "ParticleInteractionBase.h"
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:
44 TruncatedGreenParticleInteraction(const ParticleContainer& pc, VectorAttribute& F,
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
52 ~TruncatedGreenParticleInteraction() override = default;
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
79#include "TruncatedGreenParticleInteraction.hpp"
80
81#endif // IPPL_TRUNCATEDGREEN_SHORTRANGE_H
Definition ParameterList.h:29
Definition ParticleInteractionBase.h:19
Definition TruncatedGreenParticleInteraction.h:26
TruncatedGreenParticleInteraction(const ParticleContainer &pc, VectorAttribute &F, const VectorAttribute &R, const ScalarAttribute &QM, const ParameterList &params)
Definition TruncatedGreenParticleInteraction.h:44
void solve() override
Definition TruncatedGreenParticleInteraction.hpp:33
Definition Vector.h:23
Definition Archive.h:20