From: young Date: Sat, 9 Nov 2013 15:38:36 +0000 (+0000) Subject: Explicitly compress petsc objects with a VectorOperation. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4578d0884d675a594dee5120fa676eb4c503899;p=dealii-svn.git Explicitly compress petsc objects with a VectorOperation. git-svn-id: https://svn.dealii.org/trunk@31602 0785d39b-7218-0410-832d-ea1e28bc413d --- 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);