Generator class for uniform distributions.
More...
|
| 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.
|
| |
Generator class for uniform distributions.
◆ 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
-
| Container | Arbitrary container class that needs to support getBoxMax() and addParticle(). |
| Particle | Type of the default particle. |
| HaloAddFunction | function with signature void(Container&, Particle) |
- Parameters
-
| container | |
| defaultParticle | |
| haloWidth | |
| numParticles | |
| haloAddFunction | the 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
-
| Container | Arbitrary container class that needs to support getBoxMax() and addParticle(). |
| Particle | Type 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
-
| Container | Arbitrary container class that needs to support getBoxMax() and addParticle(). |
| Particle | Type 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
-
| generator | Random engine |
| boxMin | |
| boxMax | |
- Returns
- 3D array with random values