* 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
* 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
*
* 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
* 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
*
*
* 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
* 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