]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fix many warnings in tests
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 18 Jul 2013 19:03:59 +0000 (19:03 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 18 Jul 2013 19:03:59 +0000 (19:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@30043 0785d39b-7218-0410-832d-ea1e28bc413d

27 files changed:
tests/mpi/constraint_matrix_condense_01.cc
tests/mpi/ghost_01.cc
tests/mpi/ghost_02.cc
tests/mpi/ghost_03.cc
tests/mpi/interpolate_02.cc
tests/mpi/interpolate_04.cc
tests/mpi/no_flux_constraints.cc
tests/mpi/no_flux_constraints_02.cc
tests/mpi/no_flux_constraints_03.cc
tests/mpi/p4est_2d_constraintmatrix_04.cc
tests/mpi/p4est_2d_constraintmatrix_05.cc
tests/mpi/p4est_2d_simple.cc
tests/mpi/p4est_3d_constraintmatrix_03.cc
tests/mpi/p4est_save_02.cc
tests/mpi/p4est_save_03.cc
tests/mpi/petsc_01.cc
tests/mpi/petsc_02.cc
tests/mpi/petsc_distribute_01.cc
tests/mpi/petsc_distribute_01_block.cc
tests/mpi/petsc_distribute_01_inhomogenous.cc
tests/mpi/renumber_z_order_01.cc
tests/mpi/renumber_z_order_02.cc
tests/mpi/solution_transfer_01.cc
tests/mpi/step-40.cc
tests/mpi/step-40_direct_solver.cc
tests/mpi/trilinos_distribute_01_block.cc
tests/mpi/trilinos_distribute_01_inhomogenous.cc

index 3f145e49bbd2503afbff95ad3557993390fba70d..f5d31360b7c67cab66f15b8578755e9364494a5f 100644 (file)
@@ -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);
index d0dfa49f72fcef7159d95d7942cb91f63c13d8fd..83625894ec626759d6fedeb9ed3377f0b8f545b1 100644 (file)
@@ -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;
index f63fd9c315735b8d7f868fa72a1f4aa664a47faa..6f7d48a5fa0016d55795361ee4e370891a01563e 100644 (file)
@@ -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;
index f5c5cf36c041d1a89a21c6ecb7348be32a33456b..35cce3c75d93d0156608f8bde8d077d830917a8e 100644 (file)
@@ -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;
index 94f068e666f7db4e8a70e1a0d8ed2c0828cb95ab..a141fa440717d0506bd0e576607153be4b282df8 100644 (file)
@@ -66,7 +66,6 @@ void test()
   VectorTools::interpolate(dofh,
                           ConstantFunction<dim>(1),
                           x);
-  x.compress ();
   const double norm = x.l2_norm();
   if (myid == 0)
     deallog << dofh.n_locally_owned_dofs() << ' ' << dofh.n_dofs()
index c16688d55c134130212889931f80e6536402816a..70b6c237ce83ef96d9aeb9f251955ac9632e92da 100644 (file)
@@ -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);
index 0475e44352f474edac5ec63fdfd4f1a5209d393a..29949e70eaa5c7d802748bfb55da0414017ddb45 100644 (file)
@@ -148,7 +148,7 @@ void test()
                                                  local_dof_indices,
                                                  vector);
        }
-    vector.compress (Add);
+    vector.compress (VectorOperation::add);
   }
 
                                // now check that no entries were generated
index d3370390d953de78fa90af6ba3c95926e86c6c0b..384267361f39ac488dce0d8f62fa3ee1cb34e922 100644 (file)
@@ -191,7 +191,7 @@ void test()
                                                  local_dof_indices,
                                                  vector);
        }
-    vector.compress (Add);
+    vector.compress (VectorOperation::add);
   }
 
                                // now check that no entries were generated
index b3deca1f419ede6a8f3ac88c0d799cce164e78c6..2efb375f58ca8d9d139a969ec21dada6c33696e2 100644 (file)
@@ -164,7 +164,7 @@ void test()
                                                  local_dof_indices,
                                                  vector);
        }
-    vector.compress (Add);
+    vector.compress (VectorOperation::add);
   }
 
                                // now check that no entries were generated
