From 6bd4d8a1d16a60f05a847f4ae20862cb82fe29c5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 12 Aug 2019 18:17:22 -0600 Subject: [PATCH] Minor update to step-3. --- examples/step-3/doc/results.dox | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/step-3/doc/results.dox b/examples/step-3/doc/results.dox index f73bc56ae9..8318773512 100644 --- a/examples/step-3/doc/results.dox +++ b/examples/step-3/doc/results.dox @@ -125,21 +125,21 @@ suggestions: run the program. An alternative way to change the boundary indicator is to label - the boundaries by the cartesian coordinates of the face centers. + the boundaries based on the Cartesian coordinates of the face centers. For example, we can label all of the cells along the top and bottom boundaries with a boundary indicator 1 by checking to see if the cell centers' y-coordinates are within a tolerance (here 1e-12) of -1 and 1. Try this immediately after calling - GridGenerator::hyper_cube, as before: + GridGenerator::hyper_cube(), as before: @code for (const auto &cell : dof_handler.active_cell_iterators()) { for (unsigned int face_number = 0; face_number < GeometryInfo<2>::faces_per_cell; ++face_number) - if ((std::fabs(cell->face(face_number)->center()(1) - (-1)) < + if ((std::fabs(cell->face(face_number)->center()(1) - (-1.0)) < 1e-12) || - (std::fabs(cell->face(face_number)->center()(1) - (1)) < 1e-12)) + (std::fabs(cell->face(face_number)->center()(1) - (1.0)) < 1e-12)) cell->face(face_number)->set_boundary_id(1); } @code -- 2.39.5