Dear Lawrence (thank you also Alastair for the suggestion),
I think your last crude way is what I need, as I'd like to extrapolate results from 3 meshes to get the estimate of the exact solution. I also refine mesh externally in gmsh. Therefore I need results from a few runs with different meshes. I'd like to save the solution and open it in a different file for further study.
I tried to use DumbCheckpoint. Firedrake seems to complain when I store the solution held in a certain object structure and then try to load it without the same structure (even in the same file). Details below. I don't run MPI.
Thank you,
Tomasz
...
import firedrake as fd
...
# store solution
dumb_file = fd.DumbCheckpoint("results_crude/phi", mode=fd.FILE_CREATE)
dumb_file.store(CS.W.phi) # some object structure
...
# this works (in the same file, same object structure):
#dumb_file = fd.DumbCheckpoint("results_crude/phi", mode=fd.FILE_READ)
#dumb_file.load(CS.W.phi)
# this doesn't work (same mesh and function space, no object structure):
mesh = fd.Mesh("cylinder_coarse.msh")
V = fd.FunctionSpace(mesh, "CG", 1)
phi = fd.Function(V)
dumb_file = fd.DumbCheckpoint("results_crude/phi", mode=fd.FILE_READ)
dumb_file.load(phi)
Error listing:
Dear Tomasz,
I would like to check the convergence of my solution as I refine the mesh.
Say, I have two solutions in CG1 space, f_coarse on mesh_coarse and f_fine on mesh_fine, which is a refined mesh_coarse. Can I map/interpolate/project f_fine onto mesh_coarse in Firedrake?
You can do this through the multigrid tools.
# make an empty coarse function (Here, Vc is the coarse FS)
f_coarse_ = Function(Vc)
# project fine onto coarse
inject(f_fine, f_coarse_)
# check error
norm(assemble(f_coarse - f_coarse_))
Many Thanks,
Dear all,
I would like to check the convergence of my solution as I refine the mesh.
Say, I have two solutions in CG1 space, f_coarse on mesh_coarse and f_fine on mesh_fine, which is a refined mesh_coarse. Can I map/interpolate/project f_fine onto mesh_coarse in Firedrake?
Thank you,
Tomasz