index e67545d428bad06f3ce042c67a09c75f4c5fd6b6..aa3f5908eb73010cc0ef7e12ebefc7ee41eec47e 100644 (file)
@@ -182,7 +182,6 @@ void test()
   VectorTools::interpolate(dofh,
                           TemperatureInitialValues<dim>(),
                           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<dim>(),
                           x_ref);
-  x_ref.compress();
 
   x_ref -= x;
   double err = x_ref.linfty_norm();
index 7dcc1222a342fa93dc5803711d7f1a239c999334..2e7a6b5ed55daf2a7a81cbaa7f78ec6bcd2c7058 100644 (file)
@@ -57,7 +57,6 @@ void test()
   VectorTools::interpolate(dofh,
                           ConstantFunction<dim> (1.),
                           x_ref);
-  x_ref.compress();
 
   TrilinosWrappers::MPI::Vector x1 (x_ref);
 
index 3f7c087ca31a26c3a82fb2294b92a4e241c20522..5616e84f708b9bd1325d1e4b0011bdf83a1346b5 100644 (file)
@@ -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() );
        }
 
index 09558e6db4d2fbcbdb207d7d6afe2de7a179f140..7aa7ee1163b4fe78b34270ceebd21c29be76dda9 100644 (file)
@@ -181,7 +181,6 @@ void test()
   VectorTools::interpolate(dofh,
                           TemperatureInitialValues<dim>(),
                           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<dim>(),
                           x_ref);
-  x_ref.compress();
 
   x_ref -= x;
   double err = x_ref.linfty_norm();
index e1ecc552dc564948eb3d072dd5ba3cb34705d23b..b14a1fb9fbe06a04cc125fae3e1b7f9745d6b1d6 100644 (file)
@@ -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<dim,PETScWrappers::MPI::Vector> 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<dim,PETScWrappers::MPI::Vector> soltrans(dh);
     solution = 2;
     soltrans.deserialize(solution);
index 1c09c0156293b80f8639ec9a3f3c4ccaf917c417..6bde2bffffdb09cfb1cd3ebeb342122e2931ce4e 100644 (file)
@@ -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<dim, PETScWrappers::MPI::Vector> soltrans (dh);
     parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> 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<dim, PETScWrappers::MPI::Vector> soltrans (dh);
     parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans2 (dh);
     solution = 2;
index e517a6f371bcbd4bec144e6b86f83746b93ebebd..c2296898e08aefd1e168577dd8643400236eaf5f 100644 (file)
@@ -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<types::global_dof_index> 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)
index 1f48ce84a6330aa488749e6c196f8e7e51d132db..f7f075cbe2a67d9915223daff4ff48d77e0606e2 100644 (file)
@@ -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;
index 79a25e8490abaf9afcd24b6d5ec64af16b9a2398..62321196bd7b28e20ba36ea288b735ec09d4c735 100644 (file)
@@ -46,7 +46,7 @@ void test()
   Assert (vec.local_range().second == 100*myid+100, ExcInternalError());
   for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
     vec(i) = i;
-  vec.compress();
+  vec.compress(VectorOperation::insert);
 
   // verify correctness so far
   {
@@ -95,8 +95,6 @@ void test()
   cm.distribute (vec);
 
   // verify correctness
-  vec.compress ();
-
   if (myid != 0)
     Assert (vec(vec.local_range().first+10) == vec.local_range().first-25,
            ExcInternalError());
index 7b8d14f59c5d88a46b47b0f695392af46fc062c4..8f14f3780214529f524643efeb4e33aeb12d7ee3 100644 (file)
@@ -49,7 +49,7 @@ void test()
     vec.block(0)(i) = i;
   for (unsigned int i=vec.block(1).local_range().first; i<vec.block(1).local_range().second; ++i)
     vec.block(1)(i) = i;
-  vec.compress();
+  vec.compress(VectorOperation::add);
 
   // verify correctness so far
   {
@@ -108,8 +108,6 @@ void test()
   cm.distribute (vec);
 
   // verify correctness
-  vec.compress ();
-
   if (myid != 0)
     Assert (vec(vec.block(0).local_range().first+10) == vec.block(0).local_range().first-25,
            ExcInternalError());
index 1dd01bae8dc80248ccc82765c59e973f4968e99f..b854e6baa6239148667e30367ba5868e318f89f2 100644 (file)
@@ -38,7 +38,7 @@ void test()
   Assert (vec.local_range().second == 100*myid+100, ExcInternalError());
   for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
     vec(i) = i;
-  vec.compress();
+  vec.compress(VectorOperation::insert);
 
   // verify correctness so far
   {
@@ -89,8 +89,6 @@ void test()
   cm.distribute (vec);
 
   // verify correctness
-  vec.compress ();
-
   if (myid != 0)
     Assert (vec(vec.local_range().first+10) == vec.local_range().first-25+1,
            ExcInternalError());
index 6f10229f1c24e4f01fa71ac6033e45e207b731a3..74a7f8055a0c2504720c0390b828187126b8b443 100644 (file)
@@ -108,7 +108,7 @@ void test()
             }
           cm.distribute_local_to_global (local_vector, local_dof_indices, vector);
         }
-    vector.compress();
+    vector.compress(VectorOperation::add);
   }
   double norm = vector.l2_norm();
   if (myid == 0)
