Skip to content

Optionally accept energy decrease in gradient-norm line search mode - #122

Merged
fsichetti merged 1 commit into
polyfem:mainfrom
fsichetti:energy-decrease-option
Oct 22, 2026
Merged

fsichetti merged 1 commit into
polyfem:mainfrom
fsichetti:energy-decrease-option

Conversation

@fsichetti

Copy link
Copy Markdown
Contributor

When Backtracking compares gradient norms (energy below use_grad_norm_tol), it can fail to accept any step near convergence: the gradient norm plateaus while the energy is still decreasing, and the solve aborts.

Add line_search/accept_energy_decrease_in_grad_mode (default false). When true, a step is also accepted in gradient-norm mode if it decreases the energy. With the default, behavior is unchanged.

This option was used in the experiments for the ESP potential.

When Backtracking compares gradient norms (energy below use_grad_norm_tol),
it can fail to accept any step near convergence: the gradient norm plateaus
while the energy is still decreasing, and the solve aborts.

Add line_search/accept_energy_decrease_in_grad_mode (default false). When
true, a step is also accepted in gradient-norm mode if it decreases the
energy. With the default, behavior is unchanged.
@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.48%. Comparing base (da4e7fe) to head (4d49826).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #122      +/-   ##
==========================================
+ Coverage   79.45%   79.48%   +0.02%     
==========================================
  Files          55       55              
  Lines        2940     2944       +4     
  Branches      377      378       +1     
==========================================
+ Hits         2336     2340       +4     
  Misses        604      604              
Flag Coverage Δ
polysolve 79.48% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fsichetti
fsichetti merged commit 5f4903c into polyfem:main Oct 22, 2026
17 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.

1 participant