20template <
class Particle_T,
class PairwiseFunctor>
31 : _functor(functor), _clusterSize(clusterSize), _dataLayout(dataLayout), _useNewton3(useNewton3) {}
39 if (not isHaloCluster) {
40 traverseCluster(cluster);
45 for (
auto *neighborClusterPtr : *(cluster.
getNeighbors())) {
46 traverseClusterPair(cluster, *neighborClusterPtr);
57 if (_dataLayout == DataLayoutOption::aos) {
58 for (
size_t i = 0; i < _clusterSize; i++) {
59 for (
size_t j = i + 1; j < _clusterSize; j++) {
62 _functor->
AoSFunctor(cluster[i], cluster[j],
true);
64 _functor->
AoSFunctor(cluster[i], cluster[j],
false);
65 _functor->
AoSFunctor(cluster[j], cluster[i],
false);
79 void traverseClusterPair(internal::Cluster<Particle_T> &cluster, internal::Cluster<Particle_T> &neighborCluster) {
80 if (_dataLayout == DataLayoutOption::aos) {
81 for (
size_t i = 0; i < _clusterSize; i++) {
82 for (
size_t j = 0; j < _clusterSize; j++) {
83 _functor->
AoSFunctor(cluster[i], neighborCluster[j], _useNewton3);
87 _functor->
SoAFunctorPair(cluster.getSoAView(), neighborCluster.getSoAView(), _useNewton3);
92 PairwiseFunctor *_functor;
94 DataLayoutOption _dataLayout;
PairwiseFunctor class.
Definition: PairwiseFunctor.h:31
virtual void AoSFunctor(Particle_T &i, Particle_T &j, bool newton3)
PairwiseFunctor for arrays of structures (AoS).
Definition: PairwiseFunctor.h:56
virtual void SoAFunctorPair(SoAView< SoAArraysType > soa1, SoAView< SoAArraysType > soa2, bool newton3)
PairwiseFunctor for structure of arrays (SoA)
Definition: PairwiseFunctor.h:102
virtual void SoAFunctorSingle(SoAView< SoAArraysType > soa, bool newton3)
PairwiseFunctor for structure of arrays (SoA)
Definition: PairwiseFunctor.h:70
This class represents a cluster in the VerletClusterLists container.
Definition: Cluster.h:26
std::vector< Cluster< Particle_T > * > * getNeighbors()
Returns the reference to the neighbor list for this cluster.
Definition: Cluster.h:108
auto getSoAView()
Returns the SoAView for this cluster.
Definition: Cluster.h:90
Provides methods to traverse a single cluster and a pair of clusters.
Definition: VCLClusterFunctor.h:21
void processCluster(internal::Cluster< Particle_T > &cluster, bool isHaloCluster)
Invokes the calculations of all interactions within the cluster and, if they exist,...
Definition: VCLClusterFunctor.h:38
VCLClusterFunctor(PairwiseFunctor *functor, size_t clusterSize, DataLayoutOption dataLayout, bool useNewton3)
Constructs a VCLClusterFunctor that uses the given functor internally.
Definition: VCLClusterFunctor.h:30
This namespace is used for implementation specifics.
Definition: CellFunctor.h:14