BioCMAMC-ST
CmaUtils Namespace Reference

Namespace to handle algorithms and structures related to reading compartment mesh. More...

Classes

class  DiscontinuousFMT
 Derived class to handle Discontinuous transition between flowmaps. More...
 
class  FlowMapTransitionner
 Manages the reading, caching, and transitioning of flowmaps for simulation timesteps. More...
 
struct  IterationState
 Structure to store information about the reactor state during simulation. More...
 
class  LinterFMT
 Derived class to handle Linear interpolation transition between flowmaps. More...
 
class  PreCalculatedHydroState
 Structure to store hydrodynamic properties from a compartment mesh. More...
 
class  ProxyPreCalculatedHydroState
 Proxy class for PreCalculatedHydroState used to fill this struct with data from an external library. More...
 

Typedefs

template<typename Space >
using NeighborsView
 
using CumulativeProbaType = Eigen::Matrix<double, -1, -1, Eigen::RowMajor>
 

Enumerations

enum class  FlowmapTransitionMethod : char { Discontinuous , InterpolationFO }
 Defines the transition methods used between flowmaps. More...
 

Functions

std::unique_ptr< FlowMapTransitionnerget_transitioner (FlowmapTransitionMethod method, std::size_t n_flowmap, std::size_t n_per_flowmap, std::size_t number_time_step, std::unique_ptr< CmaRead::FlowIterator > &&iterator=nullptr, bool is_two_phase_flow=false)
 Transition factory according to the given method.
 
CumulativeProbaType get_cumulative_probabilities (CmaRead::Neighbors::Neighbors_const_view_t neighbors, const FlowMatrixType &m_transition)
 Computes the cumulative probability matrix from the transition matrix and neighbor information.
 
FlowMatrixType get_transition_matrix (const CmaRead::FlowMap::FlowMap_const_view_t &flows)
 Calculate the transition matrix representing phase flow.
 
std::vector< double > get_diag_transition (const FlowMatrixType &m_transition)
 Return the diagonal of the transition matrix (outflows).
 

Detailed Description

Namespace to handle algorithms and structures related to reading compartment mesh.

See also
Simulation::KernelInline::MoveFunctor
Note
See documentation page for full explanation

Typedef Documentation

◆ CumulativeProbaType

using CmaUtils::CumulativeProbaType = Eigen::Matrix<double, -1, -1, Eigen::RowMajor>

◆ NeighborsView

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

Enumeration Type Documentation

◆ FlowmapTransitionMethod

enum class CmaUtils::FlowmapTransitionMethod : char
strong

Defines the transition methods used between flowmaps.

Enumerator
Discontinuous 

Represents a sharp, abrupt transition.

InterpolationFO 

Represents a smooth transition using first-order interpolation.

Function Documentation

◆ get_cumulative_probabilities()

CumulativeProbaType CmaUtils::get_cumulative_probabilities ( CmaRead::Neighbors::Neighbors_const_view_t neighbors,
const FlowMatrixType & m_transition )

Computes the cumulative probability matrix from the transition matrix and neighbor information.

This function calculates the cumulative probability matrix for each zone (or compartment) based on the transition probabilities and the neighboring information. The cumulative probability matrix is used for determining the likelihood of moving to different compartments. This is by construction non-strictly increasing over rows

Parameters
neighborsA view of the neighbors for each compartment.
m_transitionThe transition matrix that provides the probabilities of transitioning from one compartment to another.
Returns
An Eigen::MatrixXd representing the cumulative probability matrix.
Here is the caller graph for this function:

◆ get_diag_transition()

std::vector< double > CmaUtils::get_diag_transition ( const FlowMatrixType & m_transition)

Return the diagonal of the transition matrix (outflows).

This function performs a copy of the diagonal elements.

Parameters
m_transitionReference to the transition matrix.
Returns
Vector of double containing the diagonal elements.
Here is the caller graph for this function:

◆ get_transition_matrix()

FlowMatrixType CmaUtils::get_transition_matrix ( const CmaRead::FlowMap::FlowMap_const_view_t & flows)

Calculate the transition matrix representing phase flow.

Converts a flow map read from the CmaRead private library into FlowMatrixType, a public typedef.

Parameters
flowsConstant view of FlowMap from CmaRead.
Returns
FlowMatrixType representing phase flow.
Here is the caller graph for this function:

◆ get_transitioner()

std::unique_ptr< FlowMapTransitionner > CmaUtils::get_transitioner ( FlowmapTransitionMethod method,
std::size_t n_flowmap,
std::size_t n_per_flowmap,
std::size_t number_time_step,
std::unique_ptr< CmaRead::FlowIterator > && iterator = nullptr,
bool is_two_phase_flow = false )

Transition factory according to the given method.

Creates and returns a unique pointer to a FlowMapTransitionner based on the provided method and configuration parameters.

Parameters
methodThe method to use for transition.
n_flowmapThe number of flow maps.
n_per_flowmapThe number of iteration per flow map.
number_time_stepThe number of time steps.
iteratorOptional unique pointer to a FlowIterator.
is_two_phase_flowBoolean flag indicating whether the flow is two-phase.
Returns
Unique pointer to FlowMapTransitionner.
Here is the caller graph for this function: