]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix comments in @code blocks in distributed headers 6882/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 4 Jul 2018 10:26:36 +0000 (12:26 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 4 Jul 2018 10:26:36 +0000 (12:26 +0200)
include/deal.II/distributed/shared_tria.h
include/deal.II/distributed/solution_transfer.h
include/deal.II/distributed/tria.h

index 88e99b4432ca8dfc09ecd61493761e653fe6b5e2..66af85cf51905a1f5c9c73d7cb5d61d350519961 100644 (file)
@@ -168,47 +168,44 @@ namespace parallel
          * triangulation whenever it is first created and passing the user
          * defined function through the signal using <code>std::bind</code>.
          * Here is an example:
-         *  @code
-         *     template <int dim>
-         *     void mypartition(parallel::shared::Triangulation<dim> &tria)
-         *     {
-         *       // user defined partitioning scheme: assign subdomain_ids
-         *       // round-robin in a mostly random way:
-         *       std::vector<unsigned int> assignment =
-         * {0,0,1,2,0,0,2,1,0,2,2,1,2,2,0,0}; typename
-         * Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
-         *         endc = tria.end();
-         *       unsigned int index = 0;
-         *       for (; cell != endc; ++cell, ++index)
-         *         cell->set_subdomain_id(assignment[index%16]);
-         *     }
+         * @code
+         * template <int dim>
+         * void mypartition(parallel::shared::Triangulation<dim> &tria)
+         * {
+         *   // user defined partitioning scheme: assign subdomain_ids
+         *   // round-robin in a mostly random way:
+         *   std::vector<unsigned int> assignment =
+         *     {0,0,1,2,0,0,2,1,0,2,2,1,2,2,0,0};
+         *   unsigned int index = 0;
+         *   for (const auto &cell : tria.active_cell_iterators())
+         *     cell->set_subdomain_id(assignment[(index++)%16]);
+         * }
          *
-         *     int main ()
-         *     {
-         *       parallel::shared::Triangulation<dim> tria(...,
-         *                                                 parallel::shared::Triangulation<dim>::Settings::partition_custom_signal);
-         *       tria.signals.post_refinement.connect
-         * (std::bind(&mypartition<dim>, std::ref(tria)));
-         *     }
-         *  @endcode
+         * int main ()
+         * {
+         *   parallel::shared::Triangulation<dim> tria(
+         *     ...,
+         *     parallel::shared::Triangulation<dim>::partition_custom_signal);
+         *   tria.signals.post_refinement.connect(std::bind(&mypartition<dim>,
+         *                                        std::ref(tria)));
+         * }
+         * @endcode
          *
          * An equivalent code using lambda functions would look like this:
-         *  @code
-         *     int main ()
+         * @code
+         * int main ()
+         * {
+         *   parallel::shared::Triangulation<dim> tria(
+         *     ...,
+         *     parallel::shared::Triangulation<dim>::partition_custom_signal);
+         *   tria.signals.post_refinement.connect (
+         *     [&tria]()
          *     {
-         *       parallel::shared::Triangulation<dim> tria(...,
-         *                                                 parallel::shared::Triangulation<dim>::Settings::partition_custom_signal);
-         *       tria.signals.post_refinement.connect ([&tria]()
-         *                                             {
-         *                                               // user defined
-         * partitioning scheme
-         *                                               // as above
-         *                                               ...
-         *                                             }
-         *                                            );
-         *     }
-         *  @endcode
-         *
+         *       // user defined partitioning scheme as above
+         *       ...
+         *     });
+         * }
+         * @endcode
          *
          * @note If you plan to use a custom partition with geometric multigrid,
          * you must manually partition the level cells in addition to the active
index e23d5c1413c81ab4e16386f82d11aaf026f764b2..2508af919623017c27210b267fd532c959ab85dc 100644 (file)
@@ -55,25 +55,28 @@ namespace parallel
      * TrilinosWrappers::MPI::Vector, or corresponding blockvectors.
      * @code
      * SolutionTransfer<dim, VectorType> soltrans(dof_handler);
-     *                                   // flag some cells for refinement
-     *                                   // and coarsening, e.g.
-     * GridRefinement::refine_and_coarsen_fixed_fraction(
-     * tria, error_indicators, 0.3, 0.05);
-     *                                   // prepare the triangulation,
+     * // flag some cells for refinement and coarsening, e.g.
+     * GridRefinement::refine_and_coarsen_fixed_fraction(tria,
+     *                                                   error_indicators,
+     *                                                   0.3,
+     *                                                   0.05);
+     *
+     * // prepare the triangulation,
      * tria.prepare_coarsening_and_refinement();
-     *                                   // prepare the SolutionTransfer object
-     *                                   // for coarsening and refinement and
-     * give
-     *                                   // the solution vector that we intend
-     * to
-     *                                   // interpolate later,
+     *
+     * // prepare the SolutionTransfer object for coarsening and refinement
+     * // and give the solution vector that we intend to interpolate later,
      * soltrans.prepare_for_coarsening_and_refinement(solution);
