Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example to the documentation of GridTools::transform(). #15120

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 look 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