OpenTURNSPythonFieldFunction

class OpenTURNSPythonFieldFunction(inputMesh, inputDim, outputMesh, outputDim)

Override FieldFunction from Python.

Parameters
inputMeshMesh

The input mesh

inputDimint, \geq 1

Dimension d of the values of the input field

outputMeshMesh

The output mesh

outputDimint, \geq 1

Dimension d' of the values of the output field

Notes

You have to overload the function:

_exec(X): single evaluation, X is a Field, returns a Field

Examples

>>> import openturns as ot
>>> mesh = ot.Mesh(1)
>>> class FUNC(ot.OpenTURNSPythonFieldFunction):
...     def __init__(self):
...         # first argument:
...         super(FUNC, self).__init__(mesh, 2, mesh, 2)
...         self.setInputDescription(['R', 'S'])
...         self.setOutputDescription(['T', 'U'])
...     def _exec(self, X):
...         Y = ot.Field(self.getOutputMesh(), X.getValues() * ([2.0]*X.getValues().getDimension()))
...         return Y
>>> F = FUNC()

Create the associated FieldFunction:

>>> myFunc = ot.FieldFunction(F)

Methods

__call__(X)

Call self as a function.

getInputDescription

getInputDimension

getInputMesh

getOutputDescription

getOutputDimension

getOutputMesh

setInputDescription

setOutputDescription

__init__(inputMesh, inputDim, outputMesh, outputDim)

Initialize self. See help(type(self)) for accurate signature.