Hi David, The mesh for this is BoxMesh. For documentation, type '? BoxMesh' at a python prompt, after importing firedrake, or see line 475 onwards of https://github.com/firedrakeproject/firedrake/blob/master/firedrake/utility_... In your case, you want BoxMesh(nx, ny, nz, 1.0, 1.0, 2.0), where nx, ny and nz are the number of cells in the x, y and z direction respectively. Ideally (see below), each cuboid is divided into 6 tetrahedra, so the total number of cells is 6*nx*ny*nz, so you can control this exactly. Unfortunately, there is a trap: if you want cells whose x, y and z dimensions are very different, the mesh generator will generate extra points. With the dimensions you gave above, if you have nx = 10, ny = 10, nz = 20, you get what you expect - lots of cubes, each divided into 6 tetrahedra. However, if you have nx = 5, ny = 5, nz = 100, you get something completely different (lots of small cells). You can visualise the mesh by using File("mesh.pvd") << mesh.coordinates and opening the file in Paraview in 'Wireframe' mode. There's a very easy workaround, so do reply if this is a problem for you. Best, Andrew On 9 December 2015 at 14:15, Angwenyi David <kipkoej@gmail.com> wrote:
Dear all,
I would like to solve a 3d Helmholtz equation in a domain 0 <= x <= 1, 0 <= y <= 1, 0 <= z <= 2 tessellated into any number of tetrahedra. Is this possible within Firedrake, and if yes, what is the mesh name?
David _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
Hi Andrew, Here is what I get:
File("mesh.pvd")<<mesh.coordinates Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute ‘coordinates'
What could be the issue?
On 09 Dec 2015, at 15:36, Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
Hi David,
The mesh for this is BoxMesh. For documentation, type '? BoxMesh' at a python prompt, after importing firedrake, or see line 475 onwards of https://github.com/firedrakeproject/firedrake/blob/master/firedrake/utility_... <https://github.com/firedrakeproject/firedrake/blob/master/firedrake/utility_meshes.py>
In your case, you want BoxMesh(nx, ny, nz, 1.0, 1.0, 2.0), where nx, ny and nz are the number of cells in the x, y and z direction respectively. Ideally (see below), each cuboid is divided into 6 tetrahedra, so the total number of cells is 6*nx*ny*nz, so you can control this exactly.
Unfortunately, there is a trap: if you want cells whose x, y and z dimensions are very different, the mesh generator will generate extra points.
With the dimensions you gave above, if you have nx = 10, ny = 10, nz = 20, you get what you expect - lots of cubes, each divided into 6 tetrahedra.
However, if you have nx = 5, ny = 5, nz = 100, you get something completely different (lots of small cells).
You can visualise the mesh by using File("mesh.pvd") << mesh.coordinates and opening the file in Paraview in 'Wireframe' mode.
There's a very easy workaround, so do reply if this is a problem for you.
Best, Andrew
On 9 December 2015 at 14:15, Angwenyi David <kipkoej@gmail.com <mailto:kipkoej@gmail.com>> wrote: Dear all,
I would like to solve a 3d Helmholtz equation in a domain 0 <= x <= 1, 0 <= y <= 1, 0 <= z <= 2 tessellated into any number of tetrahedra. Is this possible within Firedrake, and if yes, what is the mesh name?
David _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk <mailto:firedrake@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/firedrake <https://mailman.ic.ac.uk/mailman/listinfo/firedrake>
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
Thank you. It is now fine.
On 09 Dec 2015, at 15:36, Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
Hi David,
The mesh for this is BoxMesh. For documentation, type '? BoxMesh' at a python prompt, after importing firedrake, or see line 475 onwards of https://github.com/firedrakeproject/firedrake/blob/master/firedrake/utility_... <https://github.com/firedrakeproject/firedrake/blob/master/firedrake/utility_meshes.py>
In your case, you want BoxMesh(nx, ny, nz, 1.0, 1.0, 2.0), where nx, ny and nz are the number of cells in the x, y and z direction respectively. Ideally (see below), each cuboid is divided into 6 tetrahedra, so the total number of cells is 6*nx*ny*nz, so you can control this exactly.
Unfortunately, there is a trap: if you want cells whose x, y and z dimensions are very different, the mesh generator will generate extra points.
With the dimensions you gave above, if you have nx = 10, ny = 10, nz = 20, you get what you expect - lots of cubes, each divided into 6 tetrahedra.
However, if you have nx = 5, ny = 5, nz = 100, you get something completely different (lots of small cells).
You can visualise the mesh by using File("mesh.pvd") << mesh.coordinates and opening the file in Paraview in 'Wireframe' mode.
There's a very easy workaround, so do reply if this is a problem for you.
Best, Andrew
On 9 December 2015 at 14:15, Angwenyi David <kipkoej@gmail.com <mailto:kipkoej@gmail.com>> wrote: Dear all,
I would like to solve a 3d Helmholtz equation in a domain 0 <= x <= 1, 0 <= y <= 1, 0 <= z <= 2 tessellated into any number of tetrahedra. Is this possible within Firedrake, and if yes, what is the mesh name?
David _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk <mailto:firedrake@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/firedrake <https://mailman.ic.ac.uk/mailman/listinfo/firedrake>
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
participants (2)
- 
                
                Andrew McRae
- 
                
                Angwenyi David