]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
update tests
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 17 Feb 2013 00:28:20 +0000 (00:28 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 17 Feb 2013 00:28:20 +0000 (00:28 +0000)
git-svn-id: https://svn.dealii.org/trunk@28430 0785d39b-7218-0410-832d-ea1e28bc413d

tests/mpi/constraint_matrix_condense_01.cc
tests/mpi/p4est_save_02.cc
tests/mpi/p4est_save_03.cc
tests/mpi/solution_transfer_01.cc
tests/mpi/step-40.cc
tests/mpi/step-40_direct_solver.cc

index 7a5b9219134dca059f1a36b92a5c5d2fffa799e2..eb97ba64edd84d803f1badff7308f751a3d3296f 100644 (file)
@@ -45,7 +45,9 @@ void test ()
   DoFTools::extract_locally_relevant_dofs (dof_handler,locally_relevant_dofs);
 
   PETScWrappers::MPI::Vector force;
-  force.reinit (mpi_communicator, locally_owned_dofs, locally_relevant_dofs);
+  force.reinit (mpi_communicator, locally_owned_dofs);
+  std::cout << force.has_ghost_elements() << std::endl;
+  
 
   ConstraintMatrix constraints (locally_relevant_dofs);
   constraints.clear();
@@ -68,8 +70,6 @@ void test ()
   }
   constraints.close();
 
-  force=0.;
-  force.compress();
   constraints.condense(force);
 }
 
index 937eddad20ebc3bb80dd2661f142f47c771bec85..f5402282543c3e6e0464f139b817cb3fcff7b534 100644 (file)
@@ -76,20 +76,21 @@ 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 x(MPI_COMM_WORLD,locally_owned_dofs);
+    PETScWrappers::MPI::Vector solution(MPI_COMM_WORLD,locally_owned_dofs, locally_relevant_dofs);
 
     parallel::distributed::SolutionTransfer<dim,PETScWrappers::MPI::Vector> soltrans(dh);
 
     for (unsigned int i=0;i<locally_owned_dofs.n_elements();++i)
       {
        unsigned int idx = locally_owned_dofs.nth_index_in_set(i);
-       solution(idx)=idx;
+       x(idx)=idx;
        
 //     std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
       }
 
-    solution.compress();
-    solution.update_ghost_values();
+    x.compress(VectorOperation::insert);
+    solution=x;
     
     soltrans.prepare_serialization (solution);
 
index dd097507670496915223cb380b3c7bf6aef9bbdc..d067324124d8c13c9393cc68b090a07ff4789794 100644 (file)
@@ -77,6 +77,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 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);
 
@@ -86,16 +88,17 @@ void test()
     for (unsigned int i = 0;i < locally_owned_dofs.n_elements();++i)
       {
         unsigned int idx = locally_owned_dofs.nth_index_in_set (i);
-        solution (idx) = idx;
-        solution2 (idx) = 2 * idx;
+        x (idx) = idx;
+        x2 (idx) = 2 * idx;
 
 //     std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
       }
 
-    solution.compress();
-    solution.update_ghost_values();
-    solution2.compress();
-    solution2.update_ghost_values();
+    x.compress(VectorOperation::insert);
+    solution=x;
+    x*=2.0;
+    solution2 = x;
+    
 
     soltrans.prepare_serialization (solution);
     soltrans2.prepare_serialization (solution2);
index 11dc9c337428bc1b438b682adc97599425d39b41..3336900e5f8e3866eb3d7958c7b08179b58fd8c1 100644 (file)
@@ -66,8 +66,6 @@ void test()
   DoFTools::extract_locally_relevant_dofs (dh,locally_relevant_dofs);
 
   PETScWrappers::MPI::Vector solution(MPI_COMM_WORLD,locally_owned_dofs,locally_relevant_dofs);
-  solution = 0;
-  solution.update_ghost_values();
 
   parallel::distributed::SolutionTransfer<2,PETScWrappers::MPI::Vector> soltrans(dh);
 
@@ -89,7 +87,6 @@ void test()
 
   solution.reinit(MPI_COMM_WORLD,locally_owned_dofs,locally_relevant_dofs);
   solution = tmp;
-  solution.update_ghost_values();
 
                                   // make sure no processor is
                                   // hanging
index 5a2a2b6715c4fe8e8559024b8faad2435c70dfc3..5bbf71aaaa05ef365f9065d98c450050d52085cb 100644 (file)
@@ -134,7 +134,6 @@ namespace Step40
     locally_relevant_solution.reinit (mpi_communicator,
                                       locally_owned_dofs,
                                       locally_relevant_dofs);
-    locally_relevant_solution = 0;
     system_rhs.reinit (mpi_communicator,
                        dof_handler.n_dofs(),
                        dof_handler.n_locally_owned_dofs());
@@ -261,7 +260,6 @@ namespace Step40
     constraints.distribute (completely_distributed_solution);
 
     locally_relevant_solution = completely_distributed_solution;
-    locally_relevant_solution.update_ghost_values();
   }
 
 
index f9d0d46c68cebb269a9412f7f3d0aeea26af88a1..1fd90be09ea625b4c1f3ccce3fb1fc676601b0e3 100644 (file)
@@ -134,7 +134,6 @@ namespace Step40
     locally_relevant_solution.reinit (mpi_communicator,
                                       locally_owned_dofs,
                                       locally_relevant_dofs);
-    locally_relevant_solution = 0;
     system_rhs.reinit (mpi_communicator,
                        dof_handler.n_dofs(),
                        dof_handler.n_locally_owned_dofs());
@@ -255,7 +254,6 @@ namespace Step40
     constraints.distribute (completely_distributed_solution);
 
     locally_relevant_solution = completely_distributed_solution;
-    locally_relevant_solution.update_ghost_values();
   }
 
 

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.