From bf2ed016a66d6daa7c70e5ade8deedd638ca84c7 Mon Sep 17 00:00:00 2001 From: "Toby D. Young" Date: Sat, 9 Nov 2013 15:38:36 +0000 Subject: [PATCH] Explicitly compress petsc objects with a VectorOperation. git-svn-id: https://svn.dealii.org/trunk@31602 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/petsc/01.cc | 2 +- tests/petsc/02.cc | 2 +- tests/petsc/05.cc | 2 +- tests/petsc/06.cc | 2 +- tests/petsc/07.cc | 2 +- tests/petsc/08.cc | 2 +- tests/petsc/09.cc | 2 +- tests/petsc/10.cc | 2 +- tests/petsc/11.cc | 2 +- tests/petsc/12.cc | 2 +- tests/petsc/13.cc | 2 +- tests/petsc/17.cc | 2 +- tests/petsc/18.cc | 2 +- tests/petsc/19.cc | 2 +- tests/petsc/20.cc | 2 +- tests/petsc/21.cc | 2 +- tests/petsc/22.cc | 4 ++-- tests/petsc/23.cc | 4 ++-- tests/petsc/24.cc | 2 +- tests/petsc/25.cc | 2 +- tests/petsc/26.cc | 2 +- tests/petsc/27.cc | 2 +- tests/petsc/28.cc | 2 +- tests/petsc/30.cc | 2 +- tests/petsc/31.cc | 2 +- tests/petsc/32.cc | 2 +- tests/petsc/33.cc | 2 +- tests/petsc/34.cc | 2 +- tests/petsc/35.cc | 4 ++-- tests/petsc/36.cc | 4 ++-- tests/petsc/37.cc | 2 +- tests/petsc/38.cc | 4 ++-- tests/petsc/39.cc | 4 ++-- tests/petsc/40.cc | 6 +++--- tests/petsc/41.cc | 4 ++-- tests/petsc/42.cc | 4 ++-- tests/petsc/43.cc | 6 +++--- tests/petsc/44.cc | 8 ++++---- tests/petsc/45.cc | 4 ++-- tests/petsc/46.cc | 4 ++-- tests/petsc/47.cc | 6 +++--- tests/petsc/48.cc | 6 +++--- tests/petsc/51.cc | 4 ++-- tests/petsc/52.cc | 2 +- tests/petsc/55.cc | 2 +- tests/petsc/56.cc | 2 +- tests/petsc/57.cc | 2 +- tests/petsc/58.cc | 2 +- tests/petsc/59.cc | 2 +- tests/petsc/60.cc | 2 +- tests/petsc/61.cc | 2 +- tests/petsc/66.cc | 2 +- tests/petsc/67.cc | 2 +- tests/petsc/68.cc | 2 +- tests/petsc/69.cc | 2 +- tests/petsc/deal_solver_01.cc | 6 +++--- tests/petsc/deal_solver_02.cc | 6 +++--- tests/petsc/deal_solver_03.cc | 6 +++--- tests/petsc/deal_solver_04.cc | 6 +++--- tests/petsc/deal_solver_05.cc | 6 +++--- tests/petsc/full_matrix_01.cc | 2 +- tests/petsc/full_matrix_02.cc | 2 +- tests/petsc/full_matrix_05.cc | 2 +- tests/petsc/full_matrix_06.cc | 2 +- tests/petsc/full_matrix_07.cc | 2 +- tests/petsc/full_matrix_08.cc | 2 +- tests/petsc/full_matrix_09.cc | 2 +- tests/petsc/full_matrix_10.cc | 2 +- tests/petsc/full_matrix_iterator_01.cc | 2 +- tests/petsc/full_matrix_vector_01.cc | 6 +++--- tests/petsc/full_matrix_vector_02.cc | 6 +++--- tests/petsc/full_matrix_vector_03.cc | 6 +++--- tests/petsc/full_matrix_vector_04.cc | 6 +++--- tests/petsc/full_matrix_vector_05.cc | 6 +++--- tests/petsc/full_matrix_vector_06.cc | 4 ++-- tests/petsc/full_matrix_vector_07.cc | 6 +++--- tests/petsc/parallel_sparse_matrix_01.cc | 2 +- tests/petsc/slowness_01.cc | 2 +- tests/petsc/slowness_02.cc | 2 +- tests/petsc/slowness_03.cc | 2 +- tests/petsc/slowness_04.cc | 2 +- tests/petsc/solver_01.cc | 6 +++--- tests/petsc/solver_02.cc | 6 +++--- tests/petsc/solver_03.cc | 6 +++--- tests/petsc/solver_03_mf.cc | 6 +++--- tests/petsc/solver_03_precondition_boomeramg.cc | 6 +++--- tests/petsc/solver_03_precondition_boomeramg_symmetric.cc | 6 +++--- tests/petsc/solver_03_precondition_eisenstat.cc | 6 +++--- tests/petsc/solver_03_precondition_icc.cc | 6 +++--- tests/petsc/solver_03_precondition_ilu.cc | 6 +++--- tests/petsc/solver_03_precondition_lu.cc | 6 +++--- tests/petsc/solver_03_precondition_parasails.cc | 6 +++--- tests/petsc/solver_03_precondition_sor.cc | 6 +++--- tests/petsc/solver_03_precondition_ssor.cc | 6 +++--- tests/petsc/solver_04.cc | 6 +++--- tests/petsc/solver_05.cc | 6 +++--- tests/petsc/solver_06.cc | 6 +++--- tests/petsc/solver_07.cc | 6 +++--- tests/petsc/solver_08.cc | 6 +++--- tests/petsc/solver_09.cc | 6 +++--- tests/petsc/solver_10.cc | 6 +++--- tests/petsc/solver_11.cc | 6 +++--- tests/petsc/solver_12.cc | 6 +++--- tests/petsc/solver_13.cc | 6 +++--- tests/petsc/sparse_direct_mumps.cc | 6 +++--- tests/petsc/sparse_matrix_01.cc | 4 ++-- tests/petsc/sparse_matrix_02.cc | 2 +- tests/petsc/sparse_matrix_iterator_01.cc | 2 +- tests/petsc/sparse_matrix_vector_01.cc | 6 +++--- tests/petsc/sparse_matrix_vector_02.cc | 6 +++--- tests/petsc/sparse_matrix_vector_03.cc | 6 +++--- tests/petsc/sparse_matrix_vector_04.cc | 6 +++--- tests/petsc/sparse_matrix_vector_05.cc | 6 +++--- tests/petsc/sparse_matrix_vector_06.cc | 4 ++-- tests/petsc/sparse_matrix_vector_07.cc | 6 +++--- 115 files changed, 222 insertions(+), 222 deletions(-) diff --git a/tests/petsc/01.cc b/tests/petsc/01.cc index 5f3cc2ad78..bd4a692462 100644 --- a/tests/petsc/01.cc +++ b/tests/petsc/01.cc @@ -33,7 +33,7 @@ void test (PETScWrappers::SparseMatrix &m) if ((i+2*j+1) % 3 == 0) m.set (i,j, i*j*.5+.5); - m.compress (); + m.compress (VectorOperation::add); // then make sure we retrieve the same ones for (unsigned int i=0; i w (v); Vector x (v); diff --git a/tests/petsc/59.cc b/tests/petsc/59.cc index 3bb270d0fc..6e2b45c94a 100644 --- a/tests/petsc/59.cc +++ b/tests/petsc/59.cc @@ -38,7 +38,7 @@ void test (PETScWrappers::Vector &v) pattern[i] = true; } - v.compress (); + v.compress (VectorOperation::add); Vector w (v); Vector x (v); diff --git a/tests/petsc/60.cc b/tests/petsc/60.cc index 77cba83030..2c532bc0a3 100644 --- a/tests/petsc/60.cc +++ b/tests/petsc/60.cc @@ -38,7 +38,7 @@ void test (PETScWrappers::Vector &v) pattern[i] = true; } - v.compress (); + v.compress (VectorOperation::add); Vector w; w=v; diff --git a/tests/petsc/61.cc b/tests/petsc/61.cc index 75547b0ebd..d883b98132 100644 --- a/tests/petsc/61.cc +++ b/tests/petsc/61.cc @@ -38,7 +38,7 @@ void test (PETScWrappers::Vector &v) pattern[i] = true; } - v.compress (); + v.compress (VectorOperation::add); Vector w; w=v; diff --git a/tests/petsc/66.cc b/tests/petsc/66.cc index a921906e92..16427b58b1 100644 --- a/tests/petsc/66.cc +++ b/tests/petsc/66.cc @@ -59,7 +59,7 @@ void test (PETScWrappers::MatrixBase &m) norm_sqr += s*s; ++nnz; } - m.compress (); + m.compress (VectorOperation::add); deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr) << std::endl; diff --git a/tests/petsc/67.cc b/tests/petsc/67.cc index 5653714578..6c18362cd9 100644 --- a/tests/petsc/67.cc +++ b/tests/petsc/67.cc @@ -61,7 +61,7 @@ void test (PETScWrappers::MatrixBase &m) norm_sqr += s*s; ++nnz; } - m.compress (); + m.compress (VectorOperation::add); deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr) << std::endl; diff --git a/tests/petsc/68.cc b/tests/petsc/68.cc index 676a852245..2719ce002a 100644 --- a/tests/petsc/68.cc +++ b/tests/petsc/68.cc @@ -59,7 +59,7 @@ void test (PETScWrappers::MatrixBase &m) norm_sqr += s*s; ++nnz; } - m.compress (); + m.compress (VectorOperation::add); deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr) << std::endl; diff --git a/tests/petsc/69.cc b/tests/petsc/69.cc index 55e76a9394..c01c3f0839 100644 --- a/tests/petsc/69.cc +++ b/tests/petsc/69.cc @@ -61,7 +61,7 @@ void test (PETScWrappers::MatrixBase &m) norm_sqr += s*s; ++nnz; } - m.compress (); + m.compress (VectorOperation::add); deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr) << std::endl; diff --git a/tests/petsc/deal_solver_01.cc b/tests/petsc/deal_solver_01.cc index 1e73402ba0..88df05b761 100644 --- a/tests/petsc/deal_solver_01.cc +++ b/tests/petsc/deal_solver_01.cc @@ -86,9 +86,9 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (); - f.compress (); - u.compress (); + A.compress (VectorOperation::add); + f.compress (VectorOperation::add); + u.compress (VectorOperation::add); GrowingVectorMemory mem; SolverCG solver(control,mem); diff --git a/tests/petsc/deal_solver_02.cc b/tests/petsc/deal_solver_02.cc index 46f04c6fa5..1a96781ed8 100644 --- a/tests/petsc/deal_solver_02.cc +++ b/tests/petsc/deal_solver_02.cc @@ -88,9 +88,9 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (); - f.compress (); - u.compress (); + A.compress (VectorOperation::add); + f.compress (VectorOperation::add); + u.compress (VectorOperation::add); GrowingVectorMemory mem; SolverBicgstab solver(control,mem); diff --git a/tests/petsc/deal_solver_03.cc b/tests/petsc/deal_solver_03.cc index 831ebb38ec..795c13704a 100644 --- a/tests/petsc/deal_solver_03.cc +++ b/tests/petsc/deal_solver_03.cc @@ -88,9 +88,9 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (); - f.compress (); - u.compress (); + A.compress (VectorOperation::add); + f.compress (VectorOperation::add); + u.compress (VectorOperation::add); GrowingVectorMemory mem; SolverGMRES solver(control,mem); diff --git a/tests/petsc/deal_solver_04.cc b/tests/petsc/deal_solver_04.cc index f4a88b8bc4..378775dd98 100644 --- a/tests/petsc/deal_solver_04.cc +++ b/tests/petsc/deal_solver_04.cc @@ -87,9 +87,9 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (); - f.compress (); - u.compress (); + A.compress (VectorOperation::add); + f.compress (VectorOperation::add); + u.compress (VectorOperation::add); GrowingVectorMemory mem; SolverMinRes solver(control,mem); diff --git a/tests/petsc/deal_solver_05.cc b/tests/petsc/deal_solver_05.cc index 033b498db6..f6bf2ebd84 100644 --- a/tests/petsc/deal_solver_05.cc +++ b/tests/petsc/deal_solver_05.cc @@ -86,9 +86,9 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (); - f.compress (); - u.compress (); + A.compress (VectorOperation::add); + f.compress (VectorOperation::add); + u.compress (VectorOperation::add); GrowingVectorMemory mem; SolverQMRS solver(control,mem); diff --git a/tests/petsc/full_matrix_01.cc b/tests/petsc/full_matrix_01.cc index 6125db2d92..697edcecab 100644 --- a/tests/petsc/full_matrix_01.cc +++ b/tests/petsc/full_matrix_01.cc @@ -33,7 +33,7 @@ void test (PETScWrappers::FullMatrix &m) if ((i+2*j+1) % 3 == 0) m.set (i,j, i*j*.5+.5); - m.compress (); + m.compress (VectorOperation::add); // then make sure we retrieve the same ones for (unsigned int i=0; irow() << ' ' << i->column() << ' ' << i->value() << std::endl; ++i; diff --git a/tests/petsc/full_matrix_vector_01.cc b/tests/petsc/full_matrix_vector_01.cc index daabd47328..392252810e 100644 --- a/tests/petsc/full_matrix_vector_01.cc +++ b/tests/petsc/full_matrix_vector_01.cc @@ -37,9 +37,9 @@ void test (PETScWrappers::Vector &v, for (unsigned int i=0; i const PetscScalar s = m.matrix_scalar_product (w,v); diff --git a/tests/petsc/full_matrix_vector_06.cc b/tests/petsc/full_matrix_vector_06.cc index 5514768e60..07b61100e7 100644 --- a/tests/petsc/full_matrix_vector_06.cc +++ b/tests/petsc/full_matrix_vector_06.cc @@ -36,8 +36,8 @@ void test (PETScWrappers::Vector &v) for (unsigned int i=0; i const PetscScalar s = m.matrix_norm_square (v); diff --git a/tests/petsc/full_matrix_vector_07.cc b/tests/petsc/full_matrix_vector_07.cc index 4eead31ae6..93f4876507 100644 --- a/tests/petsc/full_matrix_vector_07.cc +++ b/tests/petsc/full_matrix_vector_07.cc @@ -41,9 +41,9 @@ void test (PETScWrappers::Vector &v, w(i) = i+1; } - m.compress (); - v.compress (); - w.compress (); + m.compress (VectorOperation::add); + v.compress (VectorOperation::add); + w.compress (VectorOperation::add); // x=w-Mv const double s = m.residual (x, v, w); diff --git a/tests/petsc/parallel_sparse_matrix_01.cc b/tests/petsc/parallel_sparse_matrix_01.cc index fc1cfb4e94..24f5ba8316 100644 --- a/tests/petsc/parallel_sparse_matrix_01.cc +++ b/tests/petsc/parallel_sparse_matrix_01.cc @@ -112,7 +112,7 @@ void test () for (unsigned int j=0; jrow() << ' ' << i->column() << ' ' << i->value() << std::endl; ++i; diff --git a/tests/petsc/sparse_matrix_vector_01.cc b/tests/petsc/sparse_matrix_vector_01.cc index 6562499418..96094736a0 100644 --- a/tests/petsc/sparse_matrix_vector_01.cc +++ b/tests/petsc/sparse_matrix_vector_01.cc @@ -37,9 +37,9 @@ void test (PETScWrappers::Vector &v, for (unsigned int i=0; i const PetscScalar s = m.matrix_scalar_product (w,v); diff --git a/tests/petsc/sparse_matrix_vector_06.cc b/tests/petsc/sparse_matrix_vector_06.cc index 5901150030..144d246bf8 100644 --- a/tests/petsc/sparse_matrix_vector_06.cc +++ b/tests/petsc/sparse_matrix_vector_06.cc @@ -36,8 +36,8 @@ void test (PETScWrappers::Vector &v) for (unsigned int i=0; i const PetscScalar s = m.matrix_norm_square (v); diff --git a/tests/petsc/sparse_matrix_vector_07.cc b/tests/petsc/sparse_matrix_vector_07.cc index 45bd1b80c8..b4bfef4701 100644 --- a/tests/petsc/sparse_matrix_vector_07.cc +++ b/tests/petsc/sparse_matrix_vector_07.cc @@ -41,9 +41,9 @@ void test (PETScWrappers::Vector &v, w(i) = i+1; } - m.compress (); - v.compress (); - w.compress (); + m.compress (VectorOperation::add); + v.compress (VectorOperation::add); + w.compress (VectorOperation::add); // x=w-Mv const double s = m.residual (x, v, w); -- 2.39.5