From: Timo Heister Date: Tue, 24 Feb 2015 17:51:50 +0000 (-0500) Subject: fix a few broken tests X-Git-Tag: v8.3.0-rc1~423^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c42823fc4b8d19933b0c684ae055dbe106e634e;p=dealii.git fix a few broken tests Looks like somebody messed up the VectorOperation in compress() in many places. --- diff --git a/tests/mpi/petsc_distribute_01_block.cc b/tests/mpi/petsc_distribute_01_block.cc index 631a1d9dab..43fafab6b5 100644 --- a/tests/mpi/petsc_distribute_01_block.cc +++ b/tests/mpi/petsc_distribute_01_block.cc @@ -52,7 +52,7 @@ void test() vec.block(0)(i) = i; for (unsigned int i=vec.block(1).local_range().first; i void test (MatrixType &m) { m.add(0,0,1); + m.compress(VectorOperation::add); m = 0; - m.compress(); Assert(fabs(m.frobenius_norm())<1e-15, ExcInternalError()); diff --git a/tests/petsc/deal_solver_01.cc b/tests/petsc/deal_solver_01.cc index 51fe084280..c9ad7e4c87 100644 --- a/tests/petsc/deal_solver_01.cc +++ b/tests/petsc/deal_solver_01.cc @@ -83,13 +83,11 @@ int main(int argc, char **argv) FDMatrix testproblem(size, size); PETScWrappers::SparseMatrix A(dim, dim, 5); testproblem.five_point(A); + A.compress (VectorOperation::insert); PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - 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 0ef008f3e7..07ca880f34 100644 --- a/tests/petsc/deal_solver_02.cc +++ b/tests/petsc/deal_solver_02.cc @@ -84,13 +84,11 @@ int main(int argc, char **argv) FDMatrix testproblem(size, size); PETScWrappers::SparseMatrix A(dim, dim, 5); testproblem.five_point(A); + A.compress (VectorOperation::insert); PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - 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 3edb73d612..27daaebc5f 100644 --- a/tests/petsc/deal_solver_03.cc +++ b/tests/petsc/deal_solver_03.cc @@ -89,9 +89,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); GrowingVectorMemory mem; SolverGMRES solver(control,mem); diff --git a/tests/petsc/deal_solver_04.cc b/tests/petsc/deal_solver_04.cc index d3f932664b..99c19b0b6e 100644 --- a/tests/petsc/deal_solver_04.cc +++ b/tests/petsc/deal_solver_04.cc @@ -88,9 +88,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); GrowingVectorMemory mem; SolverMinRes solver(control,mem); diff --git a/tests/petsc/deal_solver_05.cc b/tests/petsc/deal_solver_05.cc index ce225df08d..72bd9bdade 100644 --- a/tests/petsc/deal_solver_05.cc +++ b/tests/petsc/deal_solver_05.cc @@ -87,9 +87,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); GrowingVectorMemory mem; SolverQMRS solver(control,mem); diff --git a/tests/petsc/full_matrix_00.cc b/tests/petsc/full_matrix_00.cc index 824d1fbe6a..c9914e2127 100644 --- a/tests/petsc/full_matrix_00.cc +++ b/tests/petsc/full_matrix_00.cc @@ -34,7 +34,7 @@ void test (PETScWrappers::FullMatrix &m) for (unsigned int j=0; jrow() << ' ' << 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 9685ee4382..ef9a9a8304 100644 --- a/tests/petsc/full_matrix_vector_01.cc +++ b/tests/petsc/full_matrix_vector_01.cc @@ -36,9 +36,8 @@ 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 a93f05b9d0..5a70894fcc 100644 --- a/tests/petsc/full_matrix_vector_06.cc +++ b/tests/petsc/full_matrix_vector_06.cc @@ -35,8 +35,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 a8226aa8b0..001829635e 100644 --- a/tests/petsc/full_matrix_vector_07.cc +++ b/tests/petsc/full_matrix_vector_07.cc @@ -40,9 +40,9 @@ void test (PETScWrappers::Vector &v, w(i) = i+1; } - m.compress (VectorOperation::add); - v.compress (VectorOperation::add); - w.compress (VectorOperation::add); + m.compress (VectorOperation::insert); + v.compress (VectorOperation::insert); + w.compress (VectorOperation::insert); // x=w-Mv const double s = m.residual (x, v, w); diff --git a/tests/petsc/solver_01.cc b/tests/petsc/solver_01.cc index 0294903e55..0a48809690 100644 --- a/tests/petsc/solver_01.cc +++ b/tests/petsc/solver_01.cc @@ -81,9 +81,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverRichardson solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); diff --git a/tests/petsc/solver_02.cc b/tests/petsc/solver_02.cc index 372fe4acc7..58de09df2e 100644 --- a/tests/petsc/solver_02.cc +++ b/tests/petsc/solver_02.cc @@ -84,9 +84,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverChebychev solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); diff --git a/tests/petsc/solver_03.cc b/tests/petsc/solver_03.cc index c8ba190a51..4c839e3c80 100644 --- a/tests/petsc/solver_03.cc +++ b/tests/petsc/solver_03.cc @@ -82,9 +82,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); diff --git a/tests/petsc/solver_03_mf.cc b/tests/petsc/solver_03_mf.cc index ad3b8eae4c..f651d2bc45 100644 --- a/tests/petsc/solver_03_mf.cc +++ b/tests/petsc/solver_03_mf.cc @@ -80,9 +80,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionNone preconditioner(A); diff --git a/tests/petsc/solver_03_precondition_boomeramg.cc b/tests/petsc/solver_03_precondition_boomeramg.cc index 3952dd18c1..404b096793 100644 --- a/tests/petsc/solver_03_precondition_boomeramg.cc +++ b/tests/petsc/solver_03_precondition_boomeramg.cc @@ -83,9 +83,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionBoomerAMG preconditioner(A); diff --git a/tests/petsc/solver_03_precondition_boomeramg_symmetric.cc b/tests/petsc/solver_03_precondition_boomeramg_symmetric.cc index c301083b4a..ce04b203bd 100644 --- a/tests/petsc/solver_03_precondition_boomeramg_symmetric.cc +++ b/tests/petsc/solver_03_precondition_boomeramg_symmetric.cc @@ -84,9 +84,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionBoomerAMG preconditioner(A, true); diff --git a/tests/petsc/solver_03_precondition_eisenstat.cc b/tests/petsc/solver_03_precondition_eisenstat.cc index 8528015206..5747cf0e35 100644 --- a/tests/petsc/solver_03_precondition_eisenstat.cc +++ b/tests/petsc/solver_03_precondition_eisenstat.cc @@ -82,9 +82,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionEisenstat preconditioner(A); diff --git a/tests/petsc/solver_03_precondition_icc.cc b/tests/petsc/solver_03_precondition_icc.cc index 6f3fa7708a..7a04bc7770 100644 --- a/tests/petsc/solver_03_precondition_icc.cc +++ b/tests/petsc/solver_03_precondition_icc.cc @@ -82,9 +82,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionICC preconditioner(A); diff --git a/tests/petsc/solver_03_precondition_lu.cc b/tests/petsc/solver_03_precondition_lu.cc index 3bb0a590b4..b7b88a0f37 100644 --- a/tests/petsc/solver_03_precondition_lu.cc +++ b/tests/petsc/solver_03_precondition_lu.cc @@ -89,9 +89,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionLU preconditioner(A); diff --git a/tests/petsc/solver_03_precondition_parasails.cc b/tests/petsc/solver_03_precondition_parasails.cc index def46b1520..269fdaae8f 100644 --- a/tests/petsc/solver_03_precondition_parasails.cc +++ b/tests/petsc/solver_03_precondition_parasails.cc @@ -82,9 +82,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionParaSails preconditioner(A); diff --git a/tests/petsc/solver_03_precondition_sor.cc b/tests/petsc/solver_03_precondition_sor.cc index ceab998ba0..91edc6de6d 100644 --- a/tests/petsc/solver_03_precondition_sor.cc +++ b/tests/petsc/solver_03_precondition_sor.cc @@ -82,9 +82,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionSOR preconditioner(A); diff --git a/tests/petsc/solver_03_precondition_ssor.cc b/tests/petsc/solver_03_precondition_ssor.cc index 5f47ab3d90..9856f14bb7 100644 --- a/tests/petsc/solver_03_precondition_ssor.cc +++ b/tests/petsc/solver_03_precondition_ssor.cc @@ -82,9 +82,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCG solver(control); PETScWrappers::PreconditionSSOR preconditioner(A); diff --git a/tests/petsc/solver_04.cc b/tests/petsc/solver_04.cc index 895845c74e..0f57a698b6 100644 --- a/tests/petsc/solver_04.cc +++ b/tests/petsc/solver_04.cc @@ -82,9 +82,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverBiCG solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); diff --git a/tests/petsc/solver_05.cc b/tests/petsc/solver_05.cc index c88c9e4786..d3bcd3d20a 100644 --- a/tests/petsc/solver_05.cc +++ b/tests/petsc/solver_05.cc @@ -82,9 +82,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverGMRES solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); diff --git a/tests/petsc/solver_06.cc b/tests/petsc/solver_06.cc index 1a81d8e151..95c65ac3af 100644 --- a/tests/petsc/solver_06.cc +++ b/tests/petsc/solver_06.cc @@ -85,9 +85,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverBicgstab solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); diff --git a/tests/petsc/solver_07.cc b/tests/petsc/solver_07.cc index 6d677ade05..0a568fc940 100644 --- a/tests/petsc/solver_07.cc +++ b/tests/petsc/solver_07.cc @@ -82,9 +82,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCGS solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); diff --git a/tests/petsc/solver_08.cc b/tests/petsc/solver_08.cc index 4b749fd338..87286242f8 100644 --- a/tests/petsc/solver_08.cc +++ b/tests/petsc/solver_08.cc @@ -82,9 +82,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverTFQMR solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); diff --git a/tests/petsc/solver_09.cc b/tests/petsc/solver_09.cc index 08520c11ba..01e44da878 100644 --- a/tests/petsc/solver_09.cc +++ b/tests/petsc/solver_09.cc @@ -86,9 +86,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverTCQMR solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); diff --git a/tests/petsc/solver_10.cc b/tests/petsc/solver_10.cc index 5fc7cd7efc..3197a839fe 100644 --- a/tests/petsc/solver_10.cc +++ b/tests/petsc/solver_10.cc @@ -82,9 +82,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverCR solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); diff --git a/tests/petsc/solver_11.cc b/tests/petsc/solver_11.cc index c22613b528..5f8a6c81d9 100644 --- a/tests/petsc/solver_11.cc +++ b/tests/petsc/solver_11.cc @@ -86,9 +86,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverLSQR solver(control); PETScWrappers::PreconditionJacobi preconditioner(A); diff --git a/tests/petsc/solver_12.cc b/tests/petsc/solver_12.cc index b0c4032d39..79a6e9d43e 100644 --- a/tests/petsc/solver_12.cc +++ b/tests/petsc/solver_12.cc @@ -75,9 +75,7 @@ int main(int argc, char **argv) PETScWrappers::Vector f(dim); PETScWrappers::Vector u(dim); f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::SolverPreOnly solver(control); diff --git a/tests/petsc/solver_13.cc b/tests/petsc/solver_13.cc index 50909db7cd..5deb2efdd8 100644 --- a/tests/petsc/solver_13.cc +++ b/tests/petsc/solver_13.cc @@ -73,9 +73,7 @@ int main(int argc, char **argv) PETScWrappers::Vector u(dim); u = 0.; f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); PETScWrappers::Vector t=u; PETScWrappers::SolverPreOnly solver(control); diff --git a/tests/petsc/sparse_direct_mumps.cc b/tests/petsc/sparse_direct_mumps.cc index 4670fb127e..3432a94fc6 100644 --- a/tests/petsc/sparse_direct_mumps.cc +++ b/tests/petsc/sparse_direct_mumps.cc @@ -57,9 +57,7 @@ int main(int argc, char **argv) PETScWrappers::Vector u(dim); u = 0.; f = 1.; - A.compress (VectorOperation::add); - f.compress (VectorOperation::add); - u.compress (VectorOperation::add); + A.compress (VectorOperation::insert); SolverControl cn; PETScWrappers::SparseDirectMUMPS solver(cn); diff --git a/tests/petsc/sparse_matrix_01.cc b/tests/petsc/sparse_matrix_01.cc index 3d39fb34b2..41b4d0d97a 100644 --- a/tests/petsc/sparse_matrix_01.cc +++ b/tests/petsc/sparse_matrix_01.cc @@ -33,13 +33,13 @@ void test () for (unsigned int j=0; j<=i; ++j) m.set (i,j, i+2*j); - m.compress (VectorOperation::add); + m.compress (VectorOperation::insert); PETScWrappers::SparseMatrix m2(s,s,s); m2.set(0,1,5.0); for (unsigned int i=0; irow() << ' ' << 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 e510513ac2..d54aa90c13 100644 --- a/tests/petsc/sparse_matrix_vector_01.cc +++ b/tests/petsc/sparse_matrix_vector_01.cc @@ -36,9 +36,8 @@ 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 d589fe11fd..a84f749f09 100644 --- a/tests/petsc/sparse_matrix_vector_06.cc +++ b/tests/petsc/sparse_matrix_vector_06.cc @@ -35,8 +35,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 26041ff6bc..35fc56c870 100644 --- a/tests/petsc/sparse_matrix_vector_07.cc +++ b/tests/petsc/sparse_matrix_vector_07.cc @@ -40,9 +40,9 @@ void test (PETScWrappers::Vector &v, w(i) = i+1; } - m.compress (VectorOperation::add); - v.compress (VectorOperation::add); - w.compress (VectorOperation::add); + m.compress (VectorOperation::insert); + v.compress (VectorOperation::insert); + w.compress (VectorOperation::insert); // x=w-Mv const double s = m.residual (x, v, w);