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"))};
83 std::unique_ptr<GridFactory<T>>
grid_creator{std::make_unique<GridFactory<T>>(
85 this->m_simulation_config.getStringParameters(
"spatial_dimension"))};
92 * this->m_simulation_config.getIntParameters(
"numerical_layers");
95 this->m_field_map.insert(
96 {m_dependent_variable_name,
98 this->m_simulation_config.getDoubleParameters(m_dependent_variable_initial_state),
99 this->m_simulation_config.getIntParameters(
"numerical_layers")
100 *
this->m_simulation_config.getIntParameters(
"number_of_facets"))});
102 std::shared_ptr<MatrixFactory<T>>
matrix_factory{std::make_shared<MatrixFactory<T>>(
"Csr")};
104 std::shared_ptr<ElementManager<T>>
element_manager{std::make_shared<ElementManager<T>>(
111 std::vector<std::shared_ptr<GenericManagingModule<T>>>
all_modules{
122 all_modules, this->m_simulation_config.getStringVectorParameters(
"managing_modules"));
124 catch (
const std::exception&
e)
126 std::cerr <<
"[Warning] Failed to load managing modules from config: " <<
e.what() <<
"\n"
127 <<
"Falling back to loading all modules.\n";
135 this->setInitChainStr();
141 std::shared_ptr<SolverInterface<T>>
solver{
142 std::make_shared<TridiagonalMatrixSolver<T>>(
this,
matrix_manager)};
145 int timesteps{
static_cast<int>(this->m_simulation_config.getDoubleParameters(
"time_max")
146 / this->m_simulation_config.getDoubleParameters(
"time_delta"))};
147 int inner_iterations{this->m_simulation_config.getIntParameters(
"inner_iterations")};
148 T epsilon{this->m_simulation_config.getDoubleParameters(
"epsilon_inner_iterations")};
149 T delta_t{this->m_simulation_config.getDoubleParameters(
"time_delta")};
151 while (this->time_step *
delta_t < this->m_simulation_config.getDoubleParameters(
"time_max"))
154 this->m_field_map[m_dependent_variable_name]};
156 this->m_field_map[m_dependent_variable_name]};
166 this->setPreTimeStepChainStr();
181 solver->solveMatrixSystem(m_dependent_variable_name);
184 this->setPostNonLinIterChainStr();
189 - this->m_field_map[m_dependent_variable_name]))
199 - this->m_field_map[m_dependent_variable_name]))
210 this->m_field_map[m_dependent_variable_name];
214 std::cerr <<
"Reached specified inner iterations limit without fullfilling the "
215 "requested convergence criterion.\n";
220 this->setPostTimeStepChainStr();
223 delta_t = this->m_simulation_config.getDoubleParameters(
"time_delta");
229 this->setOutputChainStr();
233 if (this->world_size > 1)
236 this->m_simulation_config.getIntParameters(
"numerical_layers")
237 *
this->m_simulation_config.getIntParameters(
"global_number_of_facets"));
239 if (this->my_rank == 0)
241 std::cout <<
"Full temperature:\n";
244 std::cout <<
val <<
" ";
251 this->printField(m_dependent_variable_name);
254 this->printField(m_dependent_variable_name);
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