78 std::unique_ptr<ShapeFactory<T>>
shape_creator{std::make_unique<ShapeFactory<T>>(
79 this, this->m_simulation_config.getBoolParameters(
"use_shape_file"),
80 this->m_simulation_config.getStringParameters(
"spatial_dimension"))};
87 std::unique_ptr<GridFactory<T>>
grid_creator{std::make_unique<GridFactory<T>>(
89 this->m_simulation_config.getStringParameters(
"spatial_dimension"))};
96 * this->m_simulation_config.getIntParameters(
"numerical_layers");
99 this->m_field_map.insert(
100 {m_dependent_variable_name,
102 this->m_simulation_config.getDoubleParameters(m_dependent_variable_initial_state),
103 this->m_simulation_config.getIntParameters(
"numerical_layers")
104 *
this->m_simulation_config.getIntParameters(
"number_of_facets"))});
106 std::shared_ptr<MatrixFactory<T>>
matrix_factory{std::make_shared<MatrixFactory<T>>(
"Csr")};
108 std::shared_ptr<ElementManager<T>>
element_manager{std::make_shared<ElementManager<T>>(
121 snapshot_data.overwriteIniFiles(
this, m_all_modules, m_all_submodules);
127 m_all_modules, this->m_simulation_config.getStringVectorParameters(
"managing_modules"));
129 catch (
const std::exception&
e)
131 std::cerr <<
"[Warning] Failed to load managing modules from config: " <<
e.what() <<
"\n"
132 <<
"Falling back to loading all modules.\n";
140 this->setInitChainStr();
146 std::shared_ptr<SolverInterface<T>>
solver{
147 std::make_shared<TridiagonalMatrixSolver<T>>(
this,
matrix_manager)};
150 int timesteps{
static_cast<int>(this->m_simulation_config.getDoubleParameters(
"time_max")
151 / this->m_simulation_config.getDoubleParameters(
"time_delta"))};
152 int inner_iterations{this->m_simulation_config.getIntParameters(
"inner_iterations")};
153 T epsilon{this->m_simulation_config.getDoubleParameters(
"epsilon_inner_iterations")};
154 T delta_t{this->m_simulation_config.getDoubleParameters(
"time_delta")};
156 while (this->time_step *
delta_t < this->m_simulation_config.getDoubleParameters(
"time_max"))
159 this->m_field_map[m_dependent_variable_name]};
161 this->m_field_map[m_dependent_variable_name]};
171 this->setPreTimeStepChainStr();
186 solver->solveMatrixSystem(m_dependent_variable_name);
189 this->setPostNonLinIterChainStr();
194 - this->m_field_map[m_dependent_variable_name]))
204 - this->m_field_map[m_dependent_variable_name]))
215 this->m_field_map[m_dependent_variable_name];
219 std::cerr <<
"Reached specified inner iterations limit without fullfilling the "
220 "requested convergence criterion.\n";
225 this->setPostTimeStepChainStr();
228 delta_t = this->m_simulation_config.getDoubleParameters(
"time_delta");
234 this->setOutputChainStr();
238 if (this->world_size > 1)
241 this->m_simulation_config.getIntParameters(
"numerical_layers")
242 *
this->m_simulation_config.getIntParameters(
"global_number_of_facets"));
244 if (this->my_rank == 0)
246 std::cout <<
"Full temperature:\n";
249 std::cout <<
val <<
" ";
256 this->printField(m_dependent_variable_name);
259 this->printField(m_dependent_variable_name);