74 std::unique_ptr<ShapeFactory<T>>
shape_creator{std::make_unique<ShapeFactory<T>>(
75 this, this->m_simulation_config.getBoolParameters(
"use_shape_file"),
76 this->m_simulation_config.getStringParameters(
"spatial_dimension"))};
78 std::unique_ptr<GridFactory<T>>
grid_creator{std::make_unique<GridFactory<T>>(
80 this->m_simulation_config.getStringParameters(
"spatial_dimension"))};
83 this->m_field_map.insert(
84 {m_dependent_variable_name,
85 std::valarray<double>(
86 this->m_simulation_config.getDoubleParameters(m_dependent_variable_initial_state),
87 this->m_simulation_config.getIntParameters(
"numerical_layers")
88 *
this->m_simulation_config.getIntParameters(
"number_of_facets"))});
90 std::shared_ptr<MatrixFactory<T>>
matrix_factory{std::make_shared<MatrixFactory<T>>(
"Csr")};
92 std::shared_ptr<ElementManager<T>>
element_manager{std::make_shared<ElementManager<T>>(
99 std::vector<std::shared_ptr<GenericManagingModule<T>>>
all_modules{
110 all_modules, this->m_simulation_config.getStringVectorParameters(
"managing_modules"));
112 catch (
const std::exception&
e)
114 std::cerr <<
"[Warning] Failed to load managing modules from config: " <<
e.
what() <<
"\n"
115 <<
"Falling back to loading all modules.\n";
123 this->setInitChainStr();
129 std::shared_ptr<SolverInterface<T>>
solver{
130 std::make_shared<TridiagonalMatrixSolver<T>>(
this,
matrix_manager)};
133 int timesteps{
static_cast<int>(this->m_simulation_config.getDoubleParameters(
"time_max")
134 / this->m_simulation_config.getDoubleParameters(
"time_delta"))};
135 int inner_iterations{this->m_simulation_config.getIntParameters(
"inner_iterations")};
136 T epsilon{this->m_simulation_config.getDoubleParameters(
"epsilon_inner_iterations")};
137 T delta_t{this->m_simulation_config.getDoubleParameters(
"time_delta")};
139 while (this->time_step *
delta_t < this->m_simulation_config.getDoubleParameters(
"time_max"))
142 this->m_field_map[m_dependent_variable_name]};
144 this->m_field_map[m_dependent_variable_name]};
154 this->setPreTimeStepChainStr();
175 solver->solveMatrixSystem(m_dependent_variable_name);
178 this->setPostNonLinIterChainStr();
182 - this->m_field_map[m_dependent_variable_name]))
192 this->m_field_map[m_dependent_variable_name];
196 std::cerr <<
"Reached specified inner iterations limit without fullfilling the "
197 "requested convergence criterion.\n";
202 this->setPostTimeStepChainStr();
205 delta_t = this->m_simulation_config.getDoubleParameters(
"time_delta");
211 this->setOutputChainStr();
214 this->printField(m_dependent_variable_name);
const char * what() const noexcept override
Supplies the error message as a c-style string/char array.
Definition ChainManager.h:57
static std::vector< std::shared_ptr< GenericSubmodule< T > > > createAllSubmodules(SimulationClassBase< T > *sim_pointer)
Creates every submodule in the submodule registry.
Definition ModuleFactory.h:165
static std::vector< std::shared_ptr< GenericManagingModule< T > > > createAllManagingModules(SimulationClassBase< T > *sim_pointer)
Creates every module in the module registry.
Definition ModuleFactory.h:146