From d8aa7a51cb8752a01e46883bcd58123a7211f3c6 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 9 May 2017 14:02:32 +0200 Subject: [PATCH] Fix failing tests after removal of deprecated TrilinosWrappers vector functions --- include/deal.II/lac/trilinos_parallel_block_vector.h | 6 ++++-- tests/gla/extract_subvector_to.cc | 6 ++++-- tests/lac/linear_operator_10.cc | 6 ++++-- tests/lac/linear_operator_10a.cc | 6 ++++-- tests/lac/linear_operator_15.cc | 6 ++++-- tests/lac/linear_operator_16.cc | 6 ++++-- tests/lac/schur_complement_04.cc | 6 ++++-- 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/include/deal.II/lac/trilinos_parallel_block_vector.h b/include/deal.II/lac/trilinos_parallel_block_vector.h index 81b22369a8..611442c6b7 100644 --- a/include/deal.II/lac/trilinos_parallel_block_vector.h +++ b/include/deal.II/lac/trilinos_parallel_block_vector.h @@ -456,7 +456,8 @@ namespace internal TrilinosWrappers::MPI::BlockVector &v, bool omit_zeroing_entries) { - v.reinit(matrix.range_partitioner(), omit_zeroing_entries); + v.reinit(matrix.locally_owned_range_indices(), + matrix.get_mpi_communicator(), omit_zeroing_entries); } template @@ -465,7 +466,8 @@ namespace internal TrilinosWrappers::MPI::BlockVector &v, bool omit_zeroing_entries) { - v.reinit(matrix.domain_partitioner(), omit_zeroing_entries); + v.reinit(matrix.locally_owned_domain_indices(), + matrix.get_mpi_communicator(), omit_zeroing_entries); } }; diff --git a/tests/gla/extract_subvector_to.cc b/tests/gla/extract_subvector_to.cc index 8a08c5d78c..6e00ea0569 100644 --- a/tests/gla/extract_subvector_to.cc +++ b/tests/gla/extract_subvector_to.cc @@ -85,7 +85,8 @@ int main (int argc, char **argv) { deallog.push("Trilinos"); - TrilinosWrappers::Vector v(17); + TrilinosWrappers::Vector v; + v.reinit(17); test (v); deallog.pop(); } @@ -115,7 +116,8 @@ int main (int argc, char **argv) { deallog.push("Trilinos"); - TrilinosWrappers::BlockVector v(3); + TrilinosWrappers::BlockVector v; + v.reinit(3); v.block(0).reinit(7); v.block(1).reinit(5); v.block(2).reinit(3); diff --git a/tests/lac/linear_operator_10.cc b/tests/lac/linear_operator_10.cc index 5526bc5ed6..0f2998be40 100644 --- a/tests/lac/linear_operator_10.cc +++ b/tests/lac/linear_operator_10.cc @@ -224,8 +224,10 @@ int main(int argc, char *argv[]) sparsity_pattern.compress(); TrilinosWrappers::SparseMatrix A (sparsity_pattern); - TrilinosWrappers::Vector b (A.domain_partitioner()); - TrilinosWrappers::MPI::Vector c (A.domain_partitioner()); + TrilinosWrappers::Vector b; + b.reinit(A.locally_owned_domain_indices()); + TrilinosWrappers::MPI::Vector c; + c.reinit(A.locally_owned_domain_indices()); for (unsigned int i=0; i < rc; ++i) { A.set(i,i,2.0); diff --git a/tests/lac/linear_operator_10a.cc b/tests/lac/linear_operator_10a.cc index ddb3060ce5..1325502379 100644 --- a/tests/lac/linear_operator_10a.cc +++ b/tests/lac/linear_operator_10a.cc @@ -230,8 +230,10 @@ int main(int argc, char *argv[]) sparsity_pattern.compress(); TrilinosWrappers::SparseMatrix A (sparsity_pattern); - TrilinosWrappers::Vector b (A.domain_partitioner()); - TrilinosWrappers::MPI::Vector c (A.domain_partitioner()); + TrilinosWrappers::Vector b; + b.reinit(A.domain_partitioner()); + TrilinosWrappers::MPI::Vector c; + c.reinit(A.locally_owned_domain_indices()); for (unsigned int i=0; i < rc; ++i) { A.set(i,i,2.0); diff --git a/tests/lac/linear_operator_15.cc b/tests/lac/linear_operator_15.cc index 34a90a2916..3ce60dcfda 100644 --- a/tests/lac/linear_operator_15.cc +++ b/tests/lac/linear_operator_15.cc @@ -69,8 +69,10 @@ int main (int argc, char *argv[]) A.reinit(csp); testproblem.five_point(A); - TrilinosWrappers::Vector f(dim); - TrilinosWrappers::Vector u(dim); + TrilinosWrappers::Vector f; + f.reinit(dim); + TrilinosWrappers::Vector u; + u.reinit(dim); A.compress (VectorOperation::insert); f.compress (VectorOperation::insert); diff --git a/tests/lac/linear_operator_16.cc b/tests/lac/linear_operator_16.cc index b7ac9c2d11..ad39b238b8 100644 --- a/tests/lac/linear_operator_16.cc +++ b/tests/lac/linear_operator_16.cc @@ -69,8 +69,10 @@ int main (int argc, char *argv[]) A.reinit(csp); testproblem.five_point(A); - TrilinosWrappers::Vector f(dim); - TrilinosWrappers::Vector u(dim); + TrilinosWrappers::Vector f; + f.reinit(dim); + TrilinosWrappers::Vector u; + u.reinit(dim); A.compress (VectorOperation::insert); f.compress (VectorOperation::insert); diff --git a/tests/lac/schur_complement_04.cc b/tests/lac/schur_complement_04.cc index 08faef2b40..099c8729ec 100644 --- a/tests/lac/schur_complement_04.cc +++ b/tests/lac/schur_complement_04.cc @@ -102,8 +102,10 @@ int main(int argc,char **argv) TrilinosWrappers::SparseMatrix C (rc,rc,rc); TrilinosWrappers::SparseMatrix D (rc,rc,rc); - VectorType y (rc); - VectorType g (rc); + VectorType y; + y.reinit(rc); + VectorType g; + g.reinit(rc); for (unsigned int i=0; i < rc; ++i) { A.set(i,i, 1.0*(i+1)); -- 2.39.5