From: Wolfgang Bangerth Date: Thu, 20 Apr 2023 20:05:16 +0000 (-0600) Subject: Add an example to the documentation of GridTools::transform(). X-Git-Tag: v9.5.0-rc1~304^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15120%2Fhead;p=dealii.git Add an example to the documentation of GridTools::transform(). --- diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index c7b259c226..7bf25de6f9 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -555,7 +555,22 @@ namespace GridTools * predicate is either an object of a type that has an operator(), * 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. + * value have to be of type Point. An example -- a simple + * transformation that moves the object two units to the + * right in the $x_1$ direction -- could look like as follows: + * @code + * Triangulation triangulation; + * ... // fill triangulation with something + * GridTools::transform ([](const Point &p) -> Point + * { + * Point q = p; + * q[0] += 2; + * return q; + * }, + * triangulation); + * @endcode + * Here, the transformation is provided by a lambda function that + * takes a `Point` as input and returns a `Point` as output. * * @note The transformations that make sense to use with this function * should have a Jacobian with a positive determinant. For example,