SPH
Public Types | Public Attributes | List of all members
DiehlParams Struct Reference

Parameters of DiehlDistribution. More...

#include <Distribution.h>

Public Types

using DensityFunc = Function< Float(const Vector &position)>
 

Public Attributes

DensityFunc particleDensity = [](const Vector&) { return 1._f; }
 Function specifies the particle density in space. More...
 
Size maxDifference = 10
 Allowed difference between the expected and actual number of particles. More...
 
Size numOfIters = 50
 Number of iterations. More...
 
Float strength = 0.1_f
 Magnitude of a repulsive force between particles that moves them to their final locations. More...
 
Float small = 0.1_f
 Normalization value to prevent division by zero for overlapping particles. More...
 
Function< bool(Size iter, ArrayView< const Vector > r)> onIteration = nullptr
 Optional callback executed once every iteration. More...
 

Detailed Description

Parameters of DiehlDistribution.

Definition at line 108 of file Distribution.h.

Member Typedef Documentation

◆ DensityFunc

using DiehlParams::DensityFunc = Function<Float(const Vector& position)>

Definition at line 109 of file Distribution.h.

Member Data Documentation

◆ maxDifference

Size DiehlParams::maxDifference = 10

Allowed difference between the expected and actual number of particles.

Lower value generates number of particles closer to required value, but takes longer to compute.

Definition at line 120 of file Distribution.h.

◆ numOfIters

Size DiehlParams::numOfIters = 50

Number of iterations.

For zero, distribution of particles is simply random, higher values lead to more evenly distributed particles (less discrepancy), but also take longer to compute.

Definition at line 126 of file Distribution.h.

◆ onIteration

Function<bool(Size iter, ArrayView<const Vector> r)> DiehlParams::onIteration = nullptr

Optional callback executed once every iteration.

The generator passes the iteration number and the current particle distribution as parameters. Functor may return false to cancel the iterative algorithm prematurely and return the current particle distribution.

Definition at line 143 of file Distribution.h.

◆ particleDensity

DensityFunc DiehlParams::particleDensity = [](const Vector&) { return 1._f; }

Function specifies the particle density in space.

Does not have to be normalized, only a relative number of particles at different places is relevant. It has to be strictly non-negative in the domain.

Definition at line 115 of file Distribution.h.

◆ small

Float DiehlParams::small = 0.1_f

Normalization value to prevent division by zero for overlapping particles.

Keep default, only for testing.

Definition at line 136 of file Distribution.h.

◆ strength

Float DiehlParams::strength = 0.1_f

Magnitude of a repulsive force between particles that moves them to their final locations.

Larger values mean faster convergence but less stable particle grid.

Definition at line 131 of file Distribution.h.


The documentation for this struct was generated from the following file: