From 069a6992038449e1a7d8e9bd5bdceba65ea8cfd7 Mon Sep 17 00:00:00 2001 From: heister Date: Thu, 18 Jul 2013 19:03:59 +0000 Subject: [PATCH] fix many warnings in tests git-svn-id: https://svn.dealii.org/trunk@30043 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/mpi/constraint_matrix_condense_01.cc | 2 +- tests/mpi/ghost_01.cc | 4 ++-- tests/mpi/ghost_02.cc | 6 +++--- tests/mpi/ghost_03.cc | 4 ++-- tests/mpi/interpolate_02.cc | 1 - tests/mpi/interpolate_04.cc | 4 ++-- tests/mpi/no_flux_constraints.cc | 2 +- tests/mpi/no_flux_constraints_02.cc | 2 +- tests/mpi/no_flux_constraints_03.cc | 2 +- tests/mpi/p4est_2d_constraintmatrix_04.cc | 3 --- tests/mpi/p4est_2d_constraintmatrix_05.cc | 1 - tests/mpi/p4est_2d_simple.cc | 2 +- tests/mpi/p4est_3d_constraintmatrix_03.cc | 3 --- tests/mpi/p4est_save_02.cc | 6 +++--- tests/mpi/p4est_save_03.cc | 12 ++++++------ tests/mpi/petsc_01.cc | 4 ++-- tests/mpi/petsc_02.cc | 2 +- tests/mpi/petsc_distribute_01.cc | 4 +--- tests/mpi/petsc_distribute_01_block.cc | 4 +--- tests/mpi/petsc_distribute_01_inhomogenous.cc | 4 +--- tests/mpi/renumber_z_order_01.cc | 2 +- tests/mpi/renumber_z_order_02.cc | 2 +- tests/mpi/solution_transfer_01.cc | 6 +++--- tests/mpi/step-40.cc | 14 ++++++-------- tests/mpi/step-40_direct_solver.cc | 10 ++++------ tests/mpi/trilinos_distribute_01_block.cc | 4 +--- tests/mpi/trilinos_distribute_01_inhomogenous.cc | 4 +--- 27 files changed, 46 insertions(+), 68 deletions(-) diff --git a/tests/mpi/constraint_matrix_condense_01.cc b/tests/mpi/constraint_matrix_condense_01.cc index 3f145e49bb..f5d31360b7 100644 --- a/tests/mpi/constraint_matrix_condense_01.cc +++ b/tests/mpi/constraint_matrix_condense_01.cc @@ -45,7 +45,7 @@ void test () DoFTools::extract_locally_relevant_dofs (dof_handler,locally_relevant_dofs); PETScWrappers::MPI::Vector force; - force.reinit (mpi_communicator, locally_owned_dofs); + force.reinit (locally_owned_dofs, mpi_communicator); Assert(!force.has_ghost_elements(), ExcInternalError()); ConstraintMatrix constraints (locally_relevant_dofs); diff --git a/tests/mpi/ghost_01.cc b/tests/mpi/ghost_01.cc index d0dfa49f72..83625894ec 100644 --- a/tests/mpi/ghost_01.cc +++ b/tests/mpi/ghost_01.cc @@ -39,8 +39,8 @@ void test () IndexSet local_relevant(numproc*2); local_relevant.add_range(1,2); - PETScWrappers::MPI::Vector vb(MPI_COMM_WORLD, local_active); - PETScWrappers::MPI::Vector v(MPI_COMM_WORLD, local_active, local_relevant); + PETScWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD); // set local values vb(myid*2)=myid*2.0; diff --git a/tests/mpi/ghost_02.cc b/tests/mpi/ghost_02.cc index f63fd9c315..6f7d48a5fa 100644 --- a/tests/mpi/ghost_02.cc +++ b/tests/mpi/ghost_02.cc @@ -39,9 +39,9 @@ void test () IndexSet local_relevant(numproc*2); local_relevant.add_range(1,2); - PETScWrappers::MPI::Vector vb(MPI_COMM_WORLD, local_active); - PETScWrappers::MPI::Vector v(MPI_COMM_WORLD, local_active, local_relevant); - PETScWrappers::MPI::Vector v2(MPI_COMM_WORLD, local_active, local_relevant); + PETScWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector v2(local_active, local_relevant, MPI_COMM_WORLD); vb = 1.5; v2 = vb; diff --git a/tests/mpi/ghost_03.cc b/tests/mpi/ghost_03.cc index f5c5cf36c0..35cce3c75d 100644 --- a/tests/mpi/ghost_03.cc +++ b/tests/mpi/ghost_03.cc @@ -39,8 +39,8 @@ void test () IndexSet local_relevant(numproc*2); local_relevant.add_range(1,2); - PETScWrappers::MPI::Vector vb(MPI_COMM_WORLD, local_active); - PETScWrappers::MPI::Vector v(MPI_COMM_WORLD, local_active, local_relevant); + PETScWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD); // set local values vb(myid*2)=myid*2.0; diff --git a/tests/mpi/interpolate_02.cc b/tests/mpi/interpolate_02.cc index 94f068e666..a141fa4407 100644 --- a/tests/mpi/interpolate_02.cc +++ b/tests/mpi/interpolate_02.cc @@ -66,7 +66,6 @@ void test() VectorTools::interpolate(dofh, ConstantFunction(1), x); - x.compress (); const double norm = x.l2_norm(); if (myid == 0) deallog << dofh.n_locally_owned_dofs() << ' ' << dofh.n_dofs() diff --git a/tests/mpi/interpolate_04.cc b/tests/mpi/interpolate_04.cc index c16688d55c..70b6c237ce 100644 --- a/tests/mpi/interpolate_04.cc +++ b/tests/mpi/interpolate_04.cc @@ -71,9 +71,9 @@ void test() DoFTools::extract_locally_relevant_dofs (dofh1, dof1_locally_relevant_dofs); - PETScWrappers::MPI::Vector u1(MPI_COMM_WORLD, dof1_locally_owned_dofs, dof1_locally_relevant_dofs); + PETScWrappers::MPI::Vector u1(dof1_locally_owned_dofs, dof1_locally_relevant_dofs, MPI_COMM_WORLD); - PETScWrappers::MPI::Vector out(MPI_COMM_WORLD, dof1_locally_owned_dofs); + PETScWrappers::MPI::Vector out(dof1_locally_owned_dofs, MPI_COMM_WORLD); FETools::interpolation_difference (dofh1, cm1, u1, dofh2, cm2, out); diff --git a/tests/mpi/no_flux_constraints.cc b/tests/mpi/no_flux_constraints.cc index 0475e44352..29949e70ea 100644 --- a/tests/mpi/no_flux_constraints.cc +++ b/tests/mpi/no_flux_constraints.cc @@ -148,7 +148,7 @@ void test() local_dof_indices, vector); } - vector.compress (Add); + vector.compress (VectorOperation::add); } // now check that no entries were generated diff --git a/tests/mpi/no_flux_constraints_02.cc b/tests/mpi/no_flux_constraints_02.cc index d3370390d9..384267361f 100644 --- a/tests/mpi/no_flux_constraints_02.cc +++ b/tests/mpi/no_flux_constraints_02.cc @@ -191,7 +191,7 @@ void test() local_dof_indices, vector); } - vector.compress (Add); + vector.compress (VectorOperation::add); } // now check that no entries were generated diff --git a/tests/mpi/no_flux_constraints_03.cc b/tests/mpi/no_flux_constraints_03.cc index b3deca1f41..2efb375f58 100644 --- a/tests/mpi/no_flux_constraints_03.cc +++ b/tests/mpi/no_flux_constraints_03.cc @@ -164,7 +164,7 @@ void test() local_dof_indices, vector); } - vector.compress (Add); + vector.compress (VectorOperation::add); } // now check that no entries were generated diff --git a/tests/mpi/p4est_2d_constraintmatrix_04.cc b/tests/mpi/p4est_2d_constraintmatrix_04.cc index e67545d428..aa3f5908eb 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_04.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_04.cc @@ -182,7 +182,6 @@ void test() VectorTools::interpolate(dofh, TemperatureInitialValues(), x); - x.compress(); TrilinosWrappers::MPI::Vector x_rel; x_rel.reinit(relevant_set, MPI_COMM_WORLD); x_rel = x; @@ -258,7 +257,6 @@ void test() trans.interpolate(x); x_rel.reinit(relevant_set, MPI_COMM_WORLD); - x_rel.compress(); ConstraintMatrix cm(relevant_set); DoFTools::make_hanging_node_constraints (dofh, cm); @@ -285,7 +283,6 @@ void test() VectorTools::interpolate(dofh, TemperatureInitialValues(), x_ref); - x_ref.compress(); x_ref -= x; double err = x_ref.linfty_norm(); diff --git a/tests/mpi/p4est_2d_constraintmatrix_05.cc b/tests/mpi/p4est_2d_constraintmatrix_05.cc index 7dcc1222a3..2e7a6b5ed5 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_05.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_05.cc @@ -57,7 +57,6 @@ void test() VectorTools::interpolate(dofh, ConstantFunction (1.), x_ref); - x_ref.compress(); TrilinosWrappers::MPI::Vector x1 (x_ref); diff --git a/tests/mpi/p4est_2d_simple.cc b/tests/mpi/p4est_2d_simple.cc index 3f7c087ca3..5616e84f70 100644 --- a/tests/mpi/p4est_2d_simple.cc +++ b/tests/mpi/p4est_2d_simple.cc @@ -59,7 +59,7 @@ void test() } else { - Assert( tr.begin_active()->subdomain_id()==types::artificial_subdomain_id, + Assert( tr.begin_active()->subdomain_id()==numbers::artificial_subdomain_id, ExcInternalError() ); } diff --git a/tests/mpi/p4est_3d_constraintmatrix_03.cc b/tests/mpi/p4est_3d_constraintmatrix_03.cc index 09558e6db4..7aa7ee1163 100644 --- a/tests/mpi/p4est_3d_constraintmatrix_03.cc +++ b/tests/mpi/p4est_3d_constraintmatrix_03.cc @@ -181,7 +181,6 @@ void test() VectorTools::interpolate(dofh, TemperatureInitialValues(), x); - x.compress(); TrilinosWrappers::MPI::Vector x_rel; x_rel.reinit(relevant_set, MPI_COMM_WORLD); x_rel = x; @@ -253,7 +252,6 @@ void test() trans.interpolate(x); x_rel.reinit(relevant_set, MPI_COMM_WORLD); - x_rel.compress(); ConstraintMatrix cm(relevant_set); DoFTools::make_hanging_node_constraints (dofh, cm); @@ -280,7 +278,6 @@ void test() VectorTools::interpolate(dofh, TemperatureInitialValues(), x_ref); - x_ref.compress(); x_ref -= x; double err = x_ref.linfty_norm(); diff --git a/tests/mpi/p4est_save_02.cc b/tests/mpi/p4est_save_02.cc index e1ecc552dc..b14a1fb9fb 100644 --- a/tests/mpi/p4est_save_02.cc +++ b/tests/mpi/p4est_save_02.cc @@ -76,8 +76,8 @@ void test() DoFTools::extract_locally_relevant_dofs (dh,locally_relevant_dofs); - PETScWrappers::MPI::Vector x(MPI_COMM_WORLD,locally_owned_dofs); - PETScWrappers::MPI::Vector solution(MPI_COMM_WORLD,locally_owned_dofs, locally_relevant_dofs); + PETScWrappers::MPI::Vector x(locally_owned_dofs, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector solution(locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); parallel::distributed::SolutionTransfer soltrans(dh); @@ -123,7 +123,7 @@ void test() DoFTools::extract_locally_relevant_dofs (dh,locally_relevant_dofs); - PETScWrappers::MPI::Vector solution(MPI_COMM_WORLD,locally_owned_dofs); + PETScWrappers::MPI::Vector solution(locally_owned_dofs, MPI_COMM_WORLD); parallel::distributed::SolutionTransfer soltrans(dh); solution = 2; soltrans.deserialize(solution); diff --git a/tests/mpi/p4est_save_03.cc b/tests/mpi/p4est_save_03.cc index 1c09c01562..6bde2bffff 100644 --- a/tests/mpi/p4est_save_03.cc +++ b/tests/mpi/p4est_save_03.cc @@ -77,10 +77,10 @@ void test() DoFTools::extract_locally_relevant_dofs (dh, locally_relevant_dofs); - PETScWrappers::MPI::Vector x (MPI_COMM_WORLD, locally_owned_dofs); - PETScWrappers::MPI::Vector x2 (MPI_COMM_WORLD, locally_owned_dofs); - PETScWrappers::MPI::Vector solution (MPI_COMM_WORLD, locally_owned_dofs, locally_relevant_dofs); - PETScWrappers::MPI::Vector solution2 (MPI_COMM_WORLD, locally_owned_dofs, locally_relevant_dofs); + PETScWrappers::MPI::Vector x (locally_owned_dofs, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector x2 (locally_owned_dofs, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector solution (locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector solution2 (locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); parallel::distributed::SolutionTransfer soltrans (dh); parallel::distributed::SolutionTransfer soltrans2 (dh); @@ -132,8 +132,8 @@ void test() DoFTools::extract_locally_relevant_dofs (dh, locally_relevant_dofs); - PETScWrappers::MPI::Vector solution (MPI_COMM_WORLD, locally_owned_dofs); - PETScWrappers::MPI::Vector solution2 (MPI_COMM_WORLD, locally_owned_dofs); + PETScWrappers::MPI::Vector solution (locally_owned_dofs, MPI_COMM_WORLD); + PETScWrappers::MPI::Vector solution2 (locally_owned_dofs, MPI_COMM_WORLD); parallel::distributed::SolutionTransfer soltrans (dh); parallel::distributed::SolutionTransfer soltrans2 (dh); solution = 2; diff --git a/tests/mpi/petsc_01.cc b/tests/mpi/petsc_01.cc index e517a6f371..c2296898e0 100644 --- a/tests/mpi/petsc_01.cc +++ b/tests/mpi/petsc_01.cc @@ -53,7 +53,7 @@ void test() mat.add((2*myid+2)%(2*numprocs),(2*myid+2)%(2*numprocs),0.1); - mat.compress(); + mat.compress(VectorOperation::add); std::vector rows(1,1); mat.clear_rows(rows); @@ -69,7 +69,7 @@ void test() mat.add((2*myid+2)%(2*numprocs),(2*myid+2)%(2*numprocs),0.1); - mat.compress(); + mat.compress(VectorOperation::add); // mat.write_ascii(); if (myid==0) diff --git a/tests/mpi/petsc_02.cc b/tests/mpi/petsc_02.cc index 1f48ce84a6..f7f075cbe2 100644 --- a/tests/mpi/petsc_02.cc +++ b/tests/mpi/petsc_02.cc @@ -50,7 +50,7 @@ void test() mat.add(0, 0, 1.0); - mat.compress(); + mat.compress(VectorOperation::add); if (myid==0) deallog << "done" << std::endl; diff --git a/tests/mpi/petsc_distribute_01.cc b/tests/mpi/petsc_distribute_01.cc index 79a25e8490..62321196bd 100644 --- a/tests/mpi/petsc_distribute_01.cc +++ b/tests/mpi/petsc_distribute_01.cc @@ -46,7 +46,7 @@ void test() Assert (vec.local_range().second == 100*myid+100, ExcInternalError()); for (unsigned int i=vec.local_range().first; i soltrans(dh); @@ -81,11 +81,11 @@ void test() locally_owned_dofs = dh.locally_owned_dofs (); DoFTools::extract_locally_relevant_dofs (dh,locally_relevant_dofs); - PETScWrappers::MPI::Vector tmp(MPI_COMM_WORLD,dh.n_dofs(),dh.n_locally_owned_dofs()); + PETScWrappers::MPI::Vector tmp(locally_owned_dofs, MPI_COMM_WORLD); soltrans.interpolate (tmp); - solution.reinit(MPI_COMM_WORLD,locally_owned_dofs,locally_relevant_dofs); + solution.reinit(locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD); solution = tmp; // make sure no processor is diff --git a/tests/mpi/step-40.cc b/tests/mpi/step-40.cc index 745fc51bff..85947c3033 100644 --- a/tests/mpi/step-40.cc +++ b/tests/mpi/step-40.cc @@ -131,12 +131,10 @@ namespace Step40 DoFTools::extract_locally_relevant_dofs (dof_handler, locally_relevant_dofs); - locally_relevant_solution.reinit (mpi_communicator, - locally_owned_dofs, - locally_relevant_dofs); - system_rhs.reinit (mpi_communicator, - dof_handler.n_dofs(), - dof_handler.n_locally_owned_dofs()); + locally_relevant_solution.reinit (locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); + system_rhs.reinit (locally_owned_dofs, mpi_communicator); system_rhs = 0; constraints.clear (); @@ -228,8 +226,8 @@ namespace Step40 system_rhs); } - system_matrix.compress (); - system_rhs.compress (); + system_matrix.compress (VectorOperation::add); + system_rhs.compress (VectorOperation::add); } diff --git a/tests/mpi/step-40_direct_solver.cc b/tests/mpi/step-40_direct_solver.cc index 0fda23bc85..fe4caddef5 100644 --- a/tests/mpi/step-40_direct_solver.cc +++ b/tests/mpi/step-40_direct_solver.cc @@ -131,12 +131,10 @@ namespace Step40 DoFTools::extract_locally_relevant_dofs (dof_handler, locally_relevant_dofs); - locally_relevant_solution.reinit (mpi_communicator, - locally_owned_dofs, - locally_relevant_dofs); - system_rhs.reinit (mpi_communicator, - dof_handler.n_dofs(), - dof_handler.n_locally_owned_dofs()); + locally_relevant_solution.reinit (locally_owned_dofs, + locally_relevant_dofs, + mpi_communicator); + system_rhs.reinit (locally_owned_dofs, mpi_communicator); system_rhs = 0; constraints.clear (); diff --git a/tests/mpi/trilinos_distribute_01_block.cc b/tests/mpi/trilinos_distribute_01_block.cc index cf4de849e7..07fb84bad5 100644 --- a/tests/mpi/trilinos_distribute_01_block.cc +++ b/tests/mpi/trilinos_distribute_01_block.cc @@ -53,7 +53,7 @@ void test() vec.block(0)(i) = i; for (unsigned int i=vec.block(1).local_range().first; i