]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make code in steps 1 and 2 more obvious. 3244/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 14 Oct 2016 10:28:19 +0000 (04:28 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 14 Oct 2016 10:28:19 +0000 (04:28 -0600)
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.

examples/step-1/step-1.cc
examples/step-2/step-2.cc

index 42c437ba8b2ba7e5759a769ca96d714d09c51248..f62701244e159a3b24ff9e49fd18bfc29f4fdea6 100644 (file)
@@ -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:
index 9bd4d3661c7b6fc9ca65130678cae8b5a8083f3d..ea218ec9cb33c4d2ccc0b6f1acc48528ec2cbd03 100644 (file)
@@ -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)
     {

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.