]> https://gitweb.dealii.org/ - dealii.git/commitdiff
debug tests
authorTimo Heister <timo.heister@gmail.com>
Thu, 17 Jul 2014 11:47:13 +0000 (13:47 +0200)
committerTimo Heister <timo.heister@gmail.com>
Thu, 31 Jul 2014 06:20:18 +0000 (08:20 +0200)
include/deal.II/multigrid/mg_transfer.templates.h
source/multigrid/mg_transfer_prebuilt.cc

index 59e3cde2c1e5cdfe68c00cca169765486cd67f1b..2fdb4c3d9b0d2424fef19039e527f401d3fc4f7a 100644 (file)
@@ -156,6 +156,8 @@ MGTransferPrebuilt<VECTOR>::copy_to_mg (
 {
   reinit_vector(mg_dof_handler, component_to_block_map, dst);
   bool first = true;
+  //deallog << "copy_to_mg src " << src.l2_norm() << std::endl;
+  //MPI_Barrier(MPI_COMM_WORLD);
   for (unsigned int level=mg_dof_handler.get_tria().n_global_levels(); level != 0;)
     {
       --level;
@@ -164,16 +166,31 @@ MGTransferPrebuilt<VECTOR>::copy_to_mg (
       typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
       for (IT i= copy_indices[level].begin();
            i != copy_indices[level].end(); ++i)
-        dst_level(i->second) = src(i->first);
+        {
+          dst_level(i->second) = src(i->first);
+        //if (i->first == 446)
+        //std::cout << "L" << level << " " << i->first << " -> " << i->second << ": " << src(i->first) << std::endl;
 
-      // for (IT i= copy_indices_to_me[level].begin();
-      //      i != copy_indices_to_me[level].end(); ++i)
-      //   dst_level(i->second) = src(i->first);
+        }
+
+       for (IT i= copy_indices_to_me[level].begin();
+            i != copy_indices_to_me[level].end(); ++i)
+         {
+           dst_level(i->second) = src(i->first);
+           //if (i->first == 446)
+             //std::cout << "L" << level << " " << i->first << " --> " << i->second << ": " << src(i->first) << std::endl;
+         }
 
       dst_level.compress(VectorOperation::insert);
+      //MPI_Barrier(MPI_COMM_WORLD);
+      //deallog << "copy_to_mg dst " << level << " " << dst_level.l2_norm() << std::endl;
 
       if (!first)
-        restrict_and_add (level+1, dst[level], dst[level+1]);
+        {
+          restrict_and_add (level+1, dst[level], dst[level+1]);
+          //deallog << "copy_to_mg restr&add " << level << " " << dst_level.l2_norm() << std::endl;
+
+        }
 
       first = false;
     }
@@ -201,6 +218,9 @@ MGTransferPrebuilt<VECTOR>::copy_from_mg(
     {
       typedef std::vector<std::pair<types::global_dof_index, unsigned int> >::const_iterator IT;
 
+      //deallog << "copy_from_mg src " << level << " " << src[level].l2_norm() << std::endl;
+
+
       // First copy all indices local to this process
       if (constraints==0)
         for (IT i= copy_indices[level].begin();
@@ -222,6 +242,11 @@ MGTransferPrebuilt<VECTOR>::copy_from_mg(
              i != copy_indices_from_me[level].end(); ++i)
           constraints->distribute_local_to_global(i->first, src[level](i->second), dst);
     }
+  if (constraints == 0)
+    dst.compress(VectorOperation::insert);
+  else
+    dst.compress(VectorOperation::add);
+  //deallog << "copy_from_mg " << dst.l2_norm() << std::endl;
 }
 
 
@@ -264,6 +289,7 @@ MGTransferPrebuilt<VECTOR>::copy_from_mg_add (
              i != copy_indices_from_me[level].end(); ++i)
           constraints->distribute_local_to_global(i->first, src[level](i->second), dst);
     }
+  dst.compress(VectorOperation::add);
 }
 
 
index f19388ce34a73862a154cbc6bd3602c0c111f37b..18e771e7a4ee48a75e91706ba8bc21fab268a37d 100644 (file)
@@ -324,8 +324,8 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
               else if (global_mine)
                 copy_indices_to_me[level].push_back(
                   std::pair<unsigned int, unsigned int> (global_dof_indices[i], level_dof_indices[i]));
-              else
-                continue;
+//              else
+//                continue;
 
               dof_touched[global_idx] = true;
             }

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.