How to have more control on the shape of the mesh cell?
cube_template6.geo viewGmesh.py
I wrote the files above to generate mesh for a structure by using Python. The outcome is shown in the image below:
The image on the bottom right shows the general shape of the structure. It has four layers (layer1, layer2, layer3, and layer). Layer2 and layer3 are extremly thin compared to layer1 and layer4. I also defined a small volume on layer2 which I assgined it a finer mesh size.
My problem is that layer4 (on the very top) has mesh cells that is very tall and has very small mesh scale in the horizontal direction on the part that is straightly above the small volume in layer2. I wish to have the mesh shape in layer4 more like the mesh shape in layer1. As shown in the image above, layer1 has mesh cells each has similar side length (while the mesh cells in layer3 are like being stretched vertically). More importantly, the mesh size in layer1 is generally bigger than the mesh size in layer2 and the mesh size gradually decreases when it gets closer to the small volume in layer2.
I wish someone could help me and maybe spot the mistake I have in my code. Thx.