---
name: "compose"
section: "3rheolef"
platform: "linux"
package: "librheolef-dev"
version: "7.2-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/compose/3rheolef"
---

# compose(3rheolef)

n-ary function application in expressions (rheolef-7.2)

## NAME

compose - n-ary function application in expressions (rheolef-7.2)

## SYNOPSIS

```
template <class Function, class... Expressions>
Expression compose (const Function& f, const Expressions&... exprs);
```

## DESCRIPTION

Compose a n-ary function f with n fields in **interpolate(3)** and **integrate(3)** nonlinear expressions.

## EXAMPLE

The `compose` operator is used for applying a user-provided function to a field:

```
    Float f (Float u) { return 1/u + sqrt(u); }
    ...
    field vh = interpolate (Xh, compose(f, uh));
```

 When two arguments are involved:

```
    Float g (Float u, Float v) { return v/u + sqrt(u*v); }
    ...
    field wh = interpolate (Xh, compose(g, uh, vh));
```

 The `compose` operator supports general n-ary functions and class-functions.

## CHARACTERISTIC

The `compose` function supports also the method of **characteristic(2)** used e.g. for convection-diffusion problems:

```
    characteristic X (-delta_t*uh);
    test v (Xh);
    field lh = integrate (compose(uh,X)*v);
```

## IMPLEMENTATION

This documentation has been generated from file main/lib/compose.h

## AUTHOR

Pierre  Saramito  \<Pierre.Saramito@imag.fr\>

## COPYRIGHT

Copyright   (C)  2000-2018  Pierre  Saramito  \<Pierre.Saramito@imag.fr\> GPLv3+: GNU GPL version 3 or later  \<http://gnu.org/licenses/gpl.html\>. This  is  free  software:  you  are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
