22 std::vector<GlobalVector*>
const& global_solutions,
23 std::vector<std::vector<GlobalIndexType>>
const& indices)
25 if (global_solutions.empty())
30 std::size_t
const local_solutions_size =
31 std::accumulate(cbegin(indices),
35 std::vector<GlobalIndexType>
const& process_indices)
36 {
return size + process_indices.size(); });
37 std::vector<double> local_solutions;
38 local_solutions.reserve(local_solutions_size);
40 int number_of_processes =
static_cast<int>(global_solutions.size());
41 for (
int process_id = 0; process_id < number_of_processes; ++process_id)
43 auto values = global_solutions[process_id]->get(indices[process_id]);
44 local_solutions.insert(cend(local_solutions),
45 std::make_move_iterator(begin(values)),
46 std::make_move_iterator(end(values)));
48 return local_solutions;