Initialize an object with the values specified in a vector or extracting a component from a vectorial field.
This function can be used in two different ways.
- To create a function from a vector. In this case, the arguments are:
- name is a string representing the name of the function;
- FunctionSpace is the fem-fenics function space where the vector is defined;
- Vector specifies the values of the coefficients for each basis function of the FunctionSpace.
- To extract a scalar field from a vectorial one:
- name is a string representing the name of the function;
- Function is the vector valued Function;
- Index contains the index of the scalar field to extract. Indices start from 1.
The output func is an object which contains a representation of the function Vector which can be plotted or saved or passed as argument for a variational problem. Moreover, it is possible to evaluate it on points of its domain.
See also: Constant, Expression, plot, save.