OpenTURNSPythonFieldFunction

class OpenTURNSPythonFieldFunction(inputMesh, inputDim, outputMesh, outputDim)

Override FieldFunction from Python.

Parameters:
inputMesh : Mesh

The input mesh

inputDim : int, \geq 1

Dimension d of the values of the input field

outputMesh : Mesh

The output mesh

outputDim : int, \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__  
getInputDescription  
getInputDimension  
getInputMesh  
getOutputDescription  
getOutputDimension  
getOutputMesh  
setInputDescription  
setOutputDescription  
__init__(inputMesh, inputDim, outputMesh, outputDim)

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