Skip to content

generic mesh size on parametric curves

Jonathan Lambrechts requested to merge mesh_size_parametric_curve_2nd_try into master

Here is a second try to prescribe mesh size along parametric curves. Now it works for geo+occ. a demo python script using it in 3 different scenarios is attached : curvemeshsizeparam.py

Points to discuss :

  • I added a function in the api : gmsh.model.mesh.setSizeAtParametricPoints, this function could be merged with "setSize" if an optional argument is added to setSize with the parametric coordinates
  • on GEdge, I added a member function prescribedMeshSizeAtParametricPoints, this function could be merged with Gentity::getSize if the the parametric coordinates are given to the getSize function (and getSize becomes virtual)
  • For the case of a geo model the mesh size prescribed at the Geo points defining the curve (see attached example) is taken into account only if the option mesh.characteristic_length_from_parametric_points is set at the time of the GEdge creation (or maybe at geo synchronization), not at the meshing time.
  • When both mesh.characteristic_length_from_parametric_points and mesh.characteristic_length_from_points are set, the resulting mesh size will be the minimum between the linear interpolation between the mesh size at the first and last points and the mesh size computed using the intermediate points. This makes sense but may be surprising.
  • Something similar could be done for surfaces but it would requires a triangulation of the parametric space. At least for discrete surfaces, it could be useful (but I have no need for it at the moment).
  • Everything could be implemented in the Field framework if parametric coordinates were passed to the Fields but I fear defining fields for each GEntity would be tedious from the user point of view. I do not think this would be the best approach.
Edited by Jonathan Lambrechts

Merge request reports