]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix test
authorTimo Heister <timo.heister@gmail.com>
Thu, 1 Aug 2013 19:31:36 +0000 (19:31 +0000)
committerTimo Heister <timo.heister@gmail.com>
Thu, 1 Aug 2013 19:31:36 +0000 (19:31 +0000)
git-svn-id: https://svn.dealii.org/trunk@30205 0785d39b-7218-0410-832d-ea1e28bc413d

tests/mpi/distribute_sp_02.cc

index 6c1f92138aab82b1555c09f9c8a0f2cc66d21f49..86669bd569f521c782f7c16062af5a24f3447cb5 100644 (file)
@@ -42,9 +42,9 @@ void test_mpi()
 
   unsigned int num_local=10;
   unsigned int n=numprocs*num_local;
-  std::vector<types::global_dof_index> rows_per_cpu;
+  std::vector<IndexSet> locally_owned_dofs_per_cpu(numprocs, IndexSet(n));
   for (unsigned int i=0; i<numprocs; ++i)
-    rows_per_cpu.push_back(num_local);
+    locally_owned_dofs_per_cpu[i].add_range((i)*num_local, (i+1)*num_local);
 
   IndexSet locally_rel(n);
   locally_rel.add_range(myid*num_local, (myid+1)*num_local);
@@ -68,7 +68,7 @@ void test_mpi()
     }
 
   SparsityTools::distribute_sparsity_pattern<>(csp,
-                                               rows_per_cpu,
+                                               locally_owned_dofs_per_cpu,
                                                MPI_COMM_WORLD,
                                                locally_rel);
   /*  {
@@ -96,6 +96,8 @@ void test_mpi()
         Assert(csp.exists(indx, myid+1), ExcInternalError());
     }
 
+
+  //now a 2x2 block system where the 2,2 block has size 1x1:
   if (myid==0)
     deallog << "part 2" << std::endl;
 
@@ -104,13 +106,18 @@ void test_mpi()
     bla.add_index(0);
 
   partitioning.push_back(bla);
-
+  
   csp.reinit(partitioning);
   for (unsigned int i=0; i<n; ++i)
     csp.add(i, myid);
 
+  std::vector<IndexSet> locally_owned_dofs_per_cpu2(numprocs, IndexSet(n));
+  for (unsigned int i=0; i<numprocs; ++i)
+    locally_owned_dofs_per_cpu2[i].add_range((i)*num_local, (i+1)*num_local);
+
+  
   SparsityTools::distribute_sparsity_pattern<>(csp,
-                                               rows_per_cpu,
+                                               locally_owned_dofs_per_cpu2,
                                                MPI_COMM_WORLD,
                                                locally_rel);
 

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.