Re: [firedrake] Periodic 3D meshes
For the special case of a periodic box, doing it using mesh._from_cell_list and constructing the connectivity and coordinates yourself is not that hard. If you want a really big mesh, you probably want to use a small one and create a hierarchy to get a big one (for added bonus, you can use the hierarchy for GMG if you are so inclined). Regards, David On Mon, 23 May 2016 at 10:32 Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
It's not currently implemented, but you're welcome to do so.
The current periodic meshes are built in a roundabout way: to build a 2d periodic mesh, a torus is constructed (this has the desired connectivity but not the desired geometry), then the coordinates are replaced by the coordinates of a rectangle.
Related: there must be a way to build these directly, rather than via the hack? I continued using the hack because I didn't know how to build a mesh without going through mesh._from_cell_list.
On 23 May 2016 at 09:18, Daniel Ruprecht <D.Ruprecht@leeds.ac.uk> wrote:
Dear Firedrakers,
I am trying to set up a 3D cube mesh, periodic in all three directions, but can't find the correct class to call. At http://firedrakeproject.org/_modules/firedrake/utility_meshes.html only 2d periodic meshes are listed.
Essentially, I'd like something like PeriodicUnitCubeMesh. How do I generate a mesh like this?
Cheers, Daniel
-- Dr. Daniel Ruprecht University Academic Fellow School of Mechanical Engineering, Room 4.50 University of Leeds Leeds LS2 9JT, UK Email: d.ruprecht@leeds.ac.uk Phone: +44 (0)113 343 22 01
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
On 23 May 2016, at 10:54, David Ham <David.Ham@imperial.ac.uk> wrote:
For the special case of a periodic box, doing it using mesh._from_cell_list and constructing the connectivity and coordinates yourself is not that hard.
Note that if you do this you will need to create a 3D cube embedded in 4D and then remap to a 3D periodic cube. The reason for this is that from_cell_list assumes a P1 coordinate field. If you want to directly make the 3D periodic cube you need to interact with PETSc's DMPlex at a slightly lower level to first make the topology you want, then add the geometry and then build the firedrake mesh. This will probably also run into a problem with us because I think we currently assume that the coordinate field that comes out of DMPlex is in P1. But changing that is an easy fix. Cheers, Lawrence
Note that if you do this you will need to create a 3D cube embedded in 4D and then remap to a 3D periodic cube.
I think it might be easier to wrap one's head around this transformation by embedding in 6D such that each dimension of the cube maps to 2 dimensions, transforming between an interval and a circle separately three times. ________________________________________ From: firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> on behalf of Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> Sent: 23 May 2016 10:02:34 To: firedrake Subject: Re: [firedrake] Periodic 3D meshes
On 23 May 2016, at 10:54, David Ham <David.Ham@imperial.ac.uk> wrote:
For the special case of a periodic box, doing it using mesh._from_cell_list and constructing the connectivity and coordinates yourself is not that hard.
Note that if you do this you will need to create a 3D cube embedded in 4D and then remap to a 3D periodic cube. The reason for this is that from_cell_list assumes a P1 coordinate field. If you want to directly make the 3D periodic cube you need to interact with PETSc's DMPlex at a slightly lower level to first make the topology you want, then add the geometry and then build the firedrake mesh. This will probably also run into a problem with us because I think we currently assume that the coordinate field that comes out of DMPlex is in P1. But changing that is an easy fix. Cheers, Lawrence
participants (3)
- 
                
                David Ham
- 
                
                Homolya, Miklós
- 
                
                Lawrence Mitchell