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.

getId()

Accessor to the object's id.

getMaximumAbsoluteError()

Maximum absolute error accessor.

getMaximumEvaluationNumber()

Maximum evaluation number accessor.

getMaximumRelativeError()

Maximum relative error accessor.

getName()

Accessor to the object's name.

getRule()

Integration rule accessor.

getShadowedId()

Accessor to the object's shadowed id.

getVisibility()

Accessor to the object's visibility state.

hasName()

Test if the object is named.

hasVisibleName()

Test if the object has a distinguishable name.

integrate(function, mesh)

Evaluation of the integral of f on an interval.

setMaximumAbsoluteError(maximumAbsoluteError)

Maximum absolute error accessor.

setMaximumEvaluationNumber(...)

Maximum evaluation number accessor.

setMaximumRelativeError(maximumRelativeError)

Maximum relative error accessor.

setName(name)

Accessor to the object's name.

setRule(rule)

Integration rule accessor.

setShadowedId(id)

Accessor to the object's shadowed id.

setVisibility(visible)

Accessor to the object's visibility state.

__init__(*args)
getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getId()

Accessor to the object’s id.

Returns:
idint

Internal unique identifier.

getMaximumAbsoluteError()

Maximum absolute error accessor.

Returns:
maxAbsErrorfloat

The maximum absolute error.

getMaximumEvaluationNumber()

Maximum evaluation number accessor.

Returns:
maxEvalint

The maximum function evaluation 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.

getShadowedId()

Accessor to the object’s shadowed id.

Returns:
idint

Internal unique identifier.

getVisibility()

Accessor to the object’s visibility state.

Returns:
visiblebool

Visibility flag.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

hasVisibleName()

Test if the object has a distinguishable name.

Returns:
hasVisibleNamebool

True if the name is not empty and not the default one.

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.

setMaximumEvaluationNumber(maximumEvaluationNumber)

Maximum evaluation number accessor.

Parameters:
maxEvalint

The maximum function evaluation 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.

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters:
idint

Internal unique identifier.

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:
visiblebool

Visibility flag.