25 std::unique_ptr<NumLib::TimeStepAlgorithm>&& timestepper,
27 std::string process_name,
Process& process,
28 std::unique_ptr<NumLib::TimeDiscretization>&& time_disc,
29 std::unique_ptr<NumLib::ConvergenceCriterion>&& conv_crit,
30 bool const compensate_non_equilibrium_initial_residuum)
34 if (
auto* nonlinear_solver_picard =
38 nonlinear_solver_picard->compensateNonEquilibriumInitialResiduum(
39 compensate_non_equilibrium_initial_residuum);
40 return std::make_unique<ProcessData>(
41 std::move(timestepper), Tag::Picard, *nonlinear_solver_picard,
42 std::move(conv_crit), std::move(time_disc), process_id,
43 std::move(process_name), process);
45 if (
auto* nonlinear_solver_newton =
49 nonlinear_solver_newton->compensateNonEquilibriumInitialResiduum(
50 compensate_non_equilibrium_initial_residuum);
51 return std::make_unique<ProcessData>(
52 std::move(timestepper), Tag::Newton, *nonlinear_solver_newton,
53 std::move(conv_crit), std::move(time_disc), process_id,
54 std::move(process_name), process);
57 if (
auto* nonlinear_solver_petsc =
60 return std::make_unique<ProcessData>(
61 std::move(timestepper), Tag::Newton, *nonlinear_solver_petsc,
62 std::move(conv_crit), std::move(time_disc), process_id,
63 std::move(process_name), process);
67 OGS_FATAL(
"Encountered unknown nonlinear solver type. Aborting");
72 std::vector<std::unique_ptr<Process>>
const& processes,
73 std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase>>
const&
75 bool const compensate_non_equilibrium_initial_residuum,
76 std::vector<double>
const& fixed_times_for_output)
78 std::vector<std::unique_ptr<ProcessData>> per_process_data;
79 std::vector<std::string> process_names;
86 auto const pcs_name = pcs_config.getConfigAttribute<std::string>(
"ref");
89 [&pcs_name](std::unique_ptr<Process>
const& p)
90 {
return p->name == pcs_name; },
91 "A process with the given name has not been defined.");
93 auto const process_name =
95 pcs_config.getConfigParameter<std::string>(
"process_name",
"");
96 if (process_name !=
"")
98 if (ranges::contains(process_names, process_name))
101 "The given process name is not unique! Please check the "
103 "'time_loop/process/name' in the project file. Found "
105 "process name '{:s}'.",
108 process_names.emplace_back(process_name);
111 auto const nl_slv_name =
113 pcs_config.getConfigParameter<std::string>(
"nonlinear_solver");
115 nonlinear_solvers, nl_slv_name,
116 "A nonlinear solver with the given name has not been defined.");
120 pcs_config.getConfigSubtree(
"time_discretization"));
124 pcs_config.getConfigSubtree(
"time_stepping"),
125 fixed_times_for_output);
129 pcs_config.getConfigSubtree(
"convergence_criterion"));
132 auto output = pcs_config.getConfigSubtreeOptional(
"output");
136 "In order to make the specification of output in the project "
137 "file consistent, the variables output tags were moved from "
139 "'//OpenGeoSysProject/time_loop/processes/process/output' to "
140 "the global output section, i.e., to the xpath "
141 "'//OpenGeoSysProject/time_loop/output'. This has to be done "
142 "in the current project file!");
146 std::move(timestepper), nl_slv, process_id, std::move(process_name),
147 pcs, std::move(time_disc), std::move(conv_crit),
148 compensate_non_equilibrium_initial_residuum));
152 if (per_process_data.size() != processes.size())
154 if (processes.size() > 1)
157 "Some processes have not been configured to be solved by this "
163 "The equations of the coupled processes will be solved by the "
164 "staggered scheme.");
168 return per_process_data;
std::vector< std::unique_ptr< ProcessData > > createPerProcessData(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< Process > > const &processes, std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > const &nonlinear_solvers, bool const compensate_non_equilibrium_initial_residuum, std::vector< double > const &fixed_times_for_output)
static std::unique_ptr< ProcessData > makeProcessData(std::unique_ptr< NumLib::TimeStepAlgorithm > &×tepper, NumLib::NonlinearSolverBase &nonlinear_solver, int const process_id, std::string process_name, Process &process, std::unique_ptr< NumLib::TimeDiscretization > &&time_disc, std::unique_ptr< NumLib::ConvergenceCriterion > &&conv_crit, bool const compensate_non_equilibrium_initial_residuum)