tataratat / splinepy

Library for prototyping spline geometries of arbitrary dimensions and degrees, and IGA
https://tataratat.github.io/splinepy
Other
47 stars 13 forks source link

Levenberg-Marquart + SLSQP for Proximity #394

Closed jzwar closed 5 months ago

jzwar commented 7 months ago

Overview

Adds Levenberg-Marquart and SLSQP for proximity. Current implementation wouldn't work for some situations (see #389). Source for SLSQP is from current scipy's fortran version. To avoid difficulties of fortran-compiler-setup in CI systems, the source is translated to c using f2c. Then, removed some static variables and add const keywords.

Now, the search looks like this:

Initial guess
|
Newton
|
Converged? -- yes -- return
|
No
|
Reset initial guess, max_iterations *= 5
|
SLSQP
|
Converged? -- yes -- return
|
No
|
Reset initial guess, max_iterations *= 5
|
LM

Also, SLSQP can incorporate bounds. Nice.

Addressed Issues

Checklists

j042 commented 7 months ago

super cool!

j042 commented 6 months ago

Do you have scripts/notes of the origin of this implementation?

j042 commented 6 months ago

never mind, found it in #389

j042 commented 6 months ago

one thing to note in general is that we probably had to call system.ResetRowOrder(); at each iteration.

j042 commented 6 months ago

one thing to note in general is that we probably had to call system.ResetRowOrder(); at each iteration.

On the other hand, it would have iterated through this order and reordered it, so maybe it is irrelevant

j042 commented 5 months ago

If you get a chance, I'd appreciate if you can take a look at proximity.hpp / proximity.cpp @danielwolff1 :)

danielwolff1 commented 5 months ago

Thanks for incorporating the changes, from my point of view this can be merged! 🚀

j042 commented 5 months ago

Thanks for the review @danielwolff1 !