Repository navigation
Correct external process algebraic rows jacobian - #1095
Merged
Merged
Conversation
K20shores
force-pushed
the
develop-1094-external-process-algebraic-rows
branch
2 times, most recently
from
September 30, 2026 20:00
d666720 to
04e64da
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1095 +/- ##
=======================================
Coverage 96.13% 96.14%
=======================================
Files 58 58
Lines 4791 4825 +34
=======================================
+ Hits 4606 4639 +33
- Misses 185 186 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
K20shores
added a commit
to NCAR/musica
that referenced
this pull request
Oct 2, 2026
Move the micm pin to the NCAR/micm#1095 commit that reads the normalized error into a Real before std::pow. With C++23, nvc++ found std::pow(ScalarView<Real>, Real) ambiguous. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boulderdaze
approved these changes
Oct 5, 2026
K20shores
added this pull request to stack #1099
October 5, 2026 16:08
Make the Clear* methods public, because nvcc does not allow extended lambdas in private member functions. Make the cloud stub conserve mass. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Remove the cloud chemistry sweep and the fast-reaction test to keep the PR small. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
K20shores
force-pushed
the
develop-1094-external-process-algebraic-rows
branch
from
October 7, 2026 19:14
8f7f04a to
adcaaaa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1094
Before this PR, external model processes added their jacobian terms (
SubtractJacobianTerms) to the rows of algebraic variables, and the constraints (SubtractConstraintJacobian) then added their terms on top. However, the row of an algebraic variable in the jacobian should hold only the constraint's Jacobian terms. After this PR, micm still callsSubtractJacobianTermsfor all of the rows that a process affects, but it removes the entries in algebraic rows before the constraints add their terms.In math:
Split the state into two sets of indices,$D$ is the set of differential variables, and $A$ is the set of algebraic variables. Below, $M$ is the mass matrix (defined in solver builder in micm), $y$ is the state variables (concentrations, number concentration, radius, charge, etc), $y'$ is the time derivative of each variable. Without constraints $M=I$ , $I$ being the identity matrix, and then $y'$ is just the forcing.
We can describe each process that can affect the jacobian or forcing function as one of three things
The correct right-hand sides of the forcing uses the rate only in differential rows and the constraints only in algebraic rows
and then the correct jacobian similarly uses only the constraints in algebraic rows
Before this PR, we were incorrectly computing the jacobian on algebraic rows as
After this PR, we have the corrected jacobian