Enable use of different Jacobian implementations with 1D solver #1836
+951
−486
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.
Changes proposed in this pull request
PreconditionerBase
(now renamedSystemJacobian
) to be able represent both preconditioners (Sim1D
(MultiJac
to be a derived class ofPreconditionerBase
and avoid direct inheritance fromBandMatrix
OneDim
to allow setting the implementation ofSystemJacobian
to useSystemJacobian
implementation that uses Eigen's sparse direct LU factorizationOneDim
. The new perturbation sizes are based on those used by SUNDIALS, and generally improve the quality of the Jacobian (reducing the number of residual and Jacobian evaluations required to converge).If applicable, fill in the issue number this pull request is fixing
This is preliminary work toward several planned improvements:
If applicable, provide an example illustrating new features this pull request is introducing
Besides supporting these other improvements, using the sparse LU solver provided by Eigen along with the improved Jacobian perturbations provides some significant speedups to the 1D solver. Using the Blanquart et al (2018) mechanism from here (194 species, 1156 reactions), I get the following timings for a laminar flame speed calculation:
Checklist
scons build
&scons test
) and unit tests address code coverage