> On 28 Oct 2016, at 13:24, Pan, Wei <wei.pan@imperial.ac.uk> wrote:
> 
> Hi,
> 
> I'm currently using a mixed formulation for solving the Euler equation with periodic boundary conditions. So right now I am using a PeriodicSquareMesh. I also need different refinements of the same mesh. I was made aware of the MeshHierarchy function.
Do you need to transfer solutions between the different refinements?  If not, just make meshes of the appropriate resolution.  Otherwise, read on...
> However MeshHierarchy does not seem to work with PeriodicSquareMesh, I get an error message saying
> 
> "ValueError: total size of new array must be unchanged."
I think this is because we assume when building meshes from a DM object that the coordinate field lives in a piecewise linear space.  However, this is not the case for periodic meshes.  We rely on PETSc refinement to refine the mesh, but for periodic meshes,
 PETSc doesn't have a full view of the mesh (it only really knows the topology).
You could maybe do it (a bit of hack) by building a TorusMesh, then creating a mesh hierarchy of that, and then using the code in firedrake/utility_meshes.py to do create your periodic meshes and put them back into the hierarchy (ugh).
In any case, can you please report a github issue describing what you tried to do and what didn't work?
Cheers,
Lawrence
_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake