mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
[Numerics] Make sparse Jacobian accessible from Python
This commit is contained in:
parent
9fa3dda0a7
commit
74340f8e03
@ -20,6 +20,7 @@ cdef extern from "cantera/numerics/EigenSparseJacobian.h" namespace "Cantera":
|
||||
CxxEigenSparseJacobian() except +translate_exception
|
||||
void printPreconditioner()
|
||||
CxxSparseMatrix matrix() except +translate_exception
|
||||
CxxSparseMatrix jacobian() except +translate_exception
|
||||
|
||||
cdef extern from "cantera/numerics/AdaptivePreconditioner.h" namespace "Cantera":
|
||||
cdef cppclass CxxAdaptivePreconditioner "Cantera::AdaptivePreconditioner" \
|
||||
|
@ -86,6 +86,14 @@ cdef class EigenSparseJacobian(SystemJacobian):
|
||||
cdef CxxSparseMatrix smat = self.sparse_jac.matrix()
|
||||
return get_from_sparse(smat, smat.rows(), smat.cols())
|
||||
|
||||
property jacobian:
|
||||
"""
|
||||
Property to retrieve the latest Jacobian.
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef CxxSparseMatrix smat = self.sparse_jac.jacobian()
|
||||
return get_from_sparse(smat, smat.rows(), smat.cols())
|
||||
|
||||
|
||||
cdef class EigenSparseDirectJacobian(EigenSparseJacobian):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user