Generic dynamically allocated resizable storage.
Wrapper over enum allowing setting (and querying) individual bits of the stored value.
Generic wrappers of lambdas, functors and other callables.
uint32_t Size
Integral type used to index arrays (by default).
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
#define NAMESPACE_SPH_END
Random number generators.
Object providing safe access to continuous memory of data.
Generic dynamically allocated resizable storage.
virtual Array< Vector > generate(IScheduler &scheduler, const Size n, const IDomain &domain) const override
Generates the requested number of particles in the domain.
Distribution with given particle density.
DiehlDistribution(const DiehlParams ¶ms)
Constructs the distribution.
virtual Array< Vector > generate(IScheduler &scheduler, const Size n, const IDomain &domain) const override
Returns generated particle distribution.
HexagonalPacking(const Flags< Options > flags=Options::CENTER)
virtual Array< Vector > generate(IScheduler &scheduler, const Size n, const IDomain &domain) const override
Generates the requested number of particles in the domain.
@ SORTED
Particles are sorted using its Morton code.
@ SPH5_COMPATIBILITY
Generates the grid to match code SPH5 for 1-1 comparison.
@ CENTER
Move particle lattice so that their center of mass matches center of domain.
Base class for generating vertices with specific distribution.
virtual Array< Vector > generate(IScheduler &scheduler, const Size n, const IDomain &domain) const =0
Generates the requested number of particles in the domain.
Base class for computational domains.
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
Generates particles uniformly on a line in x direction, for testing purposes.
virtual Array< Vector > generate(IScheduler &scheduler, const Size n, const IDomain &domain) const override
Generates the requested number of particles in the domain.
Parametrized spiraling scheme by Saff & Kuijlaars (1997).
virtual Array< Vector > generate(IScheduler &scheduler, const Size n, const IDomain &domain) const override
Generates the requested number of particles in the domain.
ParametrizedSpiralingDistribution(const Size seed)
Generating random positions withing the domain.
virtual Array< Vector > generate(IScheduler &scheduler, const Size n, const IDomain &domain) const override
Generates the requested number of particles in the domain.
RandomDistribution(AutoPtr< IRng > &&rng)
Creates a random distribution given random number generator.
Generates random positions using stratified sampling.
virtual Array< Vector > generate(IScheduler &scheduler, const Size n, const IDomain &domain) const override
Generates the requested number of particles in the domain.
StratifiedDistribution(const Size seed)
Vector position(const Float a, const Float e, const Float u)
Computes the position on the elliptic trajectory.
Parameters of DiehlDistribution.
Float small
Normalization value to prevent division by zero for overlapping particles.
DensityFunc particleDensity
Function specifies the particle density in space.
Size numOfIters
Number of iterations.
Float strength
Magnitude of a repulsive force between particles that moves them to their final locations.
Function< bool(Size iter, ArrayView< const Vector > r)> onIteration
Optional callback executed once every iteration.
Size maxDifference
Allowed difference between the expected and actual number of particles.
Base class for all polymorphic objects.