`MathEvalAniso` field causes hang when dependent upon another field
I'm trying to use a MathEvalAniso
field that is dependent upon the output of another field. However, when doing this the process hangs indefinitely immediately after starting meshing.
I'm using gmsh 4.12.2, via pip. OS is Linux.
The following simple example reproduces the issue for me:
import gmsh
def main():
# If `False`, the program will run successfully and generate an anisotropic mesh.
# If `True`, the program hangs upon starting 1D meshing, after logging:
# Info : [ 0%] Meshing curve 1 (Line)
trigger_breakage: bool = True
gmsh.initialize()
gmsh.model.occ.addBox(0, 0, 0, 1, 1, 1)
gmsh.model.occ.synchronize()
field_input: int = gmsh.model.mesh.field.add("MathEval", 1)
gmsh.model.mesh.field.setString(field_input, "F", "0.1")
assert field_input == 1
field_aniso: int = gmsh.model.mesh.field.add("MathEvalAniso")
if trigger_breakage:
gmsh.model.mesh.field.setString(field_aniso, "M11", "1 / (F1 + 0.1)^2")
else:
gmsh.model.mesh.field.setString(field_aniso, "M11", "1 / (0.2)^2")
gmsh.model.mesh.field.setString(field_aniso, "M12", "0")
gmsh.model.mesh.field.setString(field_aniso, "M13", "0")
gmsh.model.mesh.field.setString(field_aniso, "M22", "1 / (0.1)^2")
gmsh.model.mesh.field.setString(field_aniso, "M23", "0")
gmsh.model.mesh.field.setString(field_aniso, "M33", "1 / (1)^2")
gmsh.model.mesh.field.setAsBackgroundMesh(field_aniso)
gmsh.option.setNumber("Mesh.Algorithm", 7)
gmsh.model.mesh.generate(2)
gmsh.fltk.run()
gmsh.finalize()
if __name__ == "__main__":
main()