]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Documentation: Simplify example code for boundary_id and manifold_id 9379/head
authorKrishnakumar Gopalakrishnan <krishna.kumar@ucl.ac.uk>
Fri, 17 Jan 2020 18:30:22 +0000 (18:30 +0000)
committerMatthias Maier <tamiko@43-1.org>
Thu, 6 Feb 2020 19:43:22 +0000 (13:43 -0600)
This commit simplifies and modernizes a code snippet in the glossary
entries of boundary_id and manifold_id

In reference to #9320

doc/doxygen/headers/glossary.h

index 8c6d886b45caab4a9f6875340db2b8f0187306da..631b410fb6be9be33f7013caba6379079bc7f04d 100644 (file)
  * this, here setting the boundary indicator to 42 for all faces located at
  * $x=-1$:
  * @code
- *   for (typename Triangulation<dim>::active_cell_iterator
- *          cell = triangulation.begin_active();
- *        cell != triangulation.end();
- *        ++cell)
- *     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- *       if (cell->face(f)->at_boundary())
- *         if (cell->face(f)->center()[0] == -1)
- *           cell->face(f)->set_boundary_id (42);
+ *   for (auto &face : triangulation.active_face_iterators())
+ *     if (face->at_boundary())
+ *       if (face->center()[0] == -1)
+ *         face->set_boundary_id (42);
  * @endcode
  * This calls functions TriaAccessor::set_boundary_id. In 3d, it may
  * also be appropriate to call TriaAccessor::set_all_boundary_ids instead
  * center has an $x$ component less than zero:
  *
  * @code
- * for (typename Triangulation<dim>::active_cell_iterator cell =
- *  triangulation.begin_active();
- *  cell != triangulation.end(); ++cell)
+ * for (auto &cell : triangulation.active_cell_iterators())
  *   if (cell->center()[0] < 0)
  *     cell->set_manifold_id (42);
  * @endcode

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.