question on manual quad mesh generation in 3D


I have a question on mesh generation.
I need purely quad/hex periodic meshes to test convergence properties of some methods. The domain is a simple square/cube.

The i-tutorial
contains a manual generated rectangular mesh.
How to modify the boundary elements/boundary conditions to have periodic boundary?
Well, in this 2D case, I can use the idea
to generate a periodic geometry and use
ngmesh = geo.GenerateMesh(maxh=0.5, quad_dominated=True)
to get the mesh, so this is not really an issue right now.

But for 3D, when I do quad_dominated=True, it gives me an error like:

SYSTEM ERROR: mesh has still open quads
Caught NgException: Stop meshing since too many attempts



“quad_dominated=True” just leads to a quad dominated surface mesh in 3D.

You have to generate your own hex-mesh. Check out this topic, there we had a discussion about a periodic cube. One of the attached files in this topic generates a mesh of a cube which is periodic in one direction.

For the 2D case you can use the same strategy. I attached a file which manually meshes a periodic rectangle with quads.

To check if the mesh is periodic, use “View>Viewing Options>Mesh>Show identified points”. If this option is active and a draw a mesh you should see lines connecting the periodic(identified) points.



thanks a lot!
I will try that out.