|
BioCMAMC-ST
|
A class responsible for initializing various components of a simulation framework. More...
#include <global_initaliser.hpp>
Classes | |
| struct | inner |
Public Types | |
| template<typename T> | |
| using | OptionalPtr = std::optional<std::unique_ptr<T>> |
| Type alias for an optional unique pointer. | |
Public Member Functions | |
| GlobalInitialiser (const ExecInfo &_info, UserControlParameters _user_params, std::shared_ptr< Mixture::SpecieTable > table, std::shared_ptr< IO::Logger >=nullptr) | |
| Constructs a GlobalInitialiser instance. | |
| std::optional< bool > | init_state (const CmaUtils::TransitionnerPtrType &transiionner) |
| Initializes a flow iterator. | |
| std::optional< CmaUtils::TransitionnerPtrType > | init_transitionner () |
| Initializes a transitioner with the provided flow iterator. | |
| OptionalPtr< Simulation::SimulationUnit > | init_simulation (std::optional< Core::ScalarFactory::ScalarVariant > variant) |
| Initializes a simulation unit. | |
| OptionalPtr< Simulation::SimulationUnit > | init_simulation (std::unique_ptr< MC::MonteCarloUnit > _unit, Simulation::ScalarInitializer &&scalar_init) |
| Initializes a simulation unit with specified parameters. | |
| std::optional< Simulation::ScalarInitializer > | init_scalar () |
| Initializes a scalar component of the simulation. | |
| std::optional< Simulation::ScalarInitializer > | init_scalar (Core::ScalarFactory::ScalarVariant &&variant) |
| std::optional< bool > | init_mtr_model (std::optional< Simulation::MassTransfer::Type::MtrTypeVariant > &&variant) |
| bool | init_feed (std::optional< Simulation::Feed::SimulationFeed > feed=std::nullopt) |
| Initializes a simulation feed. | |
| OptionalPtr< MC::MonteCarloUnit > | init_monte_carlo () |
| Initializes a Monte Carlo unit. | |
| bool | check_init_terminate () const |
| Checks if all initialization steps have been validated. | |
| SimulationParameters | get_parameters () const |
| void | set_initial_number_particle (uint64_t np) noexcept |
| void | set_table (std::shared_ptr< Mixture::SpecieTable > t) noexcept |
Private Types | |
| enum class | InitStep : std::size_t { Transitioner = 0 , InitState , Scalar , Feed , MC , SimulationUnit , MTR , Count } |
| Enum to define initialization steps. More... | |
Private Member Functions | |
| void | set_logger (std::shared_ptr< IO::Logger > _logger) |
| template<typename... Args> | |
| bool | check_steps (InitStep step, Args... args) const |
| Checks the validity of specified initialization steps. | |
| template<typename... Args> | |
| void | validate_step (InitStep step, Args... args) |
| Validates the specified initialization step and any additional steps. | |
| std::optional< bool > | host_init_state (const CmaUtils::TransitionnerPtrType &transiionner) |
| Retrieves path files based on the provided case path. | |
| void | mpi_broadcast () |
| Performs MPI broadcast for synchronization. | |
Private Attributes | |
| std::shared_ptr< Mixture::SpecieTable > | m_table |
| Core::SimulationUnitBuilder | m_builder {} |
| std::array< bool, static_cast< size_t >(InitStep::Count)> | validated_steps {} |
| Array to track validated initialization steps. | |
| ExecInfo | info |
| SimulationParameters | m_params |
| UserControlParameters | user_params |
| std::vector< double > | m_liquid_volume |
| std::vector< double > | m_gas_volume |
| std::vector< std::size_t > | m_flat_neighobrs |
| double | t_per_flowmap {} |
| bool | f_init_gas_flow |
| std::shared_ptr< IO::Logger > | m_logger |
| bool | is_host |
| Flag indicating if this instance is the host. | |
A class responsible for initializing various components of a simulation framework.
| using Core::GlobalInitialiser::OptionalPtr = std::optional<std::unique_ptr<T>> |
Type alias for an optional unique pointer.
This template alias provides a way to represent an optional ownership of a unique pointer of type T.
|
strongprivate |
Enum to define initialization steps.
Each member represents a distinct step in the initialization process, except for the last member, Count, which signifies the total number of initialization steps.
| Core::GlobalInitialiser::GlobalInitialiser | ( | const ExecInfo & | _info, |
| UserControlParameters | _user_params, | ||
| std::shared_ptr< Mixture::SpecieTable > | table, | ||
| std::shared_ptr< IO::Logger > | _logger = nullptr ) |
Constructs a GlobalInitialiser instance.
| _info | Execution information containing context for the simulation. |
| _params | Simulation parameters that configure the simulation behavior. |
|
nodiscard |
Checks if all initialization steps have been validated.
|
inlinenodiscardprivate |
Checks the validity of specified initialization steps.
| step | The current initialization step to check. |
| args | Additional steps to check. |
|
nodiscard |
|
private |
Retrieves path files based on the provided case path.
| cma_case_path | The path for the CMA case. |
Host speciffic state init
| bool Core::GlobalInitialiser::init_feed | ( | std::optional< Simulation::Feed::SimulationFeed > | feed = std::nullopt | ) |
Initializes a simulation feed.
| OptionalPtr< MC::MonteCarloUnit > Core::GlobalInitialiser::init_monte_carlo | ( | ) |
Initializes a Monte Carlo unit.
| std::optional< bool > Core::GlobalInitialiser::init_mtr_model | ( | std::optional< Simulation::MassTransfer::Type::MtrTypeVariant > && | variant | ) |
| std::optional< Simulation::ScalarInitializer > Core::GlobalInitialiser::init_scalar | ( | ) |
Initializes a scalar component of the simulation.
| std::optional< Simulation::ScalarInitializer > Core::GlobalInitialiser::init_scalar | ( | Core::ScalarFactory::ScalarVariant && | variant | ) |
| OptionalPtr< Simulation::SimulationUnit > Core::GlobalInitialiser::init_simulation | ( | std::optional< Core::ScalarFactory::ScalarVariant > | variant | ) |
Initializes a simulation unit.
| OptionalPtr< Simulation::SimulationUnit > Core::GlobalInitialiser::init_simulation | ( | std::unique_ptr< MC::MonteCarloUnit > | _unit, |
| Simulation::ScalarInitializer && | scalar_init ) |
Initializes a simulation unit with specified parameters.
| _unit | A unique pointer to the Monte Carlo unit initialized. |
| scalar_init | A scalar initializer for the simulation. |
| _feed | An optional simulation feed for initialization. |
| std::optional< bool > Core::GlobalInitialiser::init_state | ( | const CmaUtils::TransitionnerPtrType & | transiionner | ) |
Initializes a flow iterator.
Initializes the simulation state.
| flow_handle | A unique pointer to the flow iterator used for state initialization. |
| std::optional< CmaUtils::TransitionnerPtrType > Core::GlobalInitialiser::init_transitionner | ( | ) |
Initializes a transitioner with the provided flow iterator.
| flow_handle | A unique pointer to the flow iterator. |
Initializes a transitioner without parameters.
|
private |
Performs MPI broadcast for synchronization.
|
noexcept |
|
private |
|
noexcept |
|
inlineprivate |
Validates the specified initialization step and any additional steps.
| step | The current initialization step to validate. |
| args | Additional steps to validate. |
|
private |
|
private |
|
private |
Flag indicating if this instance is the host.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Array to track validated initialization steps.