OpenTURNSPythonFieldToPointFunction¶
- class OpenTURNSPythonFieldToPointFunction(inputMesh, inputDim, outputDim)¶
Override FieldToPointFunction from Python.
- Parameters:
- inputMesh
Mesh
The input mesh.
- inputDimpositive int
Dimension of the input field values
.
- outputDimpositive int
Dimension of the output vector d’.
- inputMesh
Methods
Accessor to the description of the input field values.
Accessor to the dimension of the input field values.
Accessor to the mesh of the input field.
Accessor to the description of the output values of the function.
Accessor to the dimension of the output values of the function.
setInputDescription
(descIn)Accessor to the description of the input field values.
setOutputDescription
(descOut)Accessor to the description of the output values of the function.
Notes
A OpenTURNSPythonFieldToPointFunction function acts on fields to produce points:
with
a mesh of
.
A field is represented by a collection
of elements of
where
is a vertex of
and
the associated value in
.
- At least, you have to overload the function:
_exec(X): a single evaluation, where X is a
Field
. It returns aPoint
.
Examples
For example, we create the function that maps a field to the mean value of its values.
>>> import openturns as ot >>> mesh = ot.Mesh(1) >>> class FUNC(ot.OpenTURNSPythonFieldToPointFunction): ... def __init__(self): ... # first argument: ... super(FUNC, self).__init__(mesh, 2, 2) ... self.setInputDescription(['R', 'S']) ... self.setOutputDescription(['T', 'U']) ... def _exec(self, X): ... Y = ot.Sample(X).computeMean() ... return Y >>> F = FUNC()
- __init__(inputMesh, inputDim, outputDim)¶
- getInputDescription()¶
Accessor to the description of the input field values.
- Returns:
- descInsequence of str
The description of the input field values.
- getInputDimension()¶
Accessor to the dimension of the input field values.
- Returns:
- inputFieldDimint
The dimension of the input field values
.
- getInputMesh()¶
Accessor to the mesh of the input field.
- Returns:
- inputMesh
Mesh
The mesh of the input field.
- inputMesh
- getOutputDescription()¶
Accessor to the description of the output values of the function.
- Returns:
- descOutsequence of str
The description of the output values of the function.
- getOutputDimension()¶
Accessor to the dimension of the output values of the function.
- Returns:
- outputDimint
The dimension of the output values of the function
.
- setInputDescription(descIn)¶
Accessor to the description of the input field values.
- Parameters:
- descInsequence of str
The description of the input field values.
- setOutputDescription(descOut)¶
Accessor to the description of the output values of the function.
- Parameters:
- descOutsequence of str
The description of the output values of the function.
Examples using the class¶
Estimate Sobol indices on a field to point function