Dear all, As I couldn't apply periodic BC on my imported mesh, I solved my weak form on FreeFEM, from which I can save the solution in .vtk. I'd still like to use Firedrake to solve the other FE problems, but for this I would need to project my FreeFEM solution to a Firedrake function. I know that the way to do this is to import the .h5 function with DumbCheckpoint, but as the FreeFEM solution is saved in .vtk format, would you have any hint on how to assign its values to a Firedrake function ? Perhaps one way would be to browse the .vtk file and assign each point data to the corresponding node on my Firedrake function. But that is rather complicated because saved nodes coordinates are rounded compared to the initial imported mesh. Do you have any advice on what would be the best way to do this (if there is any...) ? Thanks, Floriane ________________________________ De : Matthew Knepley <knepley@gmail.com> Envoyé : jeudi 8 novembre 2018 17:40 À : Lawrence Mitchell Cc : Ham, David A; Floriane Gidel [RPG]; Firedrake Project Objet : Re: [firedrake] Periodic domain with imported mesh On Thu, Nov 8, 2018 at 9:41 AM Lawrence Mitchell <wencel@gmail.com<mailto:wencel@gmail.com>> wrote:
On 8 Nov 2018, at 14:34, Ham, David A <david.ham@imperial.ac.uk<mailto:david.ham@imperial.ac.uk>> wrote:
Hmm. OK. For some reason I thought it was worse than this. Is there an example somewhere we could try?
When I looked at this, I ran out of brain, I summarised the issues I found here: https://github.com/firedrakeproject/firedrake/issues/1246 Basically: 1. Right now the Mesh constructor hard-codes a P1 coordinate field, one needs to change it so that you can pass a coordinate element that it will use (easy). Yep. 2. There is a reordering that needs to be applied to map from the Plex coordinate field to the Firedrake one. I didn't figure this out. (Matt: we don't "just use" the plex coordinate field as is, because we don't use any of your evaluation routines. Hence we need it to be a fully-fledged function, with all the numbering conventions that we have). What about just projecting the coordinate field into your DG space? I think to do this you only need a gadget that evaluates the coordinates at any point you ask for. Luckily, we have that. Toby made all coordinates use a DMField object, so you can ask it to evaluate somewhere and it will. Matt Lawrence -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/<http://www.cse.buffalo.edu/~knepley/>