31template <
class Particle_T,
class NeighborList>
45 VerletListsCells(
const std::array<double, 3> &boxMin,
const std::array<double, 3> &boxMax,
const double cutoff,
46 const double skin = 0,
const double cellSizeFactor = 1.0,
49 VerletListsCellsHelpers::VLCBuildType::soaBuild)
51 _loadEstimator(loadEstimator),
52 _dataLayoutDuringListRebuild(dataLayoutDuringListRebuild) {}
57 [[nodiscard]] ContainerOption
getContainerType()
const override {
return _neighborList.getContainerType(); }
67 return [&](
const std::array<unsigned long, 3> &cellsPerDimension,
68 const std::array<unsigned long, 3> &lowerCorner,
const std::array<unsigned long, 3> &upperCorner) {
70 lowerCorner, upperCorner);
74 return [&](
const std::array<unsigned long, 3> &cellsPerDimension,
75 const std::array<unsigned long, 3> &lowerCorner,
const std::array<unsigned long, 3> &upperCorner) {
76 return loadEstimators::neighborListLength<Particle_T, NeighborList>(_neighborList, cellsPerDimension,
77 lowerCorner, upperCorner);
85 [&](
const std::array<unsigned long, 3> &cellsPerDimension,
const std::array<unsigned long, 3> &lowerCorner,
86 const std::array<unsigned long, 3> &upperCorner) {
return 1; };
93 _neighborList.setUpTraversal(traversal);
108 size_t getNumberOfPartners(
const Particle_T *particle)
const {
return _neighborList.getNumberOfPartners(particle); }
118 _neighborList.buildAoSNeighborList(traversal->
getTraversalType(), this->_linkedCells, this->_verletBuiltNewton3);
133 return this->
_linkedCells.getCellBlock().getCellLength();
140 NeighborList _neighborList;
Base class for traversals utilising load balancing.
Definition: BalancedTraversal.h:19
std::function< unsigned long(const std::array< unsigned long, 3 > &, const std::array< unsigned long, 3 > &, const std::array< unsigned long, 3 > &)> EstimatorFunction
Type signature for load estimators.
Definition: BalancedTraversal.h:26
Class representing the load estimator choices.
Definition: LoadEstimatorOption.h:18
Value
Possible choices for the load estimation algorithm.
Definition: LoadEstimatorOption.h:23
@ squaredParticlesPerCell
Number of particles per cell squared.
Definition: LoadEstimatorOption.h:31
@ neighborListLength
Sum of neighbor list lengths.
Definition: LoadEstimatorOption.h:35
@ none
No load estimator.
Definition: LoadEstimatorOption.h:27
This interface serves as a common parent class for all traversals.
Definition: TraversalInterface.h:18
virtual void endTraversal()=0
Finalizes the traversal.
virtual TraversalOption getTraversalType() const =0
Return a enum representing the name of the traversal class.
virtual void traverseParticles()=0
Traverse the particles by pairs, triplets etc.
virtual void initTraversal()=0
Initializes the traversal.
DataLayoutOption getDataLayout() const
Return the data layout option.
Definition: TraversalInterface.h:69
bool getUseNewton3() const
Return whether the traversal uses newton 3.
Definition: TraversalInterface.h:63
Linked Cells with Verlet Lists container.
Definition: VerletListsCells.h:32
void rebuildNeighborLists(TraversalInterface *traversal) override
Rebuilds the neighbor lists and marks them valid.
Definition: VerletListsCells.h:115
VerletListsCells(const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax, const double cutoff, const double skin=0, const double cellSizeFactor=1.0, const LoadEstimatorOption loadEstimator=LoadEstimatorOption::squaredParticlesPerCell, typename VerletListsCellsHelpers::VLCBuildType dataLayoutDuringListRebuild=VerletListsCellsHelpers::VLCBuildType::soaBuild)
Constructor of the VerletListsCells class.
Definition: VerletListsCells.h:45
const std::array< double, 3 > & getCellLength() const
Return the cell length of the underlying linked cells structure, normally needed only for unit tests.
Definition: VerletListsCells.h:132
ContainerOption getContainerType() const override
Get the ContainerType.
Definition: VerletListsCells.h:57
size_t getNumberOfPartners(const Particle_T *particle) const
Gets the number of neighbors over all neighbor lists that belong to this particle.
Definition: VerletListsCells.h:108
BalancedTraversal::EstimatorFunction getLoadEstimatorFunction()
Generates the load estimation function depending on _loadEstimator.
Definition: VerletListsCells.h:63
void computeInteractions(TraversalInterface *traversal) override
Iterates over all particle multiples (e.g.
Definition: VerletListsCells.h:91
Base class for Verlet lists which use an underlying linked cells container.
Definition: VerletListsLinkedBase.h:25
bool _verletBuiltNewton3
specifies if the current verlet list was built for newton3
Definition: VerletListsLinkedBase.h:330
std::atomic< bool > _neighborListIsValid
specifies if the neighbor list is currently valid
Definition: VerletListsLinkedBase.h:327
LinkedCells< Particle_T > _linkedCells
internal linked cells storage, handles Particle storage and used to build verlet lists
Definition: VerletListsLinkedBase.h:324
VLCBuildType
Indicates which build functor should be used for the generation of the neighbor list.
Definition: VerletListsCellsHelpers.h:47
unsigned long squaredParticlesPerCell(const std::vector< ParticleCell > &cells, const std::array< unsigned long, 3 > &cellsPerDimension, const std::array< unsigned long, 3 > &lowerCorner, const std::array< unsigned long, 3 > &upperCorner)
Sums up the squared number of particles for all cells within region.
Definition: LoadEstimators.h:31
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32