SPH
Public Member Functions | List of all members
RandomDistribution Class Reference

Generating random positions withing the domain. More...

#include <Distribution.h>

Inheritance diagram for RandomDistribution:
IDistribution Polymorphic

Public Member Functions

 RandomDistribution (AutoPtr< IRng > &&rng)
 Creates a random distribution given random number generator. More...
 
 RandomDistribution (const Size seed)
 Creates a random distribution with uniform sampling. More...
 
virtual Array< Vectorgenerate (IScheduler &scheduler, const Size n, const IDomain &domain) const override
 Generates the requested number of particles in the domain. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Generating random positions withing the domain.

Definition at line 38 of file Distribution.h.

Constructor & Destructor Documentation

◆ RandomDistribution() [1/2]

NAMESPACE_SPH_BEGIN RandomDistribution::RandomDistribution ( AutoPtr< IRng > &&  rng)
explicit

Creates a random distribution given random number generator.

Definition at line 20 of file Distribution.cpp.

◆ RandomDistribution() [2/2]

RandomDistribution::RandomDistribution ( const Size  seed)
explicit

Creates a random distribution with uniform sampling.

Parameters
seedSeed for the uniform RNG.

Definition at line 23 of file Distribution.cpp.

Member Function Documentation

◆ generate()

Array< Vector > RandomDistribution::generate ( IScheduler scheduler,
const Size  n,
const IDomain domain 
) const
overridevirtual

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.

Implements IDistribution.

Definition at line 26 of file Distribution.cpp.


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