# Vertex value function¶

A vertex value function is a particular field function that lets invariant the mesh of a field and defined by a function such that:

Let’s note that the input dimension of still design the dimension of : . Its output dimension is equal to .

The creation of the VertexValueFunction object requires the function and the integer : the dimension of the vertices of the mesh .

This example illustrates the creation of a field from the function such as:

import openturns as ot

ot.Log.Show(ot.Log.NONE)


Create a mesh

N = 100
mesh = ot.RegularGrid(0.0, 1.0, N)


Create the function that acts the values of the mesh

h = ot.SymbolicFunction(["t", "x1", "x2"], ["t+x1^2+x2^2"])


Create the field function

f = ot.VertexValueFunction(h, mesh)


Evaluate f

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]

t X0 X1 y0 0 0.02772026 0.1697782 0.02959305 1 -0.730191 -0.05513265 1.536219 2 -0.4083213 0.6251446 2.557532 3 -0.03512366 -1.551634 5.408803 4 0.06106403 0.5456437 4.301456 5 1.012743 0.3416257 6.142357 6 1.0148 1.861681 10.49568 7 -1.89551 0.68089 11.05657 8 0.5093272 -0.3883912 8.410262 9 -0.878559 0.1473901 9.79359