.\" .de Id .. .de Sp .if n .sp .if t .sp 0.4 .. .TH integrate 4rheolef "rheolef-6.5" "rheolef-6.5" "rheolef-6.5" .\" 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 SYNOPSYS .\" begin_example .Sp .nf template T integrate (const geo_basic& omega, Expr expr, quadrature_option_type qopt) .PP template field integrate (const geo_basic& omega, VFExpr expr, quadrature_option_type qopt) .PP template form integrate (const geo_basic& omega, VFExpr expr, form_option_type fopt) .Sp .fi .\" end_example .SH EXAMPLE .\" begin_example .Sp .nf Float f (const point& x); ... quadrature_option_type qopt; Float value = integrate (omega, f, qopt); field lh = integrate (omega, f*v, qopt); .Sp .fi .\" end_example The last argument specifies the quadrature formulae used for the computation of the integral. The expression can be any function, classs-function or any linear or nonlinear field expression see field(2). .SH DEFAULT ARGUMENTS In the case of a linear form, the domain is optional: by default it is the full domain definition of the test function. .\" begin_example .Sp .nf field l1h = integrate (f*v, qopt); .Sp .fi .\" end_example When the integration is perfomed 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, qopt); field l3h = integrate ("boundary", f*v, qopt); .Sp .fi .\" end_example The quadrature formulae is required, except when a test and/or trial function is provided in the expression to integrate. In that case, the quadrature formulae is deduced from the space containing the test (or trial) function. When a test function is suppied, let k be its polynomial degree. Then the default quadrature is choosen to be exact at least for 2*k+1 polynoms. When both a test and trial functions are suppied, let k1 and k2 be their polynomial degrees. Then the default quadrature is choosen to be exact at least for k1+k2+1 polynoms. Also, when the expression is a constant, the quadrature function is optional: in that case, the constant is also optional and the following call: .\" begin_example .Sp .nf Float meas = integrate (omega); .Sp .fi .\" end_example is valid and returns the measure of the domain. .\" END .\" LENGTH = 3 .SH SEE ALSO test(2), test(2), field(2)