A class responsible for initializing various components of a simulation framework.
More...
#include <global_initaliser.hpp>
|
template<typename T > |
using | OptionalPtr = std::optional<std::unique_ptr<T>> |
| Type alias for an optional unique pointer.
|
|
|
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.
|
|
CmtCommons::cma_exported_paths_t | get_path_files (const std::string &cma_case_path) |
| Retrieves path files based on the provided case path.
|
|
std::optional< bool > | host_init_state (std::unique_ptr< CmaRead::FlowIterator > &flow_handle) |
| Host speciffic state init.
|
|
void | mpi_broadcast () |
| Performs MPI broadcast for synchronization.
|
|
A class responsible for initializing various components of a simulation framework.
◆ OptionalPtr
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.
◆ InitStep
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.
- Note
- This enum class leverages a C++ feature where if the first member is initialized to 0, the subsequent members are automatically assigned incrementing integer values. Thus, the
Count
member effectively represents the total number of steps (n), minus one for zero-based indexing.
Enumerator |
---|
FlowIterator | Step for initializing the flow iterator.
|
Transitioner | Step for initializing the transitioner.
|
InitState | Step for initializing the simulation state.
|
Scalar | Step for initializing scalar values.
|
Feed | Step for initializing the simulation feed.
|
MC | Step for initializing the Monte Carlo unit.
|
SimulationUnit | Step for initializing the simulation unit.
|
Count | Total number of steps in the initialization sequence.
|
◆ GlobalInitialiser()
Constructs a GlobalInitialiser instance.
- Parameters
-
_info | Execution information containing context for the simulation. |
_params | Simulation parameters that configure the simulation behavior. |
◆ check_init_terminate()
bool Core::GlobalInitialiser::check_init_terminate |
( |
| ) |
const |
|
nodiscard |
Checks if all initialization steps have been validated.
- Returns
- A boolean indicating whether initialization can be terminated.
◆ check_steps()
template<typename... Args>
bool Core::GlobalInitialiser::check_steps |
( |
InitStep | step, |
|
|
Args... | args ) const |
|
inlinenodiscardprivate |
Checks the validity of specified initialization steps.
- Parameters
-
step | The current initialization step to check. |
args | Additional steps to check. |
- Returns
- A boolean indicating whether all specified steps are validated.
◆ get_parameters()
◆ get_path_files()
CmtCommons::cma_exported_paths_t Core::GlobalInitialiser::get_path_files |
( |
const std::string & | cma_case_path | ) |
|
|
private |
Retrieves path files based on the provided case path.
- Parameters
-
cma_case_path | The path for the CMA case. |
- Returns
- A structure containing exported paths.
◆ host_init_state()
std::optional< bool > Core::GlobalInitialiser::host_init_state |
( |
std::unique_ptr< CmaRead::FlowIterator > & | flow_handle | ) |
|
|
private |
Host speciffic state init.
◆ init_feed()
Initializes a simulation feed.
- Returns
- An optional simulation feed.
◆ init_flow_iterator()
OptionalPtr< CmaRead::FlowIterator > Core::GlobalInitialiser::init_flow_iterator |
( |
| ) |
|
Initializes a flow iterator.
- Returns
- An optional unique pointer to the initialized flow iterator.
◆ init_monte_carlo()
Initializes a Monte Carlo unit.
- Returns
- An optional unique pointer to the initialized Monte Carlo unit.
◆ init_scalar() [1/2]
Initializes a scalar component of the simulation.
- Returns
- An optional scalar initializer.
◆ init_scalar() [2/2]
◆ init_simulation() [1/2]
Initializes a simulation unit.
- Returns
- An optional unique pointer to the initialized simulation unit.
◆ init_simulation() [2/2]
Initializes a simulation unit with specified parameters.
- 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. |
- Returns
- An optional unique pointer to the initialized simulation unit.
◆ init_state()
std::optional< bool > Core::GlobalInitialiser::init_state |
( |
std::unique_ptr< CmaRead::FlowIterator > & | flow_handle | ) |
|
Initializes the simulation state.
- Parameters
-
flow_handle | A unique pointer to the flow iterator used for state initialization. |
- Returns
- An optional boolean indicating success or failure of the initialization.
◆ init_transitionner() [1/2]
Initializes a transitioner without parameters.
- Returns
- An optional unique pointer to the initialized flow map transitioner.
◆ init_transitionner() [2/2]
Initializes a transitioner with the provided flow iterator.
- Parameters
-
flow_handle | A unique pointer to the flow iterator. |
- Returns
- An optional unique pointer to the initialized flow map transitioner.
◆ mpi_broadcast()
void Core::GlobalInitialiser::mpi_broadcast |
( |
| ) |
|
|
private |
Performs MPI broadcast for synchronization.
- Note
- : this function compiles and doesn't throw error even if no_mpi is not defined Method for handling MPI broadcast communication.
◆ set_initial_number_particle()
void Core::GlobalInitialiser::set_initial_number_particle |
( |
uint64_t | np | ) |
|
|
noexcept |
◆ validate_step()
template<typename... Args>
void Core::GlobalInitialiser::validate_step |
( |
InitStep | step, |
|
|
Args... | args ) |
|
inlineprivate |
Validates the specified initialization step and any additional steps.
- Parameters
-
step | The current initialization step to validate. |
args | Additional steps to validate. |
◆ f_init_gas_flow
bool Core::GlobalInitialiser::f_init_gas_flow |
|
private |
◆ feed
◆ gas_volume
std::vector<double> Core::GlobalInitialiser::gas_volume |
|
private |
◆ info
◆ is_host
bool Core::GlobalInitialiser::is_host |
|
private |
Flag indicating if this instance is the host.
◆ liquid_neighbors
CmaRead::Neighbors::Neighbors_const_view_t Core::GlobalInitialiser::liquid_neighbors |
|
private |
◆ liquid_volume
std::vector<double> Core::GlobalInitialiser::liquid_volume |
|
private |
◆ params
◆ particle_per_process
uint64_t Core::GlobalInitialiser::particle_per_process |
|
private |
◆ t_per_flowmap
double Core::GlobalInitialiser::t_per_flowmap {} |
|
private |
◆ user_params
◆ validated_steps
std::array<bool, static_cast<size_t>(InitStep::Count)> Core::GlobalInitialiser::validated_steps {} |
|
private |
Array to track validated initialization steps.
◆ worker_neighbor_data
std::vector<size_t> Core::GlobalInitialiser::worker_neighbor_data |
|
private |
The documentation for this class was generated from the following files: