Dear all, I made a periodic mesh in Gmsh with the opposite sides being identified with one another except for the top and bottom. The script I used for the .geo file is this: Box(1) = {0, 0, 0, 1, 1, 0.67}; Periodic Surface {2} = {1} Translate {1, 0, 0}; Periodic Surface {4} = {3} Translate {0, 1, 0}; But when I tried to define a vector function space over this mesh, I got the following error: File "main.py", line 59, in <module> H1_vec = VectorFunctionSpace(mesh, "CG", 1, 5) File "/home/andrewh/firedrake/src/firedrake/firedrake/functionspace.py", line 177, in VectorFunctionSpace sub_element = make_scalar_element(mesh, family, degree, vfamily, vdegree) File "/home/andrewh/firedrake/src/firedrake/firedrake/functionspace.py", line 40, in make_scalar_element mesh.init() File "/home/andrewh/firedrake/src/firedrake/firedrake/mesh.py", line 1295, in init self._callback(self) File "/home/andrewh/firedrake/src/firedrake/firedrake/mesh.py", line 1678, in callback (self.num_vertices(), geometric_dim)) File "firedrake/cython/dmcommon.pyx", line 1077, in firedrake.cython.dmcommon.reordered_coords ValueError: cannot reshape array of size 1172043 into shape (130337,3) Does anyone know what's going on here? The mesh I made seems very simple so I'm not sure what could have gone wrong. Andrew Hicks
Hi Andrew, Periodic meshes can’t be read in from gmsh into Firedrake. Instead, you need to use one of the built in mesh generators like Periodic SquareMesh etc. all the best cjc On 25 Apr 2021, at 22:49, Andrew Hicks <ahick17@lsu.edu> wrote:  Dear all, I made a periodic mesh in Gmsh with the opposite sides being identified with one another except for the top and bottom. The script I used for the .geo file is this: Box(1) = {0, 0, 0, 1, 1, 0.67}; Periodic Surface {2} = {1} Translate {1, 0, 0}; Periodic Surface {4} = {3} Translate {0, 1, 0}; But when I tried to define a vector function space over this mesh, I got the following error: File "main.py", line 59, in <module> H1_vec = VectorFunctionSpace(mesh, "CG", 1, 5) File "/home/andrewh/firedrake/src/firedrake/firedrake/functionspace.py", line 177, in VectorFunctionSpace sub_element = make_scalar_element(mesh, family, degree, vfamily, vdegree) File "/home/andrewh/firedrake/src/firedrake/firedrake/functionspace.py", line 40, in make_scalar_element mesh.init() File "/home/andrewh/firedrake/src/firedrake/firedrake/mesh.py", line 1295, in init self._callback(self) File "/home/andrewh/firedrake/src/firedrake/firedrake/mesh.py", line 1678, in callback (self.num_vertices(), geometric_dim)) File "firedrake/cython/dmcommon.pyx", line 1077, in firedrake.cython.dmcommon.reordered_coords ValueError: cannot reshape array of size 1172043 into shape (130337,3) Does anyone know what’s going on here? The mesh I made seems very simple so I’m not sure what could have gone wrong. Andrew Hicks _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
See also the ongoing discussions here https://github.com/firedrakeproject/firedrake/issues/1852 Lawrence
On 26 Apr 2021, at 07:04, Cotter, Colin J <colin.cotter@imperial.ac.uk> wrote:
Hi Andrew, Periodic meshes can’t be read in from gmsh into Firedrake. Instead, you need to use one of the built in mesh generators like Periodic SquareMesh etc.
all the best cjc
participants (3)
- 
                
                Andrew Hicks
- 
                
                Cotter, Colin J
- 
                
                Lawrence Mitchell