index 4847076cdc5a271209d67b98b2ab837d3141d3a7..f78aa960efdcd097542aa8ac6ae8a81109c29805 100644 (file)
@@ -115,7 +115,7 @@ void test()
             }
           cm.distribute_local_to_global (local_vector, local_dof_indices, vector);
         }
-    vector.compress();
+    vector.compress(VectorOperation::add);
   }
   double norm = vector.l2_norm();
   if (myid == 0)
index 26c800becec9462f9f7ab41b68693e61c3c79427..a9786bc3e6090d725fe2c069f93d052f71220bd6 100644 (file)
@@ -65,7 +65,7 @@ void test()
 
   DoFTools::extract_locally_relevant_dofs (dh,locally_relevant_dofs);
 
-  PETScWrappers::MPI::Vector solution(MPI_COMM_WORLD,locally_owned_dofs,locally_relevant_dofs);
+  PETScWrappers::MPI::Vector solution(locally_owned_dofs,locally_relevant_dofs, MPI_COMM_WORLD);
 
   parallel::distributed::SolutionTransfer<2,PETScWrappers::MPI::Vector> 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
index 745fc51bfffe8a665799fe02ab95e7e0cfab57a6..85947c3033e9e16cea2a707a865ff9d39e5b5c4e 100644 (file)
@@ -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);
   }
 
 
index 0fda23bc8565c644d6ab32a78b70f60b3f2523cd..fe4caddef58b8b84904d4740ba55a03a9e944748 100644 (file)
@@ -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 ();
index cf4de849e7cd9d9dc729f1b59ce78d256f54f5eb..07fb84bad593f71b6188eb691633bbdcee5b81fe 100644 (file)
@@ -53,7 +53,7 @@ void test()
     vec.block(0)(i) = i;
   for (unsigned int i=vec.block(1).local_range().first; i<vec.block(1).local_range().second; ++i)
     vec.block(1)(i) = i;
-  vec.compress();
+  vec.compress(VectorOperation::insert);
 
   // verify correctness so far
   {
@@ -112,8 +112,6 @@ void test()
   cm.distribute (vec);
 
   // verify correctness
-  vec.compress ();
-
   if (myid != 0)
     Assert (vec(vec.block(0).local_range().first+10) == vec.block(0).local_range().first-25,
            ExcInternalError());
index 956f0e26c9637faba50870e5d02bbf4935fb4ebd..a8c74d6e21a8244ad2f82336defe7a626b00b766 100644 (file)
@@ -43,7 +43,7 @@ void test()
   Assert (vec.local_range().second == 100*myid+100, ExcInternalError());
   for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
     vec(i) = i;
-  vec.compress();
+  vec.compress(VectorOperation::insert);
 
   // verify correctness so far
   {
@@ -94,8 +94,6 @@ void test()
   cm.distribute (vec);
 
   // verify correctness
-  vec.compress ();
-
   if (myid != 0)
     Assert (vec(vec.local_range().first+10) == vec.local_range().first-25+1,
            ExcInternalError());

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.