23 std::vector<GlobalVector*>
const& coupled_xs_)
24 : coupled_xs(coupled_xs_)
33 std::vector<GlobalVector*>
const& global_solutions,
34 std::vector<std::vector<GlobalIndexType>>
const& indices)
36 if (global_solutions.empty())
41 std::size_t
const local_solutions_size =
42 std::accumulate(cbegin(indices),
46 std::vector<GlobalIndexType>
const& process_indices)
47 {
return size + process_indices.size(); });
48 std::vector<double> local_solutions;
49 local_solutions.reserve(local_solutions_size);
51 int number_of_processes =
static_cast<int>(global_solutions.size());
52 for (
int process_id = 0; process_id < number_of_processes; ++process_id)
54 auto values = global_solutions[process_id]->get(indices[process_id]);
55 local_solutions.insert(cend(local_solutions),
56 std::make_move_iterator(begin(values)),
57 std::make_move_iterator(end(values)));
59 return local_solutions;
GlobalMatrix::IndexType GlobalIndexType
void setLocalAccessibleVector(PETScVector const &x)
std::vector< double > getCoupledLocalSolutions(std::vector< GlobalVector * > const &global_solutions, std::vector< std::vector< GlobalIndexType >> const &indices)
std::vector< GlobalVector * > const & coupled_xs
References to the current solutions of the coupled processes.
CoupledSolutionsForStaggeredScheme(std::vector< GlobalVector * > const &coupled_xs_)