Gmsh mesh created in python via Gmsh from a geo. file
Hello, I am having trouble understanding how to generate a Gmsh mesh through Python, having already a ready geo. file.
The geo. file is called 8x8x8.geo and it is attached.
I have tried the following script on Python. It does work but unfortunately. If I change the lc (mesh size), the output file (msh. file) does not change and the number of volumetric tetrahedrons is always the same.
I want to be able to change the size of the mesh in Python (lc) and get back the number of volumetric elements created by that specific mesh size. The script written is the following:
import subprocess
#Set your desired mesh size
lc = 10
#Define the path to your Gmsh executable
gmsh_path = "C:\.......\gmsh.exe"
#Define the path to your Geo file
geo_file = "C:\.......\8x8x8.geo"
#Define the path for the output mesh file (MSH format)
output_mesh_file = "C:\......\output.msh"
#Construct the Gmsh command to generate the mesh
command = [gmsh_path, geo_file, "-3", "-clmax", str(lc), "-o", output_mesh_file]
#Run Gmsh to generate the mesh
subprocess.run(command)
The mesh file that I got out of this script is output. msh. In this file the number of volumetric tetrahedrons are 6913596.
If I change lc = 1, the number of volumetric tetrahedrons remains the same (still 6913596). My understanding is that if lc is lower, the number of volumetric tetrahedrons should increase.
Could you please help me with this? I am not sure how to change it.
Thank you