Skip to content

fix: correct loop bounds and rn[] indexing in numerical_jacobian.H#3

Merged
James471 merged 1 commit into
James471:feature/radiation-VODEfrom
chongchonghe:chong/micro-photo-fix
Jun 2, 2026
Merged

fix: correct loop bounds and rn[] indexing in numerical_jacobian.H#3
James471 merged 1 commit into
James471:feature/radiation-VODEfrom
chongchonghe:chong/micro-photo-fix

Conversation

@chongchonghe
Copy link
Copy Markdown

The radiation loop had two bugs: the upper bound NumRadEqs should be net_ienuc + NumRadEqs (the loop never executed since net_ienuc+1 > NumRadEqs), and state.rn[i-1] / state.rn[j-1] should be indexed relative to net_ienuc to correctly map VODE 1-based indices to the rn[] array. The inner loop upper bound was also off by one (<= i + N<= i + N - 1).

The radiation loop had two bugs: the upper bound `NumRadEqs` should be
`net_ienuc + NumRadEqs` (the loop never executed since net_ienuc+1 > NumRadEqs),
and `state.rn[i-1]` / `state.rn[j-1]` should be indexed relative to net_ienuc
to correctly map VODE 1-based indices to the rn[] array.  The inner loop
upper bound was also off by one (`<= i + N` → `<= i + N - 1`).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@James471
Copy link
Copy Markdown
Owner

James471 commented Jun 2, 2026

The numerical Jacobian implementation is incomplete, the radiation derivatives are never calculated. We also don't use it in any of our tests.

@James471 James471 merged commit b66c77e into James471:feature/radiation-VODE Jun 2, 2026
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