35template <
class Particle_T,
class NeighborList>
52 VerletListsCells(
const std::array<double, 3> &boxMin,
const std::array<double, 3> &boxMax,
const double cutoff,
53 const double skin = 0,
const unsigned int rebuildFrequency = 2,
const double cellSizeFactor = 1.0,
56 VerletListsCellsHelpers::VLCBuildType::soaBuild)
58 compatibleTraversals::allVLCCompatibleTraversals(), cellSizeFactor),
59 _loadEstimator(loadEstimator),
60 _dataLayoutDuringListRebuild(dataLayoutDuringListRebuild) {}
65 [[nodiscard]] ContainerOption
getContainerType()
const override {
return _neighborList.getContainerType(); }
75 return [&](
const std::array<unsigned long, 3> &cellsPerDimension,
76 const std::array<unsigned long, 3> &lowerCorner,
const std::array<unsigned long, 3> &upperCorner) {
78 lowerCorner, upperCorner);
82 return [&](
const std::array<unsigned long, 3> &cellsPerDimension,
83 const std::array<unsigned long, 3> &lowerCorner,
const std::array<unsigned long, 3> &upperCorner) {
84 return loadEstimators::neighborListLength<Particle_T, NeighborList>(_neighborList, cellsPerDimension,
85 lowerCorner, upperCorner);
93 [&](
const std::array<unsigned long, 3> &cellsPerDimension,
const std::array<unsigned long, 3> &lowerCorner,
94 const std::array<unsigned long, 3> &upperCorner) {
return 1; };
101 _neighborList.setUpTraversal(traversal);
116 size_t getNumberOfPartners(
const Particle_T *particle)
const {
return _neighborList.getNumberOfPartners(particle); }
126 _neighborList.buildAoSNeighborList(traversal->
getTraversalType(), this->_linkedCells, this->_verletBuiltNewton3);
141 return this->
_linkedCells.getCellBlock().getCellLength();
148 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
This class handles the storage of particles in their full form.
Definition: FullParticleCell.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:36
void rebuildNeighborLists(TraversalInterface *traversal) override
Rebuilds the neighbor lists and marks them valid.
Definition: VerletListsCells.h:123
VerletListsCells(const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax, const double cutoff, const double skin=0, const unsigned int rebuildFrequency=2, 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:52
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:140
ContainerOption getContainerType() const override
Get the ContainerType.
Definition: VerletListsCells.h:65
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:116
BalancedTraversal::EstimatorFunction getLoadEstimatorFunction()
Generates the load estimation function depending on _loadEstimator.
Definition: VerletListsCells.h:71
void computeInteractions(TraversalInterface *traversal) override
Iterates over all particle multiples (e.g.
Definition: VerletListsCells.h:99
Base class for Verlet lists which use an underlying linked cells container.
Definition: VerletListsLinkedBase.h:26
bool _verletBuiltNewton3
specifies if the current verlet list was built for newton3
Definition: VerletListsLinkedBase.h:329
std::atomic< bool > _neighborListIsValid
specifies if the neighbor list is currently valid
Definition: VerletListsLinkedBase.h:326
LinkedCells< Particle_T > _linkedCells
internal linked cells storage, handles Particle storage and used to build verlet lists
Definition: VerletListsLinkedBase.h:323
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