Hello all,
after solving a PDE with periodic boundary conditions like in this tutorial Poisson equation with periodic boundary conditions , I need an array with all function values for computing displacements at all nodes. Assuming, I've implemented the code in the tutorial on a UnitSquareMesh(3,3), I could add the line
u.vector().array()
which displays only 12 values, as the appropriate FunctionSpace is constrained. Is there a possibility to display all 16 values?
Hi, consider using interpolation
Vp = FunctionSpace(mesh, 'CG', 1, constrained_domain=PeriodicBoundary()) u = Function(Vp) # Unconstrained space V = FunctionSpace(mesh, 'CG', 1) v = interpolate(u, V) # v has 'all' values
Thank You, that solved my problem.