FloSewn / TQMesh

A simple two-dimensional mesh generator with triangular and quadrilateral elements in C++
MIT License
57 stars 16 forks source link

Quadrilaterals #3

Closed eriks-aidotse closed 2 years ago

eriks-aidotse commented 2 years ago

Hi!

I would like to generate 100% Quadrilateral meshes. I tried the examples,

./TQMesh RectangleMesh.para > Mesh.dat

setting 'Element type: Quadrilateral'.

However there seems to be a few triangular elements in the mesh, see also the image on the GitHub page. What's going on?

/Erik

FloSewn commented 2 years ago

Hey Erik,

the current implementation of the quadrilateral paving algorithm basically generates two triangles for every advancing front edge and merges them to a quadrilateral - if possible.

However, sometimes the merging would lead to an edge intersection, or only one of two generated triangles is valid. In these cases, the algorithm will introduce triangles in the grid.

It might be possible to post-process these elements after the meshing process, in order to generate a pure quadrilateral mesh.

I could look at this, if needed.

Best regards

Flo

eriks-aidotse commented 2 years ago

Hi Flo!

Ok, I understand -it's a bit difficult. Do not spend time on this for me. But for your code it would palpably be good to offer 100% quads.

/Erik

FloSewn commented 2 years ago

Hey Erik,

I just implemented the quad-refinement. This gives you the possibility to turn any mesh to 100% quads.

You can try it in the newest release v1.1

Maybe it helps you :-)

Best regards

Flo