Skip to content

Logger#1070

Open
RemDelaporteMathurin wants to merge 19 commits intofenicsxfrom
logger
Open

Logger#1070
RemDelaporteMathurin wants to merge 19 commits intofenicsxfrom
logger

Conversation

@RemDelaporteMathurin
Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin commented Feb 13, 2026

Description

Do not merge before #1060

Summary

Adds a default custom monitor to the SNES solver. It also adds a custom convergence test for more control.

7:32.096] [info] Requesting connectivity (1, 0) - (0, 0)
[2026-02-13 16:17:32.097] [info] SNES iter=0 ; rnorm=1.00312e+06 (atol=1e-05) ; relative_residual=inf (rtol=1e-10) ; stepsize_rel=inf (stol=1.49012e-10)
[2026-02-13 16:17:32.126] [info] SNES iter=1 ; rnorm=3.63856e-06 (atol=1e-05) ; relative_residual=3.62723e-12 (rtol=1e-10) ; stepsize_rel=4.05216e-02 (stol=1.49012e-10)
[2026-02-13 16:17:32.134] [info] Requesting connectivity (0, 0) - (1, 0)
[2026-02-13 16:17:32.134] [info] Requesting connectivity (1, 0) - (0, 0)
[2026-02-13 16:17:32.134] [info] Requesting connectivity (0, 0) - (1, 0)
[2026-02-13 16:17:32.134] [info] Requesting connectivity (1, 0) - (0, 0)
[2026-02-13 16:17:32.135] [info] SNES iter=0 ; rnorm=8.76546e+05 (atol=1e-05) ; relative_residual=inf (rtol=1e-10) ; stepsize_rel=inf (stol=1.49012e-10)
[2026-02-13 16:17:32.182] [info] SNES iter=1 ; rnorm=5.06478e-06 (atol=1e-05) ; relative_residual=5.77811e-12 (rtol=1e-10) ; stepsize_rel=3.46456e-02 (stol=1.49012e-10)
[2026-02-13 16:17:32.190] [info] Requesting connectivity (0, 0) - (1, 0)

Usage:

Simply set the log level to INFO/DEBUG

from dolfinx import log

log.set_log_level(log.LogLevel.INFO)

Related Issues

closing #1062

Motivation and Context

This gives users better understanding on the solver behaviour by logging norms and tolerances for the SNES iterations and KSP iterations

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🔨 Code refactoring (no functional changes, no API changes)
  • 📝 Documentation update
  • ✅ Test update (adding missing tests or correcting existing tests)
  • 🔧 Build/CI configuration change

Testing

  • All existing tests pass locally (pytest)
  • I have added new tests that prove my fix is effective or that my feature works

Code Quality Checklist

  • My code follows the code style of this project (Ruff formatted: ruff format .)
  • My code passes linting checks (ruff check .)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Documentation

  • I have updated the documentation accordingly (if applicable)
  • I have added docstrings to new functions/classes following the project conventions

Breaking Changes

Screenshots/Examples

Additional Notes

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 93.06931% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.82%. Comparing base (fcda1ad) to head (08f01a6).
⚠️ Report is 3 commits behind head on fenicsx.

Files with missing lines Patch % Lines
src/festim/hydrogen_transport_problem.py 91.66% 5 Missing ⚠️
src/festim/helpers.py 93.75% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           fenicsx    #1070      +/-   ##
===========================================
- Coverage    94.90%   94.82%   -0.09%     
===========================================
  Files           44       44              
  Lines         3102     3170      +68     
===========================================
+ Hits          2944     3006      +62     
- Misses         158      164       +6     

☔ View full report in Codecov by Sentry.
📢 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.

@RemDelaporteMathurin RemDelaporteMathurin linked an issue Feb 13, 2026 that may be closed by this pull request
@RemDelaporteMathurin
Copy link
Collaborator Author

In order to propagate the change to the mixed domain class I need #1060

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.

Improved logger for SNES solver

2 participants