From 5ae27b2b2130f8335b0cab775219a17b96b03d1f Mon Sep 17 00:00:00 2001 From: Jiaxin Wang Date: Wed, 19 Sep 2018 10:49:05 +0200 Subject: [PATCH] slight modification of step-30 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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/step-30/step-30.cc b/examples/step-30/step-30.cc index b67f895e65..4e1b19f6aa 100644 --- a/examples/step-30/step-30.cc +++ b/examples/step-30/step-30.cc @@ -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 -- 2.39.5