BioCMAMC-ST
MC Namespace Reference

Namespace that contains classes and structures related to Monte Carlo (MC) simulations. More...

Namespaces

namespace  Distributions
 Kokkos compatible method to draw from specific probability distribution.

Classes

struct  ContribIndexBounds
struct  EventContainer
 Use to count events that occurs during Monte-Carlo processing cycles. More...
class  KPRNG
 Utilities and wrap around kokkos random generator. More...
struct  MonteCarloUnit
 General-purpose Monte Carlo unit to carry out simulations. More...
class  ParticlesContainer
 Main owning object for Monte-Carlo particles. More...
class  ReactorDomain
 Represents the spatial domain where Monte Carlo particles can exist. More...

Typedefs

using ComputeSpace = Kokkos::DefaultExecutionSpace
using restrict_mt = Kokkos::MemoryTraits<Kokkos::MemoryTraitsFlags::Restrict>
using ParticlePositions = Kokkos::View<uint64_t*, ComputeSpace>
using ParticleStatus = Kokkos::View<Status*, ComputeSpace>
using ParticleWeigths = Kokkos::View<double*, ComputeSpace>
using ParticleAges = ParticleAgesBase<ComputeSpace>
template<typename MemorySpace>
using ParticlePropertyViewType
using PropertySubViewtype
using ContributionView
using KernelConcentrationType
using LocalConcentration
template<typename Space>
using NeighborsView
template<uint64_t Nd, FloatingPointType F>
using ParticlesModel = Kokkos::View<F* [Nd], Kokkos::LayoutRight>
template<FloatingPointType F>
using DynParticlesModel = Kokkos::View<F**, Kokkos::LayoutRight>

Enumerations

enum class  Status : char { Idle = 0 , Division , Exit , Dead }
enum class  EventType : char {
  NewParticle = 0 , Exit , Move , Death ,
  Overflow , ChangeWeight , __COUNT__
}
 Enumeration that represents events that can occurs during a Monte-Carlo cycle. More...

Functions

template<EventType event>
KOKKOS_INLINE_FUNCTION consteval size_t event_index ()
 inline getter, converts event to its value in order to be use as array index
void impl_init (double &total_mass, uint64_t n_particles, MonteCarloUnit &unit, AutoGenerated::ContainerVariant &&container, bool uniform_init)
template<ModelType Model>
std::unique_ptr< MonteCarloUnitinit (const std::shared_ptr< IO::Logger > &_logger, uint64_t n_particles, std::span< double > volumes, const NeighborsView< HostSpace > &neighbors, bool uniform_mc_init, double &total_mass)
 Helper function to initialize a MonteCarloUnit.
void post_init_weight (std::unique_ptr< MonteCarloUnit > &unit, double x0, double total_mass)
template<typename FunctorType, typename Tag = void>
Kokkos::TeamPolicy< ComputeSpace, Tag > get_policy (const FunctorType &f, std::size_t range, bool reduce=false)
template<typename Tag = void>
Kokkos::TeamPolicy< ComputeSpace, Tag > get_policy_team ()

Variables

constexpr size_t number_event_type

Detailed Description

Namespace that contains classes and structures related to Monte Carlo (MC) simulations.

This namespace encapsulates all the components used in Monte Carlo simulations, including data structures for managing simulation state and results.

Typedef Documentation

◆ ComputeSpace

using MC::ComputeSpace = Kokkos::DefaultExecutionSpace

◆ ContributionView

Initial value:
decltype(Kokkos::Experimental::create_scatter_view(kernelContribution()))
Examples
example_model.cxx.

◆ DynParticlesModel

template<FloatingPointType F>
using MC::DynParticlesModel = Kokkos::View<F**, Kokkos::LayoutRight>

◆ KernelConcentrationType

Initial value:
Kokkos::View<const double**,
Kokkos::LayoutLeft,
Kokkos::MemoryTraits<Kokkos::RandomAccess>>
Kokkos::DefaultExecutionSpace ComputeSpace
Definition alias.hpp:10

◆ LocalConcentration

