Python API wrong decimal seperator on export
The title may say it all, but when I try to create a mesh with the gmsh python api, the decimal seperator is a comma instead of a dot. Maybe this is because of my location and language settings (Germany == "," as decimal seperator). Below some information about my system and a script and its output.
Some System Information:
- OS: openSUSE Tumbleweed (Snapshot 20200701)
- System Language: German/Germany
- Kernel: x86_64 Linux 5.7.5-1-default
- Shell: bash 5.0.17
Script:
import gmsh
X = [0.1, 1.1, 1.1, 0.1]
Y = [0.1, 0.1, 1.1, 1.1]
gmsh.initialize()
model = gmsh.model
factory = model.occ
gmsh.option.setNumber("General.Terminal", 1)
model.add("example")
lines = []
points = []
for i in range(len(X)):
points.append(model.geo.addPoint(X[i], Y[i], 0))
for i in range(len(points)):
if i == len(points)-1:
lines.append(model.geo.addLine(points[i], points[0]))
else:
lines.append(model.geo.addLine(points[i], points[i+1]))
lns = gmsh.model.geo.addCurveLoop(lines)
surf = gmsh.model.geo.addPlaneSurface([lns])
gmsh.model.geo.synchronize()
#model.mesh.generate(2)
gmsh.write("test.msh")
gmsh.write("test.geo_unrolled")
""" THE FOLLOWING COMMAND CAN DISPLAY THE MODEL CORRECTLY"""
# gmsh.fltk.run()
gmsh.finalize()
Output: test.msh (Points only)
$MeshFormat
4,1 0 8
$EndMeshFormat
$Entities
4 4 1 0
1 0,1 0,1 0 0
2 1,1 0,1 0 0
3 1,1 1,1 0 0
4 0,1 1,1 0 0
1 0,09999999999999998 0,1 0 1,1 0,1 0 0 2 1 -2
2 1,1 0,09999999999999998 0 1,1 1,1 0 0 2 2 -3
3 0,1000000000000001 1,1 0 1,1 1,1 0 0 2 3 -4
4 0,1 0,1000000000000001 0 0,1 1,1 0 0 2 4 -1
1 0,09999999999999998 0,09999999999999998 0 1,1 1,1 0 0 4 1 2 3 4
$EndEntities
Output: test.geo_unrolled
cl__1 = 1e+22;
Point(1) = {0,1, 0,1, 0, cl__1};
Point(2) = {1,1, 0,1, 0, cl__1};
Point(3) = {1,1, 1,1, 0, cl__1};
Point(4) = {0,1, 1,1, 0, cl__1};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Line Loop(1) = {1, 2, 3, 4};
Plane Surface(1) = {1};