Skip to content

Fix code for manifolds in 2D.#230

Merged
jorgensd merged 2 commits into
mainfrom
dokken/2D-closest-point
Jun 10, 2026
Merged

Fix code for manifolds in 2D.#230
jorgensd merged 2 commits into
mainfrom
dokken/2D-closest-point

Conversation

@jorgensd

Copy link
Copy Markdown
Member

Remove premature stop of linesearch.
Add new test for 1D manifold in 2D space.
Fix initialization of initial guess on intervals

Remove premature stop of linesearch.
Add new test for 1D manifold in 2D space.
Fix initialization of initial guess on intervals
@jorgensd jorgensd requested a review from finsberg June 10, 2026 08:28
Comment thread tests/test_geometry.py Outdated
Co-authored-by: Jørgen Schartum Dokken <dokken92@gmail.com>
Comment thread src/scifem.cpp
for (std::size_t l = 0; l < tdim * gdim; l++)
jac_norm += J_buffer[l] * J_buffer[l];
T scaled_tol_grad = tol_grad * std::max(jac_norm, T(1));
T scaled_tol_grad = tol_grad * tol_grad * std::max(jac_norm, T(1));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you add an extra tol_grad here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to make the C++ and Python implementation equivalent, as we use linalg norm in python, but gradient squared in C++ (sqrt are expensive).

@jorgensd jorgensd merged commit bc1d3f2 into main Jun 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants