18 std::unique_ptr<NumLib::TimeStepAlgorithm>&& timestepper,
20 std::string process_name,
Process& process,
21 std::unique_ptr<NumLib::TimeDiscretization>&& time_disc,
22 std::unique_ptr<NumLib::ConvergenceCriterion>&& conv_crit,
23 bool const compensate_non_equilibrium_initial_residuum)
27 if (
auto* nonlinear_solver_picard =
31 nonlinear_solver_picard->compensateNonEquilibriumInitialResiduum(
32 compensate_non_equilibrium_initial_residuum);
33 return std::make_unique<ProcessData>(
34 std::move(timestepper), Tag::Picard, *nonlinear_solver_picard,
35 std::move(conv_crit), std::move(time_disc), process_id,
36 std::move(process_name), process);
38 if (
auto* nonlinear_solver_newton =
42 nonlinear_solver_newton->compensateNonEquilibriumInitialResiduum(
43 compensate_non_equilibrium_initial_residuum);
44 return std::make_unique<ProcessData>(
45 std::move(timestepper), Tag::Newton, *nonlinear_solver_newton,
46 std::move(conv_crit), std::move(time_disc), process_id,
47 std::move(process_name), process);
50 if (
auto* nonlinear_solver_petsc =
53 return std::make_unique<ProcessData>(
54 std::move(timestepper), Tag::Newton, *nonlinear_solver_petsc,
55 std::move(conv_crit), std::move(time_disc), process_id,
56 std::move(process_name), process);
60 OGS_FATAL(
"Encountered unknown nonlinear solver type. Aborting");
65 std::vector<std::unique_ptr<Process>>
const& processes,
66 std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase>>
const&
68 bool const compensate_non_equilibrium_initial_residuum,
69 std::vector<double>
const& fixed_times_for_output)
71 std::vector<std::unique_ptr<ProcessData>> per_process_data;
72 std::vector<std::string> process_names;
79 auto const pcs_name = pcs_config.getConfigAttribute<std::string>(
"ref");
82 [&pcs_name](std::unique_ptr<Process>
const& p)
83 {
return p->name == pcs_name; },
84 "A process with the given name has not been defined.");
86 auto const process_name =
88 pcs_config.getConfigParameter<std::string>(
"process_name",
"");
89 if (process_name !=
"")
91 if (ranges::contains(process_names, process_name))
94 "The given process name is not unique! Please check the "
96 "'time_loop/process/name' in the project file. Found "
98 "process name '{:s}'.",
101 process_names.emplace_back(process_name);
104 auto const nl_slv_name =
106 pcs_config.getConfigParameter<std::string>(
"nonlinear_solver");
108 nonlinear_solvers, nl_slv_name,
109 "A nonlinear solver with the given name has not been defined.");
113 pcs_config.getConfigSubtree(
"time_discretization"));
117 pcs_config.getConfigSubtree(
"time_stepping"),
118 fixed_times_for_output);
122 pcs_config.getConfigSubtree(
"convergence_criterion"));
125 auto output = pcs_config.getConfigSubtreeOptional(
"output");
129 "In order to make the specification of output in the project "
130 "file consistent, the variables output tags were moved from "
132 "'//OpenGeoSysProject/time_loop/processes/process/output' to "
133 "the global output section, i.e., to the xpath "
134 "'//OpenGeoSysProject/time_loop/output'. This has to be done "
135 "in the current project file!");
139 std::move(timestepper), nl_slv, process_id, std::move(process_name),
140 pcs, std::move(time_disc), std::move(conv_crit),
141 compensate_non_equilibrium_initial_residuum));
145 if (per_process_data.size() != processes.size())
147 if (processes.size() > 1)
150 "Some processes have not been configured to be solved by this "
156 "The equations of the coupled processes will be solved by the "
157 "staggered scheme.");
161 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)