]> https://gitweb.dealii.org/ - dealii.git/commitdiff
slight modification of step-30
authorJiaxin Wang <jxw.sissa@gmail.com>
Wed, 19 Sep 2018 08:49:05 +0000 (10:49 +0200)
committerGitHub <noreply@github.com>
Wed, 19 Sep 2018 08:49:05 +0000 (10:49 +0200)
The active cell selection rule doesn't work in 1D problems,
but works by a slight modification.
The point is, in a 1D problem, there are no actual sub-surfaces, a surface can not see
any refined neighbor surfaces.
The old selection rule would easily choose a non-active neighbor, but the new rule can avoid it.

examples/step-30/step-30.cc

index b67f895e65317c3742f063eb9dd5083f1ff5faff..4e1b19f6aac0547aa8f83db84bdc15a9d9517640 100644 (file)
@@ -568,13 +568,13 @@ namespace Step30
                     // situation of our cell and the neighbor we want to treat
                     // only one half, so that each face is considered only
                     // once. Thus we have the additional condition, that the
-                    // cell with the lower index does the work. In the rare
-                    // case that both cells have the same index, the cell with
-                    // lower level is selected.
+                    // cell with the higher level does the work. In the rare
+                    // case that both cells have the same level, the cell with
+                    // lower index is selected.
                     if (!cell->neighbor_is_coarser(face_no) &&
-                        (neighbor->index() > cell->index() ||
-                         (neighbor->level() < cell->level() &&
-                          neighbor->index() == cell->index())))
+                        (neighbor->level() < cell->level() ||
+                         (neighbor->index() > cell->index() &&
+                          neighbor->level() == cell->level())))
                       {
                         // Here we know, that the neighbor is not coarser so we
                         // can use the usual @p neighbor_of_neighbor

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.