-     *                                   // actually execute the refinement,
+     *
+     * // actually execute the refinement,
      * tria.execute_coarsening_and_refinement ();
-     *                                   // redistribute dofs,
+     *
+     * // redistribute dofs,
      * dof_handler.distribute_dofs (fe);
-     *                                   // and interpolate the solution
+     *
+     * // and interpolate the solution
      * VectorType interpolated_solution;
+     *
      * //create VectorType in the right size here
      * soltrans.interpolate(interpolated_solution);
      * @endcode
@@ -96,10 +99,10 @@ namespace parallel
      *
      * If vector has the locally relevant DoFs, serialization works as
      * follows:
-     * *@code
-     *
+     * @code
      * parallel::distributed::SolutionTransfer<dim,VectorType>
-     * sol_trans(dof_handler); sol_trans.prepare_serialization (vector);
+     *   sol_trans(dof_handler);
+     * sol_trans.prepare_serialization (vector);
      *
      * triangulation.save(filename);
      * @endcode
@@ -110,7 +113,8 @@ namespace parallel
      * triangulation.load(filename);
      *
      * parallel::distributed::SolutionTransfer<dim,VectorType>
-     * sol_trans(dof_handler); sol_trans.deserialize (distributed_vector);
+     *   sol_trans(dof_handler);
+     * sol_trans.deserialize (distributed_vector);
      * @endcode
      *
      *
index 0c20b18eef99cb1ab8aed50e4478594eff8e666d..0bbe14037f9ff178ff1a12751aafd222190cb3e1 100644 (file)
@@ -159,28 +159,25 @@ namespace parallel
      * information into the function. C++ provides a nice mechanism for this
      * that is best explained using an example:
      * @code
-     *     #include <functional>
+     * #include <functional>
      *
-     *     template <int dim>
-     *     void set_boundary_ids (parallel::distributed::Triangulation<dim>
-     * &triangulation)
-     *     {
-     *       ... set boundary indicators on the triangulation object ...
-     *     }
+     * template <int dim>
+     * void set_boundary_ids (
+     *   parallel::distributed::Triangulation<dim> &triangulation)
+     * {
+     *   ... set boundary indicators on the triangulation object ...
+     * }
      *
-     *     template <int dim>
-     *     void
-     *     MyClass<dim>::
-     *     create_coarse_mesh (parallel::distributed::Triangulation<dim>
-     * &coarse_grid) const
-     *     {
-     *       ... create the coarse mesh ...
+     * template <int dim>
+     * void
+     * MyClass<dim>::create_coarse_mesh (
+     *   parallel::distributed::Triangulation<dim> &coarse_grid) const
+     * {
+     *   ... create the coarse mesh ...
      *
-     *       coarse_grid.signals.post_refinement.connect
-     *         (std::bind (&set_boundary_ids<dim>,
-     *                     std::ref(coarse_grid)));
-     *
-     *     }
+     *   coarse_grid.signals.post_refinement.connect(
+     *     std::bind (&set_boundary_ids<dim>, std::ref(coarse_grid)));
+     * }
      * @endcode
      *
      * What the call to <code>std::bind</code> does is to produce an
@@ -201,30 +198,28 @@ namespace parallel
      * static, but possibly private) member function of the
      * <code>MyClass</code> class, then the following will work:
      * @code
-     *     #include <functional>
+     * #include <functional>
      *
-     *     template <int dim>
-     *     void
-     *     MyClass<dim>::
-     *     set_boundary_ids (parallel::distributed::Triangulation<dim>
-     * &triangulation) const
-     *     {
-     *       ... set boundary indicators on the triangulation object ...
-     *     }
+     * template <int dim>
+     * void
+     * MyClass<dim>::set_boundary_ids (
+     *   parallel::distributed::Triangulation<dim> &triangulation) const
+     * {
+     *   ... set boundary indicators on the triangulation object ...
+     * }
      *
-     *     template <int dim>
-     *     void
-     *     MyClass<dim>::
-     *     create_coarse_mesh (parallel::distributed::Triangulation<dim>
-     * &coarse_grid) const
-     *     {
-     *       ... create the coarse mesh ...
+     * template <int dim>
+     * void
+     * MyClass<dim>::create_coarse_mesh (
+     *   parallel::distributed::Triangulation<dim> &coarse_grid) const
+     * {
+     *   ... create the coarse mesh ...
      *
-     *       coarse_grid.signals.post_refinement.connect
-     *         (std::bind (&MyGeometry<dim>::set_boundary_ids,
-     *                     std::cref(*this),
-     *                     std::ref(coarse_grid)));
-     *     }
+     *   coarse_grid.signals.post_refinement.connect(
+     *     std::bind (&MyGeometry<dim>::set_boundary_ids,
+     *                std::cref(*this),
+     *                std::ref(coarse_grid)));
+     * }
      * @endcode
      * Here, like any other member function, <code>set_boundary_ids</code>
      * implicitly takes a pointer or reference to the object it belongs to as

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.