krober10nd / SeismicMesh

2D/3D serial and parallel triangular mesh generation tool for finite element methods.
https://seismicmesh.readthedocs.io/
GNU General Public License v3.0
129 stars 33 forks source link

dampening in Newton optmi. #157

Closed krober10nd closed 4 years ago

krober10nd commented 4 years ago

w_newton_method

w_newton_method2

nschloe commented 4 years ago

I don't quite understand. If you project your boundary nodes to the boundary, what good is repeating this five times?

krober10nd commented 4 years ago

Solving an optimization problem using multi-Newton type approach. Generally converges in less than 5 iterations.

nschloe commented 4 years ago

I don't know what you mean. What do you optimize? You project the mesh boundary nodes onto the boundary, right? Do you mean the Newton iteration you use to achieve that converges in 5 iterations, and you use some dampening?

nschloe commented 4 years ago

And what do you mean by "multi"-Newton?

krober10nd commented 4 years ago

https://github.com/krober10nd/SeismicMesh/pull/84#issuecomment-706766010

and per the original thesis where the method was documented

http://persson.berkeley.edu/thesis/persson-thesis-color.pdf

page 31 (in fact this is where it is suggested to iteratively repeat and lower the dampening coefficient).

There's other citations as well.

krober10nd commented 4 years ago

And what do you mean by "multi"-Newton?

I mean because you're finding the root of f(d) given that the vertex perturbation must be normal to the level-set (multi = multiple conditions).

nschloe commented 4 years ago

given that the vertex perturbation must be normal to the level-set

Sound more like steepest-descend, right? Newton won't be orthogonal to the level set, but that doesn't matter much.

Okay, if I understood you correctly now, you're using 5 steps of a dampened Newton method to project the points back to the domain boundary. Is this correct?

In dmsh, each domain is free to provide a boundary_step() method. This makes things a bit easier for cubes, balls etc. since you can project back to the boundary so easily. No need for Newton. It'd be my advice to the same for SeismicMesh. If the domains are getting more complex (e.g., unions etc.), Newton is handy.

krober10nd commented 4 years ago

Okay, if I understood you correctly now, you're using 5 steps of a dampened Newton method to project the points back to the domain boundary. Is this correct?

yep, that's correct.

In dmsh, each domain is free to provide a boundary_step() method. This makes things a bit easier for cubes, balls etc. since you can project back to the boundary so easily. No need for Newton. It'd be my advice to the same for SeismicMesh. If the domains are getting more complex (e.g., unions etc.), Newton is handy.

Interesting. I'll check it out. Thanks for the suggestion. I had some people complaining about dents so I found that this approach seemed to produce a dramatic improvement in the boundary shape.

nschloe commented 4 years ago

Projection to a cube is too easy if it's aligned with the axes: just min/max the coordinates. The nice thing about that it's fast and you don't have to think about newton convergence.

krober10nd commented 4 years ago

just min/max the coordinate

ah very clever, danke.

krober10nd commented 4 years ago

I think I'll leave the boundary projection step for each geometry on my to-do list and leave this more general expensive solution that I have here for now.

I like the idea of snapping geometry using min/max for the cube but for other geometries, it's not immediately obvious what to do.

krober10nd commented 3 years ago

In #167 I took a stab considering your recommendation to avoid the steepest descent/Newton boundary projection step for simple geometric primitives...cubes/rectangles.

I still need to work how best to do it in 3d efficiently.

https://github.com/krober10nd/SeismicMesh/blob/068b18e9c423db4b2d4a20fac7405f4f178ab9c8/SeismicMesh/geometry/signed_distance_functions.py#L197