Python API: Changing "Sampling" in Distance Field throws error
Hi there,
I'm building a mesh using the Python API, v4.11.1. I need to refine near the wall on a particular curve, and thus am using a Distance field combined with a MathEval field. However, the default 20 discretization points along the curve is not enough for me; the mesh size needs to be more uniform at the surface:
I tried to change the number of discretization points to 40 by using the "Sampling" field, but this causes the script to crash - I think it is expecting a list, but I am providing an integer, as in line 46 in Tutorial 10: https://gitlab.onelab.info/gmsh/gmsh/blob/gmsh_4_11_1/tutorials/python/t10.py
Error message:
Traceback (most recent call last):
File "/home/saustin/Documents/exasim_new/Exasim/Applications/ionic_wind/mesh/min_example.py", line 11, in <module>
gmsh.model.mesh.field.setNumbers(4, "Sampling", 40) # Uncommenting this line throws an error
File "/home/saustin/.local/lib/python3.10/site-packages/gmsh.py", line 5149, in setNumbers
api_values_, api_values_n_ = _ivectordouble(values)
File "/home/saustin/.local/lib/python3.10/site-packages/gmsh.py", line 204, in _ivectordouble
if(len(o) and array.ndim != 1):
TypeError: object of type 'int' has no len()
Is this a bug, or am I doing something wrong?
Thanks, Sam
Edited by Sam Austin