SPH
Public Member Functions | List of all members
IDistribution Class Referenceabstract

Base class for generating vertices with specific distribution. More...

#include <Distribution.h>

Inheritance diagram for IDistribution:
Polymorphic CubicPacking DiehlDistribution Distribution HexagonalPacking KelvinHelmholtzDistribution LinearDistribution ParametrizedSpiralingDistribution PlanarDistribution RandomDistribution StratifiedDistribution

Public Member Functions

virtual Array< Vectorgenerate (IScheduler &scheduler, const Size n, const IDomain &domain) const =0
 Generates the requested number of particles in the domain. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Base class for generating vertices with specific distribution.

Also generates corresponding smoothing lengths and save them as fourth component of the vector.

Definition at line 21 of file Distribution.h.

Member Function Documentation

◆ generate()

virtual Array<Vector> IDistribution::generate ( IScheduler scheduler,
const Size  n,
const IDomain domain 
) const
pure virtual

Generates the requested number of particles in the domain.

Function shall also set the smoothing lenghts of the generated particles in the 4th components of the returned vectors.

Parameters
schedulerScheduler that can be used for parallelization.
nExpected number of generated particles.
domainComputational domain where the vertices are distributed
Returns
Output array of vertices. The total number of vertices can slightly differ from n.
Note
This method is expected to be called once at the beginning of the run, so we can return allocated array without worrying about performance costs here.

Implemented in LinearDistribution, ParametrizedSpiralingDistribution, DiehlDistribution, HexagonalPacking, CubicPacking, StratifiedDistribution, RandomDistribution, PlanarDistribution, KelvinHelmholtzDistribution, and Distribution.


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