.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_functional_modeling/field_functions/plot_vertexvalue_function.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_functional_modeling_field_functions_plot_vertexvalue_function.py: Vertex value function ===================== .. GENERATED FROM PYTHON SOURCE LINES 7-30 A vertex value function :math:`f_{vertexvalue}: \mathcal{D} \times \mathbb{R}^d \rightarrow \mathcal{D} \times \mathbb{R}^q` is a particular field function that lets invariant the mesh of a field and defined by a function :math:`h : \mathbb{R}^n \times \mathbb{R}^d \rightarrow \mathbb{R}^q` such that: .. math:: \begin{aligned} f_{vertexvalue}(\underline{t}, \underline{x})=(\underline{t}, h(\underline{t},\underline{x}))\end{aligned} Let's note that the input dimension of :math:`f_{vertexvalue}` still design the dimension of :math:`\underline{x}` : :math:`d`. Its output dimension is equal to :math:`q`. The creation of the *VertexValueFunction* object requires the function :math:`h` and the integer :math:`n`: the dimension of the vertices of the mesh :math:`\mathcal{M}`. This example illustrates the creation of a field from the function :math:`h:\mathbb{R}\times\mathbb{R}^2` such as: .. math:: \begin{aligned} h(\underline{t}, \underline{x})=(t+x_1^2+x_2^2) \end{aligned} .. GENERATED FROM PYTHON SOURCE LINES 33-37 .. code-block:: Python import openturns as ot ot.Log.Show(ot.Log.NONE) .. GENERATED FROM PYTHON SOURCE LINES 38-39 Create a mesh .. GENERATED FROM PYTHON SOURCE LINES 39-42 .. code-block:: Python N = 100 mesh = ot.RegularGrid(0.0, 1.0, N) .. GENERATED FROM PYTHON SOURCE LINES 43-44 Create the function that acts the values of the mesh .. GENERATED FROM PYTHON SOURCE LINES 44-46 .. code-block:: Python h = ot.SymbolicFunction(["t", "x1", "x2"], ["t+x1^2+x2^2"]) .. GENERATED FROM PYTHON SOURCE LINES 47-48 Create the field function .. GENERATED FROM PYTHON SOURCE LINES 48-50 .. code-block:: Python f = ot.VertexValueFunction(h, mesh) .. GENERATED FROM PYTHON SOURCE LINES 51-52 Evaluate f .. GENERATED FROM PYTHON SOURCE LINES 52-60 .. code-block:: Python inF = ot.Normal(2).getSample(N) outF = f(inF) # print input/output at first 10 mesh nodes txy = mesh.getVertices() txy.stack(inF) txy.stack(outF) txy[:10] .. raw:: html
tX0X1y0
000.5112560.16655790.2891242
11-0.6232318-1.5157873.686029
220.2845683-0.84800722.800095
331.9074780.38176616.784218
44-0.1213199-0.018476934.01506
55-0.41922560.95025526.078735
66-0.11239131.5788828.505499
770.57268941.4021289.293936
881.0113141.54286111.40318
990.4464708-1.06727110.3384


.. _sphx_glr_download_auto_functional_modeling_field_functions_plot_vertexvalue_function.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_vertexvalue_function.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_vertexvalue_function.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_vertexvalue_function.zip `