Hi all,
I have a dolfin.Vector whose entries represent the coefficients of a Function in the finite element basis expansion.
What is the safest way to create a dolfin.Function using such dolfin.Vector as degree of freedom.
Initially I was simply using
x_as_a_func = dolfin.Function( V, x_as_a_vector)
However this does not seem to work correctly in parallel (at least in FEniCS 1.6).
So I came up with the following walkaround which seems to work both in serial and in parallel:
x_as_a_func = dolfin.Function(V)
x_as_a_func.vector().zero()
x_as_a_func.vector().axpy(1., x_as_a_vector)
Is this second approach safe?
Also this brings up my second question: How shared degree of freedom are handled by dolfin.Function during the assembly procedure?
Thanks in advance!