.\" .de Id .. .de Sp .if n .sp .if t .sp 0.4 .. .TH integrate 4rheolef "rheolef-7.0" "rheolef-7.0" "rheolef-7.0" .\" label: /*Class:integrate .SH NAME \fBintegrate\fP - integrate a function or an expression .\" skip: @findex integrate .SH DESCRIPTION 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 \fBfield\fP class. (iii) When the expression involves both symbolic trial- and test-functions see test(2), the result is a bilinear form, represented by the \fBfield\fP class. .SH SYNOPSIS .\" begin_example .Sp .nf Float integrate (geo domain); Float integrate (geo domain, quadrature_option qopt); Value integrate (geo domain, Expression, quadrature_option qopt); .PP field integrate (Expression); field integrate (Expression, quadrature_option qopt); field integrate (geo domain, Expression); field integrate (geo domain, Expression, quadrature_option qopt); .PP form integrate (Expression); form integrate (Expression, integrate_option qopt); form integrate (geo domain, Expression); form integrate (geo domain, Expression, integrate_option qopt); .Sp .fi .\" end_example .SH EXAMPLE For computing the measure of a domain: .\" begin_example .Sp .nf Float meas_omega = integrate (omega); .Sp .fi .\" end_example For computing the integral of a function: .\" begin_example .Sp .nf Float f (const point& x); ... quadrature_option qopt; qopt.set_order (3); Float int_f = integrate (omega, f, qopt); .Sp .fi .\" end_example 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 \fBf\fP: .\" begin_example .Sp .nf space Xh (omega, "P1"); test v (Xh); field lh = integrate (f*v); .Sp .fi .\" end_example For computing a bilinear form: .\" begin_example .Sp .nf trial u (Xh); test v (Xh); form m = integrate (u*v); .Sp .fi .\" end_example The expression \fBu*v\fP can be replaced by any bilinear expression (see field(2)). .SH 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 \fB2*k+1\fP where \fBk\fP is the polynomial degree of the \fBXh\fP space associated to the test function \fBv\fP. When both a test \fBu\fP and trial \fBv\fP 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: .\" begin_example .Sp .nf field l2h = integrate (omega["boundary"], f*v); field l3h = integrate ("boundary", f*v); .Sp .fi .\" end_example For convenience, only the domain name can be supplied. .\" END .\" LENGTH = 5 .SH SEE ALSO test(2), test(2), quadrature_option(2), field(2), field(2) .SH COPYRIGHT Copyright (C) 2000-2018 Pierre Saramito GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.