]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a rather rare race condition in MT mode: we checked that we did
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 24 Aug 2001 13:34:09 +0000 (13:34 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 24 Aug 2001 13:34:09 +0000 (13:34 +0000)
not yet visit a face by looking at a value that is written when
visiting this face. We double checked later when writing into it. In
some rare conditions, it could happen that another process was working
on it, but only wrote between the two checks, making the latter fail.

git-svn-id: https://svn.dealii.org/trunk@4908 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 65f5602e626c3981cc4678e914d9c9f37e3de358..c9efeaa25d9c325c1cacff5ab1f6747a6a7b4734 100644 (file)
@@ -475,6 +475,26 @@ void KellyErrorEstimator<dim>::estimate_some (Data               &data,
                                       // loop over all faces of this cell
       for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
        {
+                                          // make sure we do work
+                                          // only once: this face
+                                          // may either be regular
+                                          // or irregular. if it is
+                                          // regular and has a
+                                          // neighbor, then we
+                                          // visit the face twice,
+                                          // once from every
+                                          // side. let the one with
+                                          // the lower index do the
+                                          // work. if it is at the
+                                          // boundary, or if the
+                                          // face is irregular,
+                                          // then do the work below
+         if ((cell->face(face_no)->has_children() == false) &&
+             !cell->at_boundary(face_no) &&
+             (cell->neighbor(face_no)->level() == cell->level()) &&
+             (cell->neighbor(face_no)->index() < cell->index()))
+           continue;
+         
                                           // if we already visited
                                           // this face: do
                                           // nothing. only check

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.