SimplicialCubature

class SimplicialCubature(*args)

Integration over a mesh.

Methods

getClassName()

Accessor to the object's name.

getMaximumAbsoluteError()

Maximum absolute error accessor.

getMaximumCallsNumber()

Maximum calls number accessor.

getMaximumRelativeError()

Maximum relative error accessor.

getName()

Accessor to the object's name.

getRule()

Integration rule accessor.

hasName()

Test if the object is named.

integrate(*args)

Evaluation of the integral of f on a mesh.

setMaximumAbsoluteError(maximumAbsoluteError)

Maximum absolute error accessor.

setMaximumCallsNumber(maximumCallsNumber)

Maximum calls number accessor.

setMaximumRelativeError(maximumRelativeError)

Maximum relative error accessor.

setName(name)

Accessor to the object's name.

setRule(rule)

Integration rule accessor.

Notes

This is a reimplementation of the method described in [genz2003]. The original matlab file can be found at https://www.math.wsu.edu/faculty/genz/software/software.html.

Examples

>>> import openturns as ot
>>> vertices = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]
>>> simplicies = [[0, 1, 2]]
>>> mesh = ot.Mesh(vertices, simplicies)
>>> algo = ot.SimplicialCubature()
>>> f = ot.SymbolicFunction(['x1', 'x2'], ['exp(x1 + x2)'])
>>> value = algo.integrate(f, mesh)
__init__(*args)
getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getMaximumAbsoluteError()

Maximum absolute error accessor.

Returns:
maxAbsErrorfloat

The maximum absolute error.

getMaximumCallsNumber()

Maximum calls number accessor.

Returns:
maxEvalint

The maximum function calls number.

getMaximumRelativeError()

Maximum relative error accessor.

Returns:
maxRelErrorfloat

The maximum relative error.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getRule()

Integration rule accessor.

Returns:
ruleint in [1, 4]

The integration rule.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

integrate(*args)

Evaluation of the integral of f on a mesh.

Parameters:
fFunction, f: \Rset^d \mapsto \Rset^p

The integrand function.

meshMesh

The mesh on which to integrate.

Returns:
valuePoint

Approximation of the integral.

Examples

>>> import openturns as ot
>>> vertices = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]
>>> simplicies = [[0, 1, 2]]
>>> mesh = ot.Mesh(vertices, simplicies)
>>> algo = ot.SimplicialCubature()
>>> f = ot.SymbolicFunction(['x1', 'x2'], ['exp(x1 + x2)'])
>>> value = algo.integrate(f, mesh)
setMaximumAbsoluteError(maximumAbsoluteError)

Maximum absolute error accessor.

Parameters:
maxAbsErrorfloat

The maximum absolute error.

setMaximumCallsNumber(maximumCallsNumber)

Maximum calls number accessor.

Parameters:
maxEvalint

The maximum function calls number.

setMaximumRelativeError(maximumRelativeError)

Maximum relative error accessor.

Parameters:
maxRelErrorfloat

The maximum relative error.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setRule(rule)

Integration rule accessor.

Parameters:
ruleint in [1, 4]

The integration rule.