19 auto const local_coupling_configs =
23 if (local_coupling_configs.empty())
28 std::vector<LocalCouplingParameters> all_local_coupling_parameters;
29 std::vector<std::string> all_local_process_names;
30 for (
auto const& local_coupling_config : local_coupling_configs)
32 std::vector<std::string> process_names;
38 .getConfigParameterList<std::string>(
"process_name"))
40 if (std::find(process_names.begin(), process_names.end(), name) !=
44 "The name of locally coupled process, {}, is not unique.",
47 process_names.push_back(name);
49 all_local_process_names.push_back(name);
52 if (process_names.size() > max_process_number)
55 "The number of the locally coupled processes is greater "
56 "than the number of total coupled processes. "
57 "Please check the number of elements in the tag "
58 "'time_loop/global_process_coupling/"
59 "local_coupling_processes' in the project file.");
62 INFO(
"There are {:d} locally coupled processes.", process_names.size());
67 .getConfigParameter<
int>(
"max_iter");
69 all_local_coupling_parameters.push_back(
70 {process_names, max_iterations});
76 std::vector<std::string> copy_all_local_process_names =
77 all_local_process_names;
78 std::sort(copy_all_local_process_names.begin(),
79 copy_all_local_process_names.end());
80 if (
auto it = std::adjacent_find(copy_all_local_process_names.begin(),
81 copy_all_local_process_names.end());
82 it != copy_all_local_process_names.end())
85 "There are process names appearing in multiple tags of "
86 "'time_loop/global_process_coupling/local_coupling_processes'. For "
91 return all_local_coupling_parameters;
99 auto const& coupling_config
103 std::vector<std::unique_ptr<NumLib::ConvergenceCriterion>>
104 global_coupling_conv_criteria;
106 std::vector<LocalCouplingParameters> all_local_coupling_parameters;
108 int max_coupling_iterations = 1;
111 max_coupling_iterations
113 = coupling_config->getConfigParameter<
int>(
"max_iter");
115 auto const& coupling_convergence_criteria_config =
117 coupling_config->getConfigSubtree(
"convergence_criteria");
119 auto coupling_convergence_criterion_config =
121 coupling_convergence_criteria_config.getConfigSubtreeList(
122 "convergence_criterion");
123 std::transform(coupling_convergence_criterion_config.begin(),
124 coupling_convergence_criterion_config.end(),
125 std::back_inserter(global_coupling_conv_criteria),
127 { return NumLib::createConvergenceCriterion(c); });
130 *coupling_config, global_coupling_conv_criteria.size());
133 return {std::move(global_coupling_conv_criteria),
134 std::move(all_local_coupling_parameters), max_coupling_iterations};