Initial value:
Kokkos::Subview<KernelConcentrationType, int, decltype(Kokkos::ALL)>
Kokkos::View< const double **, Kokkos::LayoutLeft, ComputeSpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > > KernelConcentrationType
Definition alias.hpp:67
Examples
example_model.cxx.

◆ NeighborsView

template<typename Space>
using MC::NeighborsView
Initial value:
Kokkos::View<std::size_t**,
Kokkos::LayoutRight,
Space,
Kokkos::MemoryTraits<Kokkos::RandomAccess>>

◆ ParticleAges

using MC::ParticleAges = ParticleAgesBase<ComputeSpace>

◆ ParticlePositions

using MC::ParticlePositions = Kokkos::View<uint64_t*, ComputeSpace>

◆ ParticlePropertyViewType

template<typename MemorySpace>
using MC::ParticlePropertyViewType
Initial value:
Kokkos::View<double**, Kokkos::LayoutRight, MemorySpace>

◆ ParticlesModel

template<uint64_t Nd, FloatingPointType F>
using MC::ParticlesModel = Kokkos::View<F* [Nd], Kokkos::LayoutRight>

◆ ParticleStatus

using MC::ParticleStatus = Kokkos::View<Status*, ComputeSpace>

◆ ParticleWeigths

using MC::ParticleWeigths = Kokkos::View<double*, ComputeSpace>

◆ PropertySubViewtype

Initial value:
Kokkos::Subview<ParticlePropertyViewType<ComputeSpace>,
decltype(Kokkos::ALL),
std::size_t>

◆ restrict_mt

using MC::restrict_mt = Kokkos::MemoryTraits<Kokkos::MemoryTraitsFlags::Restrict>

Enumeration Type Documentation

◆ EventType

enum class MC::EventType : char
strong

Enumeration that represents events that can occurs during a Monte-Carlo cycle.

Enumerator
NewParticle 

Spawn new particle.

Exit 

Remove particle from list due to move in domain.

Move 

Move in domain.

Death 

Remove particle from list.

Overflow 
ChangeWeight 

Update in weight.

__COUNT__ 

◆ Status

enum class MC::Status : char
strong
Enumerator
Idle 
Division 
Exit 
Dead 
Examples
example_model.cxx.

Function Documentation

◆ event_index()

template<EventType event>
KOKKOS_INLINE_FUNCTION consteval size_t MC::event_index ( )
consteval

inline getter, converts event to its value in order to be use as array index

Here is the caller graph for this function:

◆ get_policy()

template<typename FunctorType, typename Tag = void>
Kokkos::TeamPolicy< ComputeSpace, Tag > MC::get_policy ( const FunctorType & f,
std::size_t range,
bool reduce = false )
Here is the caller graph for this function:

◆ get_policy_team()

template<typename Tag = void>
Kokkos::TeamPolicy< ComputeSpace, Tag > MC::get_policy_team ( )

◆ impl_init()

void MC::impl_init ( double & total_mass,
uint64_t n_particles,
MonteCarloUnit & unit,
AutoGenerated::ContainerVariant && container,
bool uniform_init )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

template<ModelType Model>
std::unique_ptr< MonteCarloUnit > MC::init ( const std::shared_ptr< IO::Logger > & _logger,
uint64_t n_particles,
std::span< double > volumes,
const NeighborsView< HostSpace > & neighbors,
bool uniform_mc_init,
double & total_mass )

Helper function to initialize a MonteCarloUnit.

Since MonteCarloUnit is not a generic type and the model type is resolved at runtime, no constructors are defined to avoid carrying template functions when using the unit. This function wraps the constructor externally, providing a convenient way to initialize a MonteCarloUnit with the appropriate model type and parameters.

Template Parameters
ModelThe particle model type, specified at compile time.
Returns
A unique pointer to the initialized MonteCarloUnit.
Here is the call graph for this function:

◆ post_init_weight()

void MC::post_init_weight ( std::unique_ptr< MonteCarloUnit > & unit,
double x0,
double total_mass )
Here is the caller graph for this function:

Variable Documentation

◆ number_event_type

size_t MC::number_event_type
constexpr
Initial value:
= static_cast<std::size_t>(
@ __COUNT__
Definition events.hpp:24