]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Try to fix some tests by adding more elements to sparsity pattern over processor...
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 19 Jan 2014 22:06:41 +0000 (22:06 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 19 Jan 2014 22:06:41 +0000 (22:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@32258 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/dofs/dof_tools_sparsity.cc
deal.II/source/multigrid/mg_tools.cc

index 917e6d000ada5fb14eeb98bcf90bdec4657cc6f6..bc26fd13cdd1f10406b03a80c336595025abe02b 100644 (file)
@@ -584,6 +584,12 @@ namespace DoFTools
                           constraints.add_entries_local_to_global
                           (dofs_on_other_cell, dofs_on_this_cell,
                            sparsity, keep_constrained_dofs);
+                          // only need to add this when the neighbor is not
+                          // owned by the current processor, otherwise we add
+                          // the entries for the neighbor there
+                          if (sub_neighbor->subdomain_id() != cell->subdomain_id())
+                            constraints.add_entries_local_to_global
+                            (dofs_on_other_cell, sparsity, keep_constrained_dofs);
                         }
                     }
                   else
@@ -619,10 +625,10 @@ namespace DoFTools
                           constraints.add_entries_local_to_global
                             (dofs_on_other_cell, dofs_on_this_cell,
                              sparsity, keep_constrained_dofs);
-                          if (cell->neighbor(face)->active())
+                          if (cell->neighbor(face)->subdomain_id() !=
+                              cell->subdomain_id())
                             constraints.add_entries_local_to_global
-                              (dofs_on_other_cell, dofs_on_other_cell,
-                               sparsity, keep_constrained_dofs);
+                            (dofs_on_other_cell, sparsity, keep_constrained_dofs);
                         }
                     }
                 }
index 65c253e033b0598a97afc77f8055b13fd26f55bf..62589b793f103839a6a23a5f20673443de06bbc9 100644 (file)
@@ -611,9 +611,9 @@ namespace MGTools
                 typename DoFHandler<dim,spacedim>::cell_iterator
                 neighbor = cell->neighbor(face);
                 neighbor->get_mg_dof_indices (dofs_on_other_cell);
-                // only add one direction
-                // The other is taken care of
-                // by neighbor.
+                // only add one direction The other is taken care of by
+                // neighbor (except when the neighbor is not owned by the same
+                // processor)
                 for (unsigned int i=0; i<dofs_per_cell; ++i)
                   {
                     for (unsigned int j=0; j<dofs_per_cell; ++j)
@@ -622,6 +622,15 @@ namespace MGTools
                                       dofs_on_other_cell[j]);
                       }
                   }
+                if (neighbor->is_locally_owned_on_level() == false)
+                  for (unsigned int i=0; i<dofs_per_cell; ++i)
+                    for (unsigned int j=0; j<dofs_per_cell; ++j)
+                      {
+                        sparsity.add (dofs_on_other_cell[i],
+                                      dofs_on_other_cell[j]);
+                        sparsity.add (dofs_on_other_cell[i],
+                                      dofs_on_this_cell[j]);
+                      }
               }
           }
       }

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.