Hi Fenics community,

I am trying to use Fenics in order to solve a Poisson problem with Robin boundary conditions.

I would like to be able to extract the coordinates associated to the DOFs, perform some computations externally and then re assign the values of the DOFS on my function or another function of the same functionspace.

I know it is possible to use the interpolate method for functions which depend on the coordinates of my domain but my intermediate calculations are quite large and I would prefer to do the calculations “externally” and then plug them again “point-by-point”, i.e, for each DOF of my functions.

Is this possible to do using Fenicsx? Is it possible to extract the coordinates following the same ordering of the DOFs so that I dont have to use expensive loops to assign the values on the DOFs? (i.e, preferably, I would just like to be able to do something like function.x.set(desired_values) in where desired_values is a vector ordered in the same ordering as the DOFs)

Thanks a lot for the feedback and help