Skip to content

Implement cross-reactor Jacobian terms for preconditioners#2113

Open
speth wants to merge 9 commits into
Cantera:mainfrom
speth:connector-jacobian
Open

Implement cross-reactor Jacobian terms for preconditioners#2113
speth wants to merge 9 commits into
Cantera:mainfrom
speth:connector-jacobian

Conversation

@speth
Copy link
Copy Markdown
Member

@speth speth commented May 8, 2026

Changes proposed in this pull request

  • Add cross-reactor terms to Jacobians for IdealGasMoleReactor and IdealGasConstPressureMoleReactor.
  • Add ExtensibleReactor interface for setting Jacobian elements (get_jacobian_elements)
  • Add ReactorNet.jacobian and ReactorNet.finite_difference_jacobian accessors for full-network Jacobians (in contrast to just the reactor-local parts available on each Reactor

If applicable, fill in the issue number this pull request is fixing

AI Statement (required)

  • Extensive use of generative AI.
    Significant portions of code or documentation were generated with AI, including logic and implementation decisions. All generated code and documentation were reviewed and understood by the contributor. Implemented using Claude Code (Sonnet 4.6) and OpenAI Codex (ChatGPT-5.5).

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • AI Statement is included
  • The pull request is ready for review

@speth speth added the Reactors label May 8, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 82.83582% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.75%. Comparing base (4be08e6) to head (0ce9b23).
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
src/zeroD/FlowDevice.cpp 67.85% 6 Missing and 3 partials ⚠️
src/zeroD/IdealGasMoleReactor.cpp 89.55% 2 Missing and 5 partials ⚠️
src/zeroD/flowControllers.cpp 63.15% 3 Missing and 4 partials ⚠️
interfaces/cython/cantera/delegator.pyx 66.66% 5 Missing ⚠️
src/zeroD/IdealGasConstPressureMoleReactor.cpp 91.11% 1 Missing and 3 partials ⚠️
src/zeroD/Reactor.cpp 63.63% 0 Missing and 4 partials ⚠️
include/cantera/zeroD/ReactorBase.h 66.66% 3 Missing ⚠️
include/cantera/zeroD/Wall.h 0.00% 3 Missing ⚠️
include/cantera/base/Delegator.h 71.42% 1 Missing and 1 partial ⚠️
include/cantera/zeroD/FlowDevice.h 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2113      +/-   ##
==========================================
+ Coverage   77.69%   77.75%   +0.06%     
==========================================
  Files         452      452              
  Lines       53203    53467     +264     
  Branches     8864     8920      +56     
==========================================
+ Hits        41335    41574     +239     
- Misses       8867     8879      +12     
- Partials     3001     3014      +13     

☔ 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.

speth and others added 6 commits May 13, 2026 12:26
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Anthony Walker <walkanth@oregonstate.edu>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@speth speth force-pushed the connector-jacobian branch 3 times, most recently from 59700e7 to 5c555b6 Compare May 14, 2026 00:09
@speth speth force-pushed the connector-jacobian branch from 5c555b6 to 0ce9b23 Compare May 14, 2026 01:47
@speth speth marked this pull request as ready for review May 14, 2026 03:16
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.

I believe that there should be one sample file per application. I.e.., my preference would be to rename the pre-existing file to preconditioned_ignition.py and add new content as preconditioned_network.py or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Addition of Jacobian Preconditioning Functionality to Cantera.

2 participants