Hi,
I'm still a little confused about the correct way of manipulating values of vectors in parallel. Consider the following situations:
v0
is a vector of coefficients of a DG(0) function that I want to use as a cell-wise constant coefficient in my weak form (and possibly save to a .pvd file for inspection)
v1
is a vector of coefficients of a CG(1) function (solution of the problem) that I am going to, e.g., use as an initial approximation for a KrylovSolver
, compute a norm of, multiply with a matrix, save into a .pvd file, etc.
From the linked answer, I know that I need to call v1.apply("")
after each call to v1.set_local(x)
. My questions are:
Does the same hold also for v0
? I suppose that inter-process boundaries of partitioned meshes do not run through cells, so are vectors representing DG(0) functions free of ghost indices?
What is the difference between
v.apply("insert")
(present at many places in Dolfin sources after calls to set_local
) and plain
v.apply("")
Why does the linked answer explicitly say "... get/set functions"? I suppose that I don't need to call v.apply
after v.get_local
, or am I wrong?
Thanks for the clarification!