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

Generator class for uniform distributions. More...

Functions

std::array< double, 3 > randomPosition (std::mt19937 &generator, const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax)
 Generate a random position within a given box.
 
template<class Container , class Particle >
void fillWithParticles (Container &container, const Particle &defaultParticle, const std::array< double, 3 > &boxMin, const std::array< double, 3 > &boxMax, unsigned long numParticles=100ul, unsigned int seed=42)
 Fills any container (also AutoPas object) with randomly uniformly distributed particles.
 
template<class Container , class Particle , class HaloAddFunction >
void fillWithHaloParticles (Container &container, const Particle &defaultParticle, double haloWidth, unsigned long numParticles, const HaloAddFunction &haloAddFunction, unsigned int seed=42)
 Fills the halo of a container (also AutoPas object) with randomly uniformly distributed particles.
 
template<class Container , class Particle >
void fillWithHaloParticles (Container &container, const Particle &defaultParticle, double haloWidth, unsigned long numParticles, unsigned int seed=42)
 Fills the halo of a container with randomly uniformly distributed particles.
 

Detailed Description

Generator class for uniform distributions.

Function Documentation

◆ fillWithHaloParticles() [1/2]

template<class Container , class Particle , class HaloAddFunction >
void autopasTools::generators::UniformGenerator::fillWithHaloParticles ( Container &  container,
const Particle &  defaultParticle,
double  haloWidth,
unsigned long  numParticles,
const HaloAddFunction &  haloAddFunction,
unsigned int  seed = 42 
)

Fills the halo of a container (also AutoPas object) with randomly uniformly distributed particles.

Use haloAddFunction to specify how to add particles to the container!

Template Parameters
ContainerArbitrary container class that needs to support getBoxMax() and addParticle().
ParticleType of the default particle.
HaloAddFunctionfunction with signature void(Container&, Particle)
Parameters
container
defaultParticle
haloWidth
numParticles
haloAddFunctionthe function of type HaloAddfunction that adds a halo particle to the container.
seed

◆ fillWithHaloParticles() [2/2]

template<class Container , class Particle >
void autopasTools::generators::UniformGenerator::fillWithHaloParticles ( Container &  container,
const Particle &  defaultParticle,
double  haloWidth,
unsigned long  numParticles,
unsigned int  seed = 42 
)

Fills the halo of a container with randomly uniformly distributed particles.

Container needs to support addHaloParticle(). If it does not support this, please use the version above.

Template Parameters
ContainerArbitrary container class that needs to support getBoxMax() and addParticle().
ParticleType of the default particle.
Parameters
container
defaultParticle
haloWidth
numParticles
seed

◆ fillWithParticles()

template<class Container , class Particle >
void autopasTools::generators::UniformGenerator::fillWithParticles ( Container &  container,
const Particle &  defaultParticle,
const std::array< double, 3 > &  boxMin,
const std::array< double, 3 > &  boxMax,
unsigned long  numParticles = 100ul,
unsigned int  seed = 42 
)

Fills any container (also AutoPas object) with randomly uniformly distributed 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 getBoxMax() and addParticle().
ParticleType of the default particle.
Parameters
container
defaultParticle
boxMin
boxMax
numParticles
seed

◆ randomPosition()

std::array< double, 3 > autopasTools::generators::UniformGenerator::randomPosition ( std::mt19937 &  generator,
const std::array< double, 3 > &  boxMin,
const std::array< double, 3 > &  boxMax 
)

Generate a random position within a given box.

Parameters
generatorRandom engine
boxMin
boxMax
Returns
3D array with random values