BioCMAMC-ST
MC::ParticlesContainer< Model > Class Template Reference

Main owning object for Monte-Carlo particles. More...

#include <particles_container.hpp>

Public Types

using UsedModel = Model
 Alias for the model used by the container.
 

Public Member Functions

 ParticlesContainer (std::size_t n_particle)
 
 ParticlesContainer ()
 
 ParticlesContainer (const ParticlesContainer &)=default
 Default copy and move constructors and assignment operators.
 
 ParticlesContainer (ParticlesContainer &&)=default
 
ParticlesContaineroperator= (const ParticlesContainer &)=default
 
ParticlesContaineroperator= (ParticlesContainer &&)=default
 
 ~ParticlesContainer ()=default
 Default destructor.
 
KOKKOS_INLINE_FUNCTION std::size_t n_particles () const
 Gets the number of particles in the container.
 
KOKKOS_INLINE_FUNCTION void get_contributions (std::size_t idx, const ContributionView &contributions) const
 
KOKKOS_INLINE_FUNCTION bool handle_division (const MC::KPRNG::pool_type &random_pool, std::size_t idx1) const
 
void clean_dead (std::size_t to_remove)
 
void merge_buffer ()
 
auto get_buffer_index () const
 
template<class Archive >
void save (Archive &ar) const
 
template<class Archive >
void load (Archive &ar)
 
KOKKOS_INLINE_FUNCTION double get_weight (std::size_t idx) const
 
double get_allocation_factor () const
 
std::size_t capacity () const
 

Public Attributes

Model::SelfParticle model
 
MC::ParticlePositions position
 
MC::ParticleStatus status
 
ParticleWeigths weights
 

Static Public Attributes

static constexpr double buffer_ratio = 0.6
 

Private Member Functions

void __allocate__ (std::size_t new_size)
 
void __allocate_buffer__ ()
 
void __shrink__ (std::size_t new_size, bool force)
 

Private Attributes

Model::SelfParticle buffer_model
 
ParticlePositions buffer_position
 
Kokkos::View< uint64_t, Kokkos::SharedSpace > buffer_index
 
double allocation_factor
 
std::size_t n_allocated_elements
 
uint64_t n_used_elements
 

Static Private Attributes

static constexpr double default_allocation_factor = 2
 

Detailed Description

template<ModelType Model>
class MC::ParticlesContainer< Model >

Main owning object for Monte-Carlo particles.

This class is responsible for managing and owning containers related to particles, providing access to them for processing in a Monte-Carlo simulation. It uses a templated model to define the behavior and properties of the particles.

Template Parameters
ModelThe particle model type used for defining the behavior and properties of the particles.

Member Typedef Documentation

◆ UsedModel

template<ModelType Model>
using MC::ParticlesContainer< Model >::UsedModel = Model

Alias for the model used by the container.

Constructor & Destructor Documentation

◆ ParticlesContainer() [1/4]

template<ModelType M>
MC::ParticlesContainer< M >::ParticlesContainer ( std::size_t n_particle)
explicit
Here is the call graph for this function:

◆ ParticlesContainer() [2/4]

template<ModelType M>
MC::ParticlesContainer< M >::ParticlesContainer ( )

◆ ParticlesContainer() [3/4]

template<ModelType Model>
MC::ParticlesContainer< Model >::ParticlesContainer ( const ParticlesContainer< Model > & )
default

Default copy and move constructors and assignment operators.

◆ ParticlesContainer() [4/4]

template<ModelType Model>
MC::ParticlesContainer< Model >::ParticlesContainer ( ParticlesContainer< Model > && )
default

◆ ~ParticlesContainer()

template<ModelType Model>
MC::ParticlesContainer< Model >::~ParticlesContainer ( )
default

Default destructor.

Member Function Documentation

◆ __allocate__()

template<ModelType Model>
void MC::ParticlesContainer< Model >::__allocate__ ( std::size_t new_size)
private
Here is the caller graph for this function:

◆ __allocate_buffer__()

template<ModelType Model>
void MC::ParticlesContainer< Model >::__allocate_buffer__ ( )
private
Here is the caller graph for this function:

