]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a slight bug when there are too few cells. Add a comment.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Aug 2000 12:34:16 +0000 (12:34 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Aug 2000 12:34:16 +0000 (12:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@3251 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/error_estimator.cc

index d39948dfc378f83cfd484e2d6a6c449fd2a1b906..7ec6b19cbc8cbc181628156985f333f746ffea99 100644 (file)
@@ -333,14 +333,27 @@ void KellyErrorEstimator<dim>::estimate_some (Data               &data,
 
   DoFHandler<dim>::active_cell_iterator cell=data.dof.begin_active();
 
-                                  // calculate the start cell for this
-                                  // thread. the enumeration is choosen
-                                  // in this strange way to generate a
-                                  // "random" distribution of the cells.
-                                  // if the sequence of the iterator would
-                                  // be used, the threads would take widely
-                                  // spread times to calculate their cells.
-  for (unsigned int t=0;t<this_thread;++t,++cell);
+                                  // calculate the start cell for
+                                  // this thread. note that this way
+                                  // the threads work interleaved on
+                                  // successive cells, rather than on
+                                  // blocks of cells. the reason is
+                                  // that it takes vastly more time
+                                  // to work on cells with hanging
+                                  // nodes than on regular cells, but
+                                  // such cells are not evenly
+                                  // distributed across the range of
+                                  // cell iterators, so in order to
+                                  // have the different threads do
+                                  // approximately the same amount of
+                                  // work, we have to let them work
+                                  // interleaved to the effect of a
+                                  // pseudorandom distribution of the
+                                  // `hard' cells to the different
+                                  // threads.
+  for (unsigned int t=0; (t<this_thread) && (cell!=data.endc); ++t, ++cell);
+
+  
                                   // loop over all cells for this thread
                                   // the iteration of cell is done at the end
   for (; cell!=data.endc; )

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.