15namespace autopasTools::generators {
19namespace UniformGenerator {
27std::array<double, 3>
randomPosition(std::mt19937 &generator,
const std::array<double, 3> &boxMin,
28 const std::array<double, 3> &boxMax);
42template <
class Container,
class Particle>
43void fillWithParticles(Container &container,
const Particle &defaultParticle,
const std::array<double, 3> &boxMin,
44 const std::array<double, 3> &boxMax,
unsigned long numParticles = 100ul,
unsigned int seed = 42);
59template <
class Container,
class Particle,
class HaloAddFunction>
61 unsigned long numParticles,
const HaloAddFunction &haloAddFunction,
unsigned int seed = 42);
74template <
class Container,
class Particle>
76 unsigned long numParticles,
unsigned int seed = 42) {
78 container, defaultParticle, haloWidth, numParticles,
79 [](Container &c, Particle &p) {
87template <
class Container,
class Particle>
89 const std::array<double, 3> &boxMin,
const std::array<double, 3> &boxMax,
90 unsigned long numParticles,
unsigned int seed) {
91 std::mt19937 generator(seed);
93 for (
unsigned long i = defaultParticle.getID(); i < defaultParticle.getID() + numParticles; ++i) {
94 Particle particle(defaultParticle);
98 container.addParticle(particle);
102template <
class Container,
class Particle,
class HaloAddFunction>
104 unsigned long numParticles,
const HaloAddFunction &haloAddFunction,
106 std::mt19937 generator(seed);
108 auto haloBoxMin = container.getBoxMin();
109 auto haloBoxMax = container.getBoxMax();
112 for (
unsigned int i = 0; i < 3; ++i) {
113 haloBoxMin[i] -= haloWidth * .99;
114 haloBoxMax[i] += haloWidth * .99;
117 for (
unsigned long i = defaultParticle.getID(); i < defaultParticle.getID() + numParticles; ++i) {
123 Particle particle(defaultParticle);
126 haloAddFunction(container, particle);
bool inBox(const std::array< T, 3 > &position, const std::array< T, 3 > &low, const std::array< T, 3 > &high)
Checks if position is inside of a box defined by low and high.
Definition: inBox.h:26
@ halo
Halo state, a particle with this state is an actual particle, but not owned by the current AutoPas ob...
@ owned
Owned state, a particle with this state is an actual particle and owned by the current AutoPas object...