From: Wolfgang Bangerth Date: Wed, 16 Aug 2017 03:20:35 +0000 (-0600) Subject: Update documentation. X-Git-Tag: v9.0.0-rc1~1233^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4869%2Fhead;p=dealii.git Update documentation. --- diff --git a/include/deal.II/distributed/grid_tools.h b/include/deal.II/distributed/grid_tools.h index fee6417626..1b1e61fcc6 100644 --- a/include/deal.II/distributed/grid_tools.h +++ b/include/deal.II/distributed/grid_tools.h @@ -79,6 +79,39 @@ namespace parallel * on the sending side returned a non-empty boost::optional object. * The @p unpack function is then called with the data sent by the * processor that owns that cell. + * + * + *

An example

+ * + * Here is an example that shows how this function is to be used + * in a concrete context. It is taken from the code that makes + * sure that the @p active_fe_index (a single unsigned integer) is + * transported from locally owned cells where one can set it in + * hp::DoFHandler objects, to the corresponding ghost cells on + * other processors to ensure that one can query the right value + * also on those processors: + * @code + * auto pack + * = [] (const typename dealii::hp::DoFHandler::active_cell_iterator &cell) -> unsigned int + * { + * return cell->active_fe_index(); + * }; + * + * auto unpack + * = [] (const typename dealii::hp::DoFHandler::active_cell_iterator &cell, + * const unsigned int &active_fe_index) -> void + * { + * cell->set_active_fe_index(active_fe_index); + * }; + * + * parallel::GridTools::exchange_cell_data_to_ghosts> + * (dof_handler, pack, unpack); + * @endcode + * + * You will notice that the lambda function returns an `unsigned int`, + * not a `boost::optional`. The former converts automatically + * to the latter, implying that data will always be transported to the + * other processor. */ template void