Re: [firedrake] Poisson equation; homogeneous vs nonhomogeneous
[also re-adding firedrake cc]
On 18 Apr 2018, at 19:15, Eric M <eric.malitz@gmail.com> wrote:
I had a more pertinent question: could you tell me if it's possible to interpolate a solution found on one grid, to another grid? For example, I find a solution to a problem on a coarse grid, and wish to use this solution somewhere in a linearized problem on a finer grid, so it needs to be interpolated. I have tried the basic things I can think of, but nothing works yet.
If you make a MeshHierarchy object, then you can do prolongation easily: coarse_mesh = ... # This does regular refinement. hierarchy = MeshHierarchy(coarse_mesh, number_of_refinements) Now suppose you have a coarse function: coarse = Function(V) you can do: for finer in hierarchy[1:]: Vfine = FunctionSpace(finer, V.ufl_element()) fine = Function(Vfine) prolong(coarse, fine) coarse = fine Now fine contains the prolongation of the coarse function on the finest mesh in the hierarchy. Alternately, if there is not a nice relationship between the two meshes, you can use the advice here: https://firedrakeproject.org/interpolation.html#interpolation-from-external-... Thanks, Lawrence
participants (1)
-
Lawrence Mitchell