Skip to content

Commit

Permalink
Add an example to the documentation of GridTools::transform().
Browse files Browse the repository at this point in the history
  • Loading branch information
bangerth committed Apr 20, 2023
1 parent 2691e9c commit 7d597ea
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion include/deal.II/grid/grid_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,22 @@ namespace GridTools
* predicate is either an object of a type that has an <tt>operator()</tt>,
* or it is a pointer to a non-member function, or it is a lambda function
* object. In either case, argument and return
* value have to be of type Point<spacedim>.
* value have to be of type Point<spacedim>. An example -- a simple
* transformation that moves the object two units to the
* right in the $x_1$ direction -- could like as follows:
* @code
* Triangulation<dim> triangulation;
* ... // fill triangulation with something
* GridTools::transform ([](const Point<dim> &p) -> Point<dim>
* {
* Point<dim> q = p;
* q[0] += 2;
* return q;
* },
* triangulation);
* @endcode
* Here, the transformation is provided by a lambda function that
* takes a `Point<dim>` as input and returns a `Point<dim>` as output.
*
* @note The transformations that make sense to use with this function
* should have a Jacobian with a positive determinant. For example,
Expand Down

0 comments on commit 7d597ea

Please sign in to comment.