[API] Access entity parametrization when reading a .msh
Hi,
When using the (python or julia) API to build a mesh, I can access the parametrization of the current model entities (gmsh.model.getValue
etc) and everything works fine. However, when reading a .msh
file (containing the Entities
block), the function gmsh.model.getValue
doesn't return the expected results. Is this expected? Am I doing something wrong? Here is a MWE.
In julia:
# Step 1: build cad/mesh
gmsh.initialize()
gmsh.model.add("mwe")
A = gmsh.model.geo.addPoint(1.0, 0.0, 0.0)
B = gmsh.model.geo.addPoint(0.0, 1.0, 0.0)
O = gmsh.model.geo.addPoint(0.0, 0, 0.0)
AOB = gmsh.model.geo.addCircleArc(A, O, B)
gmsh.model.geo.synchronize()
@show gmsh.model.getValue(1, AOB, [0.0]) # -> [1.0, 0.0, 0.0]
@show gmsh.model.getValue(1, AOB, [1.0]) # -> [6.123233995736766e-17, 1.0, 0.0]
gmsh.model.mesh.generate(1)
gmsh.write("mesh.msh")
gmsh.finalize()
# Step 2: read cad/mesh
gmsh.initialize()
gmsh.open("mesh.msh")
entities = gmsh.model.getEntities(1)
_, AOB = entities[1]
@show gmsh.model.getValue(1, AOB, [0.0]) # -> [0.0, 0.0, 0.0]
@show gmsh.model.getValue(1, AOB, [1.0]) # -> [0.0, 0.0, 0.0]
gmsh.finalize()
In python:
# Step 1: build cad/mesh
gmsh.initialize()
gmsh.model.add("mwe")
A = gmsh.model.geo.addPoint(1.0, 0.0, 0.0)
B = gmsh.model.geo.addPoint(0.0, 1.0, 0.0)
O = gmsh.model.geo.addPoint(0.0, 0, 0.0)
AOB = gmsh.model.geo.addCircleArc(A, O, B)
gmsh.model.geo.synchronize()
print(gmsh.model.getValue(1, AOB, [0.0])) # -> [1. 0. 0.]
print(gmsh.model.getValue(1, AOB, [1.0])) # -> [6.123234e-17 1.000000e+00 0.000000e+00]
gmsh.model.mesh.generate(1)
gmsh.write("mesh.msh")
gmsh.finalize()
# Step 2: read cad/mesh
gmsh.initialize()
gmsh.open("mesh.msh")
entities = gmsh.model.getEntities(1)
_, AOB = entities[0]
print(gmsh.model.getValue(1, AOB, [0.0])) # -> [0. 0. 0.]
print(gmsh.model.getValue(1, AOB, [1.0])) # -> [0. 0. 0.]
gmsh.finalize()