AutoPas  3.0.0
Loading...
Searching...
No Matches
Functions
autopas::generators::HCPGenerator Namespace Reference

Generator for an hexagonally closest packed particle grid. More...

Functions

size_t getNumberOfParticles (const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax, const double spacing=1.0, const bool centeredAlignment=false)
 Calculates the number of particles generated in an HCP lattice within [boxMin, boxMax) in O(1) time.
 
template<class Container >
void fillWithParticles (Container &container, const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax, const typename autopas::utils::ParticleTypeTrait< Container >::value &defaultParticle=typename autopas::utils::ParticleTypeTrait< Container >::value(), const double spacing=1., const bool centeredAlignment=false)
 Fills any container (also AutoPas object) with hexagonally closest packed particles.
 

Detailed Description

Generator for an hexagonally closest packed particle grid.

Function Documentation

◆ fillWithParticles()

template<class Container >
void autopas::generators::HCPGenerator::fillWithParticles ( Container &  container,
const std::array< double, 3 > &  boxMin,
const std::array< double, 3 > &  boxMax,
const typename autopas::utils::ParticleTypeTrait< Container >::value &  defaultParticle = typename autopas::utils::ParticleTypeTrait<Container>::value(),
const double  spacing = 1.,
const bool  centeredAlignment = false 
)

Fills any container (also AutoPas object) with hexagonally closest packed 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
boxMin
boxMax
defaultParticle
spacingDistance between all neighboring particles
centeredAlignmentIf true, the cell offset moved inward by 1/4 * lattice constant.

◆ getNumberOfParticles()

size_t autopas::generators::HCPGenerator::getNumberOfParticles ( const std::array< double, 3 > &  boxMin,
const std::array< double, 3 > &  boxMax,
const double  spacing = 1.0,
const bool  centeredAlignment = false 
)
inline

Calculates the number of particles generated in an HCP lattice within [boxMin, boxMax) in O(1) time.

Parameters
boxMin
boxMax
spacingNearest-neighbor distance d.
centeredAlignmentIf true, the cell offset moved inward by 1/4 * lattice constant.
Returns
Number of particles.