27 auto const local_coupling_configs =
31 if (local_coupling_configs.empty())
36 std::vector<LocalCouplingParameters> all_local_coupling_parameters;
37 std::vector<std::string> all_local_process_names;
38 for (
auto const& local_coupling_config : local_coupling_configs)
40 std::vector<std::string> process_names;
46 .getConfigParameterList<std::string>(
"process_name"))
48 if (std::find(process_names.begin(), process_names.end(), name) !=
52 "The name of locally coupled process, {}, is not unique.",
55 process_names.push_back(name);
57 all_local_process_names.push_back(name);
60 if (process_names.size() > max_process_number)
63 "The number of the locally coupled processes is greater "
64 "than the number of total coupled processes. "
65 "Please check the number of elements in the tag "
66 "'time_loop/global_process_coupling/"
67 "local_coupling_processes' in the project file.");
70 INFO(
"There are {:d} locally coupled processes.", process_names.size());
75 .getConfigParameter<
int>(
"max_iter");
77 all_local_coupling_parameters.push_back(
78 {process_names, max_iterations});
84 std::vector<std::string> copy_all_local_process_names =
85 all_local_process_names;
86 std::sort(copy_all_local_process_names.begin(),
87 copy_all_local_process_names.end());
88 if (
auto it = std::adjacent_find(copy_all_local_process_names.begin(),
89 copy_all_local_process_names.end());
90 it != copy_all_local_process_names.end())
93 "There are process names appearing in multiple tags of "
94 "'time_loop/global_process_coupling/local_coupling_processes'. For "
99 return all_local_coupling_parameters;
107 auto const& coupling_config
111 std::vector<std::unique_ptr<NumLib::ConvergenceCriterion>>
112 global_coupling_conv_criteria;
114 std::vector<LocalCouplingParameters> all_local_coupling_parameters;
116 int max_coupling_iterations = 1;
119 max_coupling_iterations
121 = coupling_config->getConfigParameter<
int>(
"max_iter");
123 auto const& coupling_convergence_criteria_config =
125 coupling_config->getConfigSubtree(
"convergence_criteria");
127 auto coupling_convergence_criterion_config =
129 coupling_convergence_criteria_config.getConfigSubtreeList(
130 "convergence_criterion");
131 std::transform(coupling_convergence_criterion_config.begin(),
132 coupling_convergence_criterion_config.end(),
133 std::back_inserter(global_coupling_conv_criteria),
135 { return NumLib::createConvergenceCriterion(c); });
138 *coupling_config, global_coupling_conv_criteria.size());
141 return {std::move(global_coupling_conv_criteria),
142 std::move(all_local_coupling_parameters), max_coupling_iterations};