[Gmsh] A suggested improvement to Field::Distance!

Gavin Ridley gavin.keith.ridley at gmail.com
Wed Apr 17 21:15:44 CEST 2019


Hi,

Seems like the compute distance function in Field.cpp could be quite
improved when using OpenCASCADE surfaces by using
GeomAPI_ProjectPointOnSurf, which is provided by OpenCASCADE. I recently
needed to get a good Distance calculation to make a 3D mesh with a boundary
layer. It seems that the current implementation puts several points on the
surface (20, hardcoded), which leads to very oscillatory values of the
Distance field on slightly long surfaces. I managed to get a satisfactory
mesh by cranking this number up to 400, then recompiling.

Another idea would be adaptively adding more points on long surfaces, so
that meshes like the attached picture don't happen. This could probably be
done by drawing a bounding box for the whole geometry, and then computing
the number of points on the surface so that the error in calculating
distance to a surface is bounded by some (maybe) user-adjustable threshold.

Thanks for gmsh! It's a great tool!

Gavin Ridley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190417/e39d8464/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stripey_boi.png
Type: image/png
Size: 323911 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190417/e39d8464/attachment-0001.png>


More information about the gmsh mailing list