]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove coin flip
authorAlexander Grayver <agrayver@erdw.ethz.ch>
Mon, 11 Dec 2017 15:33:52 +0000 (16:33 +0100)
committerAlexander Grayver <agrayver@erdw.ethz.ch>
Mon, 11 Dec 2017 15:33:52 +0000 (16:33 +0100)
source/dofs/dof_tools.cc

index c115da2d8038d1a321ff51330bd2b066ae9d53ef..d58d735a825df50f027c22a29c1397e56977418c 100644 (file)
@@ -1459,10 +1459,6 @@ namespace DoFTools
     std::vector<types::global_dof_index> local_dof_indices;
     local_dof_indices.reserve (max_dofs_per_cell(dof_handler));
 
-    // pseudo-randomly assign variables which lie on the interface between
-    // subdomains to each of the two or more
-    bool coin_flip = true;
-
     // loop over all cells and record which subdomain a DoF belongs to.
     // toss a coin in case it is on an interface
     typename DoFHandlerType::active_cell_iterator
@@ -1476,18 +1472,16 @@ namespace DoFTools
         cell->get_dof_indices (local_dof_indices);
 
         // set subdomain ids. if dofs already have their values set then
-        // they must be on partition interfaces. in that case randomly
-        // assign them to either the previous association or the current
-        // one, where we take "random" to be "once this way once that way"
+        // they must be on partition interfaces. in that case assign them
+        // to either the previous association or the current processor
+        // with the smaller subdomain id.
         for (unsigned int i=0; i<dofs_per_cell; ++i)
           if (subdomain_association[local_dof_indices[i]] ==
               numbers::invalid_subdomain_id)
             subdomain_association[local_dof_indices[i]] = subdomain_id;
-          else
+          else if (subdomain_association[local_dof_indices[i]] > subdomain_id)
             {
-              if (coin_flip == true)
-                subdomain_association[local_dof_indices[i]] = subdomain_id;
-              coin_flip = !coin_flip;
+              subdomain_association[local_dof_indices[i]] = subdomain_id;
             }
       }
 

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.