integrate(4rheolef)

integrate4rheolef

Integrate a function or an expression

Usage

 Float integrate (geo domain);
 Float integrate (geo domain, quadrature_option qopt);
 Value integrate (geo domain, Expression, quadrature_option qopt);

field integrate (Expression);
field integrate (Expression, quadrature_option qopt);
field integrate (geo domain, Expression);
field integrate (geo domain, Expression, quadrature_option qopt);

form integrate (Expression);
form integrate (Expression, integrate_option qopt);
form integrate (geo domain, Expression);
form integrate (geo domain, Expression, integrate_option qopt);

Overview

Integrate an expression over a domain by using a quadrature formulae. There are three main usages of the integrate function, depending upon the type of the expression. (i) When the expression is a numerical one, it leads to a numerical value. (ii) When the expression involves a symbolic test-function see test(2), the result is a linear form, represented by the field class. (iii) When the expression involves both symbolic trial- and test-functions see test(2), the result is a bilinear form, represented by the field class.

Examples

For computing the measure of a domain:

  Float meas_omega = integrate (omega);

For computing the integral of a function:

  Float f (const point& x);
  ...
  quadrature_option qopt;
  qopt.set_order (3);
  Float int_f = integrate (omega, f, qopt);

The last argument specifies the quadrature formulae (see quadrature_option(2)) used for the computation of the integral. The function can be replaced by any field-valued expression (see field(2)). For computing a right-hand-side of a variational formulation with the previous function f:

  space Xh (omega, "P1");
  test v (Xh);
  field lh = integrate (f*v);

For computing a bilinear form:

  trial u (Xh);
  test v (Xh);
  form m = integrate (u*v);

The expression u*v can be replaced by any bilinear expression (see field(2)).

Default arguments

In the case of a linear or bilinear form, the domain is optional: by default it is the full domain definition of the test function. Also, the quadrature formulae is optional: by default, its order is 2*k+1 where k is the polynomial degree of the Xh space associated to the test function v. When both a test u and trial v functions are supplied, let k1 and k2 be their polynomial degrees. Then the default quadrature is chosen to be exact at least for k1+k2+1 polynoms. When the integration is performed on a subdomain, this subdomain simply replace the first argument and a domain name could also be used:

  field l2h = integrate (omega["boundary"], f*v);
  field l3h = integrate ("boundary", f*v);

For convenience, only the domain name can be supplied.

Releases

4 releases since Debian 7 (Wheezy); the text changed 3 times.

  1. 7
  2. 8
  3. 9
  4. 10

From librheolef-dev 7.0-2+b1 in Debian 10 (Buster). Parsed by carta from the page's man source.