|
| | CellFunctor (ParticleFunctor_T &f, const double sortingCutoff, DataLayoutOption dataLayout, bool useNewton3) |
| | The constructor of CellFunctor.
|
| |
| void | processCell (ParticleCell_T &cell) |
| | Process the interactions inside one cell.
|
| |
| void | processCellPair (ParticleCell_T &cell1, ParticleCell_T &cell2, const std::array< double, 3 > &sortingDirection={0., 0., 0.}) |
| | Process the interactions between the particles of cell1 with particles of cell2.
|
| |
| DataLayoutOption::Value | getDataLayout () const |
| | Getter.
|
| |
| bool | getNewton3 () const |
| | Getter.
|
| |
| bool | getBidirectional () const |
| | Getter.
|
| |
| void | setAoSSortingThreshold (size_t aosSortingThreshold) |
| | Set the aos-sorting-threshold.
|
| |
| void | setSoASortingThreshold (size_t soaSortingThreshold) |
| | Set the SoA sorting-threshold.
|
| |
| SoASortingData | computeSortingData (const std::vector< std::pair< double, size_t > > &projIdxI, const std::vector< std::pair< double, size_t > > &projIdxJ, std::vector< size_t > &maxIndexCache, std::vector< size_t > &minIndexCache) const |
| | Computes conservative per-particle index bounds into projIdxJ based on a 1-D projection cutoff check.
|
| |
template<class ParticleCell_T, class ParticleFunctor_T, bool bidirectional = true>
class autopas::internal::CellFunctor< ParticleCell_T, ParticleFunctor_T, bidirectional >
A cell functor.
This functor is built from the normal Functor of the template type ParticleFunctor_T. It is an internal object to handle interactions between two cells of particles.
- Template Parameters
-
| ParticleCell_T | |
| ParticleFunctor_T | the functor which |
| bidirectional | if no newton3 is used processCellPair(cell1, cell2) should also handle processCellPair(cell2,
cell1) |
template<class ParticleCell_T , class ParticleFunctor_T , bool bidirectional>
| SoASortingData autopas::internal::CellFunctor< ParticleCell_T, ParticleFunctor_T, bidirectional >::computeSortingData |
( |
const std::vector< std::pair< double, size_t > > & |
projIdxI, |
|
|
const std::vector< std::pair< double, size_t > > & |
projIdxJ, |
|
|
std::vector< size_t > & |
maxIndexCache, |
|
|
std::vector< size_t > & |
minIndexCache |
|
) |
| const |
Computes conservative per-particle index bounds into projIdxJ based on a 1-D projection cutoff check.
Particles are projected onto the sorting axis. A pair can only interact if their 1-D projection distance is within the cutoff (necessary but not sufficient condition for a 3-D interaction). Because both projIdxI and projIdxJ are sorted, a two-pointer sweep computes the bounds in O(nI + nJ).
The returned SoASortingData contains:
- startI: index of the first i-particle that could interact with any j-particle. All i before startI project farther than cutoff below projIdxJ[0] and can be skipped unconditionally.
- maxIndex[i]: exclusive upper bound; the first j where projJ > projI[i] + cutoff. A functor iterating j up to (but not including) this index will not miss any candidate pair for particle i.
- minIndex[i]: inclusive lower bound; the first j where projJ >= projI[i] - cutoff. A functor may start its j-loop here and skip all earlier j-particles for particle i.
Both maxIndex and minIndex are monotonically non-decreasing with i. A functor processing i-particles in order can therefore advance its j-loop bounds without backtracking, and may also derive valid bounds for a contiguous block of i-particles (For example with VecPatterns != 1xVec) by taking minIndex of the first and maxIndex of the last.
- Parameters
-
| projIdxI | Sorted (projection, original index) pairs for the outer-loop (i) cell. |
| projIdxJ | Sorted (projection, original index) pairs for the inner-loop (j) cell. |
| maxIndexCache | Output buffer for maxIndex; resized and overwritten by this function. |
| minIndexCache | Output buffer for minIndex; resized and overwritten by this function. |
- Returns
- SoASortingData with startI and per-i index bounds into projIdxJ.
template<class ParticleCell_T , class ParticleFunctor_T , bool bidirectional>
Set the aos-sorting-threshold.
If the sum of the number of particles in two cells is greater or equal to that value, the CellFunctor creates a sorted view of the particles to avoid unnecessary distance checks.
- Parameters
-
| aosSortingThreshold | Sum of the number of particles in two cells from which sorting should be enabled. |