13 std::vector<GlobalVector*>
const& global_solutions,
14 std::vector<std::vector<GlobalIndexType>>
const& indices)
16 if (global_solutions.empty())
21 std::size_t
const local_solutions_size =
22 std::accumulate(cbegin(indices),
26 std::vector<GlobalIndexType>
const& process_indices)
27 {
return size + process_indices.size(); });
28 std::vector<double> local_solutions;
29 local_solutions.reserve(local_solutions_size);
31 int number_of_processes =
static_cast<int>(global_solutions.size());
32 for (
int process_id = 0; process_id < number_of_processes; ++process_id)
34 auto values = global_solutions[process_id]->get(indices[process_id]);
35 local_solutions.insert(cend(local_solutions),
36 std::make_move_iterator(begin(values)),
37 std::make_move_iterator(end(values)));
39 return local_solutions;