AutoPas  3.0.0
Loading...
Searching...
No Matches
Functions
autopasTools::generators::GridGenerator Namespace Reference

Generator for grids of particles. More...

Functions

template<class ParticleCell >
void fillWithParticles (std::vector< ParticleCell > &cells, const std::array< size_t, 3 > &cellsPerDimension, const std::array< size_t, 3 > &particlesPerDim, const typename ParticleCell::ParticleType &defaultParticle=typename ParticleCell::ParticleType(), const std::array< double, 3 > &spacing=std::array< double, 3 >{1, 1, 1}, const std::array< double, 3 > &offset=std::array< double, 3 >{.5,.5,.5}, const std::array< double, 3 > &cellSize={1., 1., 1.})
 Fills a cell vector with a cuboid mesh of particles.
 
template<class Container >
void fillWithParticles (Container &container, const std::array< size_t, 3 > &particlesPerDim, const typename autopas::utils::ParticleTypeTrait< Container >::value &defaultParticle=typename autopas::utils::ParticleTypeTrait< Container >::value(), const std::array< double, 3 > &spacing=std::array< double, 3 >{1., 1., 1.}, const std::array< double, 3 > &offset=std::array< double, 3 >{.5,.5,.5})
 Fills any container (also AutoPas object) with a cuboid mesh of particles.
 

Detailed Description

Generator for grids of particles.

Function Documentation

◆ fillWithParticles() [1/2]

template<class Container >
void autopasTools::generators::GridGenerator::fillWithParticles ( Container &  container,
const std::array< size_t, 3 > &  particlesPerDim,
const typename autopas::utils::ParticleTypeTrait< Container >::value &  defaultParticle = typename autopas::utils::ParticleTypeTrait<Container>::value(),
const std::array< double, 3 > &  spacing = std::array<double, 3>{1., 1., 1.},
const std::array< double, 3 > &  offset = std::array<double, 3>{.5, .5, .5} 
)

Fills any container (also AutoPas object) with a cuboid mesh of particles.

Particle properties will be used from the default particle. Particle IDs start from the default particle.

Template Parameters
ContainerArbitrary container class that needs to support addParticle().
Parameters
container
particlesPerDimNumber of particles per dimension.
defaultParticle
spacingFactor for distance between two particles along one dimension (default is 1).
offsetOffset to move all particles.

◆ fillWithParticles() [2/2]

template<class ParticleCell >
void autopasTools::generators::GridGenerator::fillWithParticles ( std::vector< ParticleCell > &  cells,
const std::array< size_t, 3 > &  cellsPerDimension,
const std::array< size_t, 3 > &  particlesPerDim,
const typename ParticleCell::ParticleType &  defaultParticle = typename ParticleCell::ParticleType(),
const std::array< double, 3 > &  spacing = std::array<double, 3>{1, 1, 1},
const std::array< double, 3 > &  offset = std::array<double, 3>{.5, .5, .5},
const std::array< double, 3 > &  cellSize = {1., 1., 1.} 
)

Fills a cell vector with a cuboid mesh of particles.

Template Parameters
ParticleCellType of ParticleCells in cell vector.
Parameters
cellsCell vector.
cellsPerDimensionNumber of cells per dimension.
particlesPerDimNumber of particles per dimension.
defaultParticle
spacingFactor for distance between two particles along one dimension (default is 1).
offsetOffset to move all particles.
cellSizeThe size of a cell.