SimplicialCubature

class SimplicialCubature(*args)

Integration over a simplex.

Warning

This class is experimental and likely to be modified in future releases. To use it, import the openturns.experimental submodule.

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
>>> import openturns.experimental as otexp
>>> vertices = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]
>>> simplicies = [[0, 1, 2]]
>>> mesh = ot.Mesh(vertices, simplicies)
>>> algo = otexp.SimplicialCubature()
>>> f = ot.SymbolicFunction(['x1', 'x2'], ['exp(x1 + x2)'])
>>> value = algo.integrate(f, 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(function, mesh)

Evaluation of the integral of f on an interval.

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.

__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(function, mesh)

Evaluation of the integral of f on an interval.

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

The integrand function.

meshMesh

The domain on which to integrate.

Returns:
valuePoint

Approximation of the integral.

Examples

>>> import openturns as ot
>>> import openturns.experimental as otexp
>>> vertices = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]
>>> simplicies = [[0, 1, 2]]
>>> mesh = ot.Mesh(vertices, simplicies)
>>> algo = otexp.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.