◆ __shrink__()

template<ModelType Model>
void MC::ParticlesContainer< Model >::__shrink__ ( std::size_t new_size,
bool force )
private

◆ capacity()

template<ModelType Model>
std::size_t MC::ParticlesContainer< Model >::capacity ( ) const
inlinenodiscard

◆ clean_dead()

template<ModelType M>
void MC::ParticlesContainer< M >::clean_dead ( std::size_t to_remove)

◆ get_allocation_factor()

template<ModelType Model>
double MC::ParticlesContainer< Model >::get_allocation_factor ( ) const
inlinenodiscard

◆ get_buffer_index()

template<ModelType Model>
auto MC::ParticlesContainer< Model >::get_buffer_index ( ) const
inlinenodiscard

◆ get_contributions()

template<ModelType M>
KOKKOS_INLINE_FUNCTION void MC::ParticlesContainer< M >::get_contributions ( std::size_t idx,
const ContributionView & contributions ) const
Here is the caller graph for this function:

◆ get_weight()

template<ModelType M>
KOKKOS_INLINE_FUNCTION double MC::ParticlesContainer< M >::get_weight ( std::size_t idx) const
nodiscard

◆ handle_division()

template<ModelType Model>
KOKKOS_INLINE_FUNCTION bool MC::ParticlesContainer< Model >::handle_division ( const MC::KPRNG::pool_type & random_pool,
std::size_t idx1 ) const
nodiscard
Here is the caller graph for this function:

◆ load()

template<ModelType Model>
template<class Archive >
void MC::ParticlesContainer< Model >::load ( Archive & ar)
inline
Here is the call graph for this function:

◆ merge_buffer()

template<ModelType Model>
void MC::ParticlesContainer< Model >::merge_buffer ( )

◆ n_particles()

template<ModelType Model>
KOKKOS_INLINE_FUNCTION std::size_t MC::ParticlesContainer< Model >::n_particles ( ) const
inlinenodiscard

Gets the number of particles in the container.

Returns
The number of particles currently in the to_process container.
Here is the caller graph for this function:

◆ operator=() [1/2]

template<ModelType Model>
ParticlesContainer & MC::ParticlesContainer< Model >::operator= ( const ParticlesContainer< Model > & )
default

◆ operator=() [2/2]

template<ModelType Model>
ParticlesContainer & MC::ParticlesContainer< Model >::operator= ( ParticlesContainer< Model > && )
default

◆ save()

template<ModelType Model>
template<class Archive >
void MC::ParticlesContainer< Model >::save ( Archive & ar) const
inline

Member Data Documentation

◆ allocation_factor

template<ModelType Model>
double MC::ParticlesContainer< Model >::allocation_factor
private

◆ buffer_index

template<ModelType Model>
Kokkos::View<uint64_t, Kokkos::SharedSpace> MC::ParticlesContainer< Model >::buffer_index
private

◆ buffer_model

template<ModelType Model>
Model::SelfParticle MC::ParticlesContainer< Model >::buffer_model
private

◆ buffer_position

template<ModelType Model>
ParticlePositions MC::ParticlesContainer< Model >::buffer_position
private

◆ buffer_ratio

template<ModelType Model>
double MC::ParticlesContainer< Model >::buffer_ratio = 0.6
staticconstexpr

◆ default_allocation_factor

template<ModelType Model>
double MC::ParticlesContainer< Model >::default_allocation_factor = 2
staticconstexprprivate

◆ model

template<ModelType Model>
Model::SelfParticle MC::ParticlesContainer< Model >::model

◆ n_allocated_elements

template<ModelType Model>
std::size_t MC::ParticlesContainer< Model >::n_allocated_elements
private

◆ n_used_elements

template<ModelType Model>
uint64_t MC::ParticlesContainer< Model >::n_used_elements
private

◆ position

template<ModelType Model>
MC::ParticlePositions MC::ParticlesContainer< Model >::position

◆ status

template<ModelType Model>
MC::ParticleStatus MC::ParticlesContainer< Model >::status

◆ weights

template<ModelType Model>
ParticleWeigths MC::ParticlesContainer< Model >::weights

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