Hello,
While trying to convert an old dolfin code into dolfinx, I am wondering how to replace the assign
command, which I used to initialize the values of a function with the result of a previous calculation, for example :
import dolfinx
L = 1
d = L/10.
h = d/6.
my_domain = dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD,
points=((0.0, -0.5*d), (L, 0.5*d)), n=(int(L/h), int(d/h)),
cell_type=dolfinx.mesh.CellType.triangle)
V = dolfinx.fem.VectorFunctionSpace(my_domain, ("CG", 2))
u = dolfinx.fem.Function(V)
u_saved = dolfinx.fem.Function(V)
### follows a calculation: u is the solution
u_saved.assign(u) #old dolfin command which I try to replace
Many thanks in advance!
Claire