AutoPas  3.0.0
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
autopas::VerletListsCellsHelpers Namespace Reference

Helper functions and type aliases for verlet lists cells. More...

Classes

struct  BaseStepOffsets
 Helper Struct to bundle all information about base step offsets. More...
 

Typedefs

template<class Particle_T >
using AllCellsNeighborListsType = std::vector< std::vector< std::pair< Particle_T *, std::vector< Particle_T * > > > >
 Cell wise verlet lists for neighbors from all adjacent cells: For every cell, a vector of pairs.
 
template<class Particle_T >
using PairwiseNeighborListsType = std::vector< std::vector< std::vector< std::pair< Particle_T *, std::vector< Particle_T * > > > > >
 Pairwise verlet lists: For every cell a vector, for every neighboring cell a vector of particle-neighborlist pairs.
 

Enumerations

enum class  VLCBuildType { aosBuild , soaBuild }
 Indicates which build functor should be used for the generation of the neighbor list. More...
 

Functions

size_t estimateListLength (size_t numParticles, const std::array< double, 3 > &boxSize, double interactionLength, double correctionFactor)
 Simple heuristic to calculate the average number of particles per verlet list assuming particles are evenly distributed in the domain box.
 
std::vector< BaseStepOffsetsbuildC08BaseStep (const std::array< int, 3 > &cellsPerDim)
 Builds the list of offsets from the base cell for the c08 base step.
 
template<class Cells >
size_t estimateNumLists (size_t baseCellIndex, bool useNewton3, const Cells &cells, const std::vector< BaseStepOffsets > &offsetsC08)
 Function to estimate the number of neighbor lists for one base step.
 

Detailed Description

Helper functions and type aliases for verlet lists cells.

Typedef Documentation

◆ AllCellsNeighborListsType

template<class Particle_T >
using autopas::VerletListsCellsHelpers::AllCellsNeighborListsType = typedef std::vector<std::vector<std::pair<Particle_T *, std::vector<Particle_T *> >> >

Cell wise verlet lists for neighbors from all adjacent cells: For every cell, a vector of pairs.

Each pair maps a particle to a vector of its neighbors.

Note
From a content view, this is similar to an vector<unstructured_map<Particle_T*, std::vector<Particle *>>>. However since we need to access all keys sequentially during the force computation this is faster, even when the lookup of keys is slower.
Template Parameters
Particle_T

◆ PairwiseNeighborListsType

template<class Particle_T >
using autopas::VerletListsCellsHelpers::PairwiseNeighborListsType = typedef std::vector<std::vector<std::vector<std::pair<Particle_T *, std::vector<Particle_T *> >> >>

Pairwise verlet lists: For every cell a vector, for every neighboring cell a vector of particle-neighborlist pairs.

Each pair maps a particle to a vector of its neighbor particles. Cells<NeighboringCells<Particle,NeighborParticles>>

Template Parameters
Particle_T

Enumeration Type Documentation

◆ VLCBuildType

Indicates which build functor should be used for the generation of the neighbor list.

To be passed to the generator functors in the neighbor lists.

Function Documentation

◆ buildC08BaseStep()

std::vector< BaseStepOffsets > autopas::VerletListsCellsHelpers::buildC08BaseStep ( const std::array< int, 3 > &  cellsPerDim)

Builds the list of offsets from the base cell for the c08 base step.

A offset pair are two cell indices relative to the base cell index that have to interact.

The third tuple entry is an estimation factor on the fraction of particles that will end up needing a neighbor list in the base cell. This depends on the relative position of the two cells: Whether they are the same, or share a face, edge, or corner.

Note
This function is implemented for CSF==1, meaning preallocation weight factors are intended for CSF==1. For CSF > 1 the implementation works but the factors might be suboptimal. For CSF < 1 more factors (and different) are needed if more neighbor cells interact with the base cell.
Parameters
cellsPerDimNumber of cells per dimension including halo.
Returns
Vector of tuples<offset1, offset2, listEstimateFactor>

◆ estimateListLength()

size_t autopas::VerletListsCellsHelpers::estimateListLength ( size_t  numParticles,
const std::array< double, 3 > &  boxSize,
double  interactionLength,
double  correctionFactor 
)

Simple heuristic to calculate the average number of particles per verlet list assuming particles are evenly distributed in the domain box.

Parameters
numParticles
boxSizeSize of the simulation box.
interactionLengthCutoff + skin.
correctionFactorCorrection factor multiplied with the result.
Returns
numParticles * (list volume as fraction of box volume) * correctionFactor.

◆ estimateNumLists()

template<class Cells >
size_t autopas::VerletListsCellsHelpers::estimateNumLists ( size_t  baseCellIndex,
bool  useNewton3,
const Cells &  cells,
const std::vector< BaseStepOffsets > &  offsetsC08 
)

Function to estimate the number of neighbor lists for one base step.

Template Parameters
Cells
Parameters
baseCellIndexCell index for which the estimate is made.
useNewton3Whether or not the traversal that uses the lists employs Newton3.
cellsReference to the vector of cells.
offsetsC08Vector of BaseStepOffsets.
Returns
An estimate of the number of lists that will be needed in the base cell.