Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
<tt>compose</tt>

n-ary function application in expressions

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 and integrate 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 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