From: David Wells Date: Sat, 24 Dec 2022 21:09:33 +0000 (-0500) Subject: isotropic refinement: clean up some more comments. X-Git-Tag: v9.5.0-rc1~707^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14614%2Fhead;p=dealii.git isotropic refinement: clean up some more comments. --- diff --git a/source/grid/tria.cc b/source/grid/tria.cc index a8426a7abb..7323bdb5d6 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -4223,21 +4223,24 @@ namespace internal if (cell->reference_cell() == ReferenceCells::Triangle) { - // add lines in the order implied by their orientation. + // add lines in the order implied by their orientation. Here, + // face_no is the cell (not subcell) face number and vertex_no is + // the first vertex on that face in the standard orientation. const auto ref = [&](const unsigned int face_no, const unsigned int vertex_no) { - if (cell->line(face_no)->child(0)->vertex_index(0) == - new_vertices[vertex_no] || - cell->line(face_no)->child(0)->vertex_index(1) == - new_vertices[vertex_no]) + auto l = cell->line(face_no); + // if the vertex is on the first child then add the first child + // first + if (l->child(0)->vertex_index(0) == new_vertices[vertex_no] || + l->child(0)->vertex_index(1) == new_vertices[vertex_no]) { - new_lines[2 * face_no + 0] = cell->line(face_no)->child(0); - new_lines[2 * face_no + 1] = cell->line(face_no)->child(1); + new_lines[2 * face_no + 0] = l->child(0); + new_lines[2 * face_no + 1] = l->child(1); } else { - new_lines[2 * face_no + 0] = cell->line(face_no)->child(1); - new_lines[2 * face_no + 1] = cell->line(face_no)->child(0); + new_lines[2 * face_no + 0] = l->child(1); + new_lines[2 * face_no + 1] = l->child(0); } }; @@ -4245,6 +4248,7 @@ namespace internal ref(1, 1); ref(2, 2); + // set up lines which do not have parents: new_lines[6]->set_bounding_object_indices( {new_vertices[3], new_vertices[4]}); new_lines[7]->set_bounding_object_indices(