GMSH file not correlating to mesh

Hi Guys

Please refer to the at below code.
I am developing a mesh on Gmsh, there after reading the .msh file and developing a .txt file which can be read by Space Gass.

The resulting mesh from Gmsh is presented in the below image (the first one).
When reading the .msh file and developing the Space Gass txt file node 190 presents the same numerical values as per the second image, however the resulting mesh is not the same as what gmsh produces. Futhermore, if I open the .msh file it open the correct mesh. I suspect that I am missing somethings with regards to reading the .msh file. I have a few other pieces of code similar to this which do work without an issues. I have a hunch it may have to do with the “fragment” which I have used.

Note that node 190 i used as an example, the issue occurs in a few other places also.

Does anyone have any advice?

import gmsh
import sys
import math
import subprocess
 


###User inputs
R_overhang = 10 
R_tank = 9
R1 = 8
R2 = 7
R3 = 6
R4 = 5
square_outer = 25
slab_thickness = "0.5"
Pressure = "100"

min_mesh = 2
max_mesh = 2

File_Location = r'C:\Users\mishal.mohanlal\OneDrive - Aurecon Group\GitHub resources\Tank-Foundation-Mesh-Generator\Square Tank Foundation\Circle.msh'
strSGProgram = r'"C:\Program Files (x86)\SPACE GASS 14\sgwin.exe"' #Location of space Gass
strSGScript = r' -s "C:\Users\mishal.mohanlal\OneDrive - Aurecon Group\GitHub resources\Tank-Foundation-Mesh-Generator\Square Tank Foundation\import.txt"'
command = strSGProgram + strSGScript

###End of user inputs
assert R_overhang > R_tank > R1 > R2 > R3 > R4

gmsh.initialize()


gmsh.model.occ.addCircle(0,0,0,R_tank,0)
gmsh.model.occ.addCurveLoop([0],1)
gmsh.model.occ.addPlaneSurface([1],1) 

gmsh.model.occ.addCircle(0,0,0,R1,2)
gmsh.model.occ.addCurveLoop([2],3)
gmsh.model.occ.addPlaneSurface([3],2) 

gmsh.model.occ.addCircle(0,0,0,R2,4)
gmsh.model.occ.addCurveLoop([4],5)
gmsh.model.occ.addPlaneSurface([5],3)

gmsh.model.occ.addCircle(0,0,0,R3,6)
gmsh.model.occ.addCurveLoop([6],7)
gmsh.model.occ.addPlaneSurface([7],4) 

#Squares


delta = square_outer*0.1
#outer square
gmsh.model.occ.addRectangle(-square_outer/2,-square_outer/2,0,square_outer,square_outer,5)
#top left square
gmsh.model.occ.addRectangle(-square_outer/2,square_outer/2-delta,0,delta,delta,6)
#top right square
gmsh.model.occ.addRectangle(square_outer/2-delta,square_outer/2-delta,0,delta,delta,7)
#bottom left
gmsh.model.occ.addRectangle(-square_outer/2,-square_outer/2,0,delta,delta,8)
#bottom right
gmsh.model.occ.addRectangle(square_outer/2-delta,-square_outer/2,0,delta,delta,9)
#top rectange
gmsh.model.occ.addRectangle(-square_outer/2+delta,square_outer/2-delta,0,square_outer-delta,delta,10)
#bottom rectangle
gmsh.model.occ.addRectangle(-square_outer/2+delta,-square_outer/2,0,square_outer-delta,delta,11)
#Left rectangle
gmsh.model.occ.addRectangle(-square_outer/2,-square_outer/2+delta,0,delta,square_outer-delta,12)
#right rectangle
gmsh.model.occ.addRectangle(square_outer/2-delta,-square_outer/2+delta,0,delta,square_outer-delta,13)
frag = gmsh.model.occ.fragment([(2,1)],[(2,2),(2,3),(2,4),(2,5),(2,6),(2,7),(2,8),(2,9),(2,10),(2,11),(2,12),(2,13)])

# print(frag)

gmsh.model.occ.synchronize()
gmsh.option.setNumber('Mesh.MeshSizeMin', min_mesh)
gmsh.option.setNumber('Mesh.MeshSizeMax', max_mesh)



gmsh.model.mesh.generate(2)
gmsh.model.mesh.recombine()
gmsh.option.setNumber("Mesh.SubdivisionAlgorithm", 1)
gmsh.model.mesh.refine()


gmsh.option.setNumber("Mesh.MshFileVersion",2.2) 
gmsh.write("Circle.msh")
if '-nopopup' not in sys.argv:
    gmsh.fltk.run()

gmsh.finalize()```

How are you converting Circle.msh to .txt file ?
EDIT: I ran the code to create .msh file but faced -

Warning : Cannot apply Blossom: odd number of triangles (79) in surface 4
Warning : Cannot apply Blossom: odd number of triangles (63) in surface 10
Warning : Cannot apply Blossom: odd number of triangles (45) in surface 12
Warning : Cannot apply Blossom: odd number of triangles (113) in surface 15

There might be a chance that using Blossom Algorithm is resulting in error, consider using different algorithm.

Hi Violetus

Thanks, I think the issue comes with the Addcircle command, I a developed a quarter segment which can be mirrored in Space Gass and it works fine.