]> https://gitweb.dealii.org/ - dealii.git/commitdiff
and some more MG bugs from yesterday
authorTimo Heister <timo.heister@gmail.com>
Sat, 25 May 2013 08:48:01 +0000 (08:48 +0000)
committerTimo Heister <timo.heister@gmail.com>
Sat, 25 May 2013 08:48:01 +0000 (08:48 +0000)
git-svn-id: https://svn.dealii.org/trunk@29587 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/multigrid/mg_tools.cc
deal.II/source/multigrid/mg_transfer_prebuilt.cc

index f92d2caa2df168a99832c3df53872990f489c157..49660106cee0f838f0e316720a11d17b35064fd3 100644 (file)
@@ -1202,8 +1202,8 @@ namespace MGTools
         endc = dof.end();
         for (; cell!=endc; ++cell)
           {
-            if (cell->level_subdomain_id()!=dof.get_tria().locally_owned_subdomain()
-                && dof.get_tria().locally_owned_subdomain()!=numbers::invalid_subdomain_id)
+            if (dof.get_tria().locally_owned_subdomain()!=numbers::invalid_subdomain_id
+                && cell->level_subdomain_id()!=dof.get_tria().locally_owned_subdomain())
               continue;
             const FiniteElement<dim> &fe = cell->get_fe();
             const unsigned int level = cell->level();
@@ -1236,8 +1236,8 @@ namespace MGTools
         cell = dof.begin(),
         endc = dof.end();
         for (; cell!=endc; ++cell)
-          if (cell->level_subdomain_id()==dof.get_tria().locally_owned_subdomain()
-              || dof.get_tria().locally_owned_subdomain()==numbers::invalid_subdomain_id)
+          if (dof.get_tria().locally_owned_subdomain()==numbers::invalid_subdomain_id
+              || cell->level_subdomain_id()==dof.get_tria().locally_owned_subdomain())
           for (unsigned int face_no = 0; face_no < GeometryInfo<dim>::faces_per_cell;
                ++face_no)
             {
@@ -1436,8 +1436,8 @@ namespace MGTools
 
     for (; cell!=endc; ++cell)
       {
-        if (cell->level_subdomain_id()!=mg_dof_handler.get_tria().locally_owned_subdomain()
-          && mg_dof_handler.get_tria().locally_owned_subdomain()!=numbers::invalid_subdomain_id)
+        if (mg_dof_handler.get_tria().locally_owned_subdomain()!=numbers::invalid_subdomain_id
+            && cell->level_subdomain_id()!=mg_dof_handler.get_tria().locally_owned_subdomain())
           continue;
 
         std::fill (cell_dofs.begin(), cell_dofs.end(), false);
@@ -1494,8 +1494,8 @@ namespace MGTools
 
     for (; cell!=endc; ++cell)
       {
-        if (cell->level_subdomain_id()!=mg_dof_handler.get_tria().locally_owned_subdomain()
-            && mg_dof_handler.get_tria().locally_owned_subdomain()!=numbers::invalid_subdomain_id)
+        if (mg_dof_handler.get_tria().locally_owned_subdomain()!=numbers::invalid_subdomain_id
+            && cell->level_subdomain_id()!=mg_dof_handler.get_tria().locally_owned_subdomain())
           continue;
 
         std::fill (cell_dofs.begin(), cell_dofs.end(), false);
@@ -1585,8 +1585,8 @@ namespace MGTools
 
     for (; cell!=endc; ++cell)
       {
-        if (cell->level_subdomain_id()!=mg_dof_handler.get_tria().locally_owned_subdomain()
-        && mg_dof_handler.get_tria().locally_owned_subdomain()!=numbers::invalid_subdomain_id)
+        if (mg_dof_handler.get_tria().locally_owned_subdomain()!=numbers::invalid_subdomain_id
+            && cell->level_subdomain_id()!=mg_dof_handler.get_tria().locally_owned_subdomain())
           continue;
 
         bool has_coarser_neighbor = false;
index 1ae25aab42311219325ac47359ad99a6db20a6f4..754fc2158502b16e415fb37710dce283d7e52a87 100644 (file)
@@ -142,7 +142,10 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
       std::vector<unsigned int> entries (dofs_per_cell);
       for (typename DoFHandler<dim,spacedim>::cell_iterator cell=mg_dof.begin(level);
            cell != mg_dof.end(level); ++cell)
-        if (cell->has_children() && cell->level_subdomain_id()==mg_dof.get_tria().locally_owned_subdomain())
+        if (cell->has_children() &&
+            ( mg_dof.get_tria().locally_owned_subdomain()==numbers::invalid_subdomain_id
+                || cell->level_subdomain_id()==mg_dof.get_tria().locally_owned_subdomain()
+                ))
           {
             cell->get_mg_dof_indices (dof_indices_parent);
 
@@ -186,7 +189,10 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
       // now actually build the matrices
       for (typename DoFHandler<dim,spacedim>::cell_iterator cell=mg_dof.begin(level);
            cell != mg_dof.end(level); ++cell)
-        if (cell->has_children() && cell->level_subdomain_id()==mg_dof.get_tria().locally_owned_subdomain())
+        if (cell->has_children() &&
+            (mg_dof.get_tria().locally_owned_subdomain()==numbers::invalid_subdomain_id
+             || cell->level_subdomain_id()==mg_dof.get_tria().locally_owned_subdomain())
+             )
           {
             cell->get_mg_dof_indices (dof_indices_parent);
 
@@ -286,7 +292,8 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
       // by restricting from fine level.
       for (; level_cell!=level_end; ++level_cell)
         {
-          if (level_cell->level_subdomain_id()!=mg_dof.get_tria().locally_owned_subdomain())
+          if (mg_dof.get_tria().locally_owned_subdomain()!=numbers::invalid_subdomain_id
+              &&  level_cell->level_subdomain_id()!=mg_dof.get_tria().locally_owned_subdomain())
             continue;
 
           // get the dof numbers of

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.