We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Using a SizingFieldBase instead of a float incurs a penalty of about 20% run time.
SizingFieldBase
import perfplot import pygalmesh def cell_size_float(n): pygalmesh.generate_mesh( pygalmesh.Ball([0.0, 0.0, 0.0], 1.0), cell_size=1 / n, verbose=False ) def cell_size_function(n): class Field(pygalmesh.SizingFieldBase): def eval(self, x): return 1 / n pygalmesh.generate_mesh( pygalmesh.Ball([0.0, 0.0, 0.0], 1.0), cell_size=Field(), verbose=False ) perfplot.show( setup=lambda n: n, kernels=[cell_size_float, cell_size_function], n_range=[2 ** k for k in range(6)], equality_check=None, relative_to=0, )