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>>(
112 std::vector<std::shared_ptr<GenericManagingModule<T>>>
all_modules;
116 this, this->m_simulation_config.getStringVectorParameters(
"managing_modules"));
131 all_modules, this->m_simulation_config.getStringVectorParameters(
"managing_modules"));
133 catch (
const std::exception&
e)
135 std::cerr <<
"[Warning] Failed to load managing modules from config: " <<
e.what() <<
"\n"
136 <<
"Falling back to loading all modules.\n";
144 this->setInitChainStr();
150 std::shared_ptr<SolverInterface<T>>
solver{
151 std::make_shared<TridiagonalMatrixSolver<T>>(
this,
matrix_manager)};
154 int timesteps{
static_cast<int>(this->m_simulation_config.getDoubleParameters(
"time_max")
155 / this->m_simulation_config.getDoubleParameters(
"time_delta"))};
156 int inner_iterations{this->m_simulation_config.getIntParameters(
"inner_iterations")};
157 T epsilon{this->m_simulation_config.getDoubleParameters(
"epsilon_inner_iterations")};
158 T delta_t{this->m_simulation_config.getDoubleParameters(
"time_delta")};
160 while (this->time_step *
delta_t < this->m_simulation_config.getDoubleParameters(
"time_max"))
163 this->m_field_map[m_dependent_variable_name]};
165 this->m_field_map[m_dependent_variable_name]};
175 this->setPreTimeStepChainStr();
190 solver->solveMatrixSystem(m_dependent_variable_name);
193 this->setPostNonLinIterChainStr();
198 - this->m_field_map[m_dependent_variable_name]))
208 - this->m_field_map[m_dependent_variable_name]))
219 this->m_field_map[m_dependent_variable_name];
223 std::cerr <<
"Reached specified inner iterations limit without fullfilling the "
224 "requested convergence criterion.\n";
229 this->setPostTimeStepChainStr();
232 delta_t = this->m_simulation_config.getDoubleParameters(
"time_delta");
238 this->setOutputChainStr();
242 if (this->world_size > 1)
245 this->m_simulation_config.getIntParameters(
"numerical_layers")
246 *
this->m_simulation_config.getIntParameters(
"global_number_of_facets"));
248 if (this->my_rank == 0)
250 std::cout <<
"Full temperature:\n";
253 std::cout <<
val <<
" ";
260 this->printField(m_dependent_variable_name);
263 this->printField(m_dependent_variable_name);
static std::vector< std::shared_ptr< GenericManagingModule< T > > > createAllSelectedManagingModules(SimulationClassBase< T > *sim_pointer, const std::vector< std::string > &list_of_mananging_modules_to_load)
Only creates instances of managing modules that have been specified by the user. (This allows only ha...
Definition ModuleFactory.h:195
static std::vector< std::shared_ptr< GenericSubmodule< T > > > createAllSelectedSubmodules(SimulationClassBase< T > *sim_pointer, const std::vector< std::shared_ptr< GenericManagingModule< T > > > &loaded_managing_modules)
Only creates submodules that are used within the simulation. Iteratively requests the submodule list ...
Definition ModuleFactory.h:225