From: Wolfgang Bangerth Date: Fri, 14 Oct 2016 10:28:19 +0000 (-0600) Subject: Make code in steps 1 and 2 more obvious. X-Git-Tag: v8.5.0-rc1~569^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2376459c797a6bd3258947a364b1e83bbdcd0e58;p=dealii.git Make code in steps 1 and 2 more obvious. In the current setup, steps-1 and 2 first set all manifold ids, and only then attach a manifold object. This invites the question what the triangulation would do in between. On the other hand, we can easily fix this by first attaching a manifold object to the triangulation for manifold_id zero, and only then set the manifold_ids of cells and faces to zero. --- diff --git a/examples/step-1/step-1.cc b/examples/step-1/step-1.cc index 42c437ba8b..f62701244e 100644 --- a/examples/step-1/step-1.cc +++ b/examples/step-1/step-1.cc @@ -135,9 +135,9 @@ void second_grid () // topic; if you're confused about what exactly is happening here, // you may want to look at the @ref GlossManifoldIndicator "glossary // entry on this topic".) - triangulation.set_all_manifold_ids(0); const SphericalManifold<2> manifold_description(center); triangulation.set_manifold (0, manifold_description); + triangulation.set_all_manifold_ids(0); // In order to demonstrate how to write a loop over all cells, we will // refine the grid in five steps towards the inner circle of the domain: diff --git a/examples/step-2/step-2.cc b/examples/step-2/step-2.cc index 9bd4d3661c..ea218ec9cb 100644 --- a/examples/step-2/step-2.cc +++ b/examples/step-2/step-2.cc @@ -88,8 +88,8 @@ void make_grid (Triangulation<2> &triangulation) 5 ); static const SphericalManifold<2> manifold_description(center); - triangulation.set_all_manifold_ids(0); triangulation.set_manifold (0, manifold_description); + triangulation.set_all_manifold_ids(0); for (unsigned int step=0; step<3; ++step) {