OpenTURNSPythonFieldFunction¶
- class OpenTURNSPythonFieldFunction(inputMesh, inputDim, outputMesh, outputDim)¶
Override FieldFunction from Python.
- Parameters:
Methods
getInputDescription
getInputDimension
getInputMesh
getOutputDescription
getOutputDimension
getOutputMesh
setInputDescription
setOutputDescription
Notes
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)
- __init__(inputMesh, inputDim, outputMesh, outputDim)¶
Examples using the class¶
Metamodel of a field function