meshpro / dmsh

:spider_web: Simple mesh generator inspired by distmesh.
GNU General Public License v3.0
210 stars 25 forks source link

Add fixed nodes coordinates #29

Closed lrosique closed 4 years ago

lrosique commented 4 years ago

Hi,

In my rectangular mesh I wanted to fix some nodes, two per side at 1/3rd of them, but with the optimisation process nodes are placed by the algorithm at various positions.

Is it possible to declare a vector of fixed nodes which is then completed by the algorithm to construct the mesh ? In particular on a circle, if I want to fix 8 nodes on the border at equal distance from each other it should still be possible.

Thank you in advance for your help !

NB : I can, once the nodes are generated, select the ones "near" the positions I wanted but it's not sufficient.

nschloe commented 4 years ago

You could as a workaround get the "near" vertices and move them to the desired positions.

lrosique commented 4 years ago

yes that's what I meant with my NB, but I wanted (if possible of course) an uniform mesh with my points. Because if the mesh is large, for instance dmsh.generate(dmsh.Rectangle(-1.0, +1.0, -1.0, +1.0), 1), the points I want are really far from any node.

Anyway I understand the difference between moving a vertice to the desired position and creating the mesh around some fixed points, so it should be distinct options indeed !

nschloe commented 4 years ago

Yes, it should be distinct options. Not possible yet, but I'll think about it.

nschloe commented 4 years ago

Okay, I just noticed the functionality is already there. Just add some more entries to feature_points of your geometry.