src/DiffEq/InitPolicy.hpp file

Initialization policies.


General requirements on initialization policy classes:

  • Must define the member function init, which is used to do the initialization. Required signature:

    template< class eq >
    static void init( const ctr::InputDeck& deck,
                      const tk::RNG& rng,
                      int stream,
                      tk::Particles& particles,
                      tk::ctr::ncomp_t e,
                      tk::ctr::ncomp_t ncomp,
                      tk::ctr::ncomp_t offset );

    where deck is the input deck from which configuration is read, rng is a reference to a random number generator to use, stream is the thread (or stream) id, particles denotes the particle properties array to be initialized, e is the component index selecting which equation is to be initialized in the system, ncomp is the total number of equations in the system, and offset is the offset in the particle array at which initialization should be done.

  • Must define the static function type(), returning the enum value of the policy option. Example:

    static ctr::InitPolicyType type() noexcept {
      return ctr::InitPolicyType::RAW;

    which returns the enum value of the option from the underlying option class, collecting all possible options for initialization policies.


namespace walker
Walker declarations and definitions.


struct walker::InitRaw
Raw initialization policy: leave memory uninitialized.
struct walker::InitZero
Zero initialization policy: zero particle properties.
struct walker::InitDelta
Delta initialization policy: put in delta-spikes as the joint PDF.
struct walker::InitBeta
Beta initialization policy: generate samples from a joint beta PDF.
struct walker::InitGaussian
struct walker::InitCorrGaussian
Gaussian initialization policy: generate samples from a joint correlated Gaussian PDF.
struct walker::InitGamma
Gamma initialization policy: generate samples from a joint gamma PDF.
struct walker::InitDirichlet
Dirichlet initialization policy: generate samples from a Dirichlet PDF.