@@ -68,6 +68,39 @@ class AbstractModel {
6868 const AmiVector &dx, int ip, const AmiVector &sx,
6969 const AmiVector &sdx, AmiVector &sxdot) = 0;
7070
71+ /* *
72+ * @brief Residual function backward when running in steady state mode
73+ * @param t time
74+ * @param xB adjoint state
75+ * @param dxB time derivative of state (DAE only)
76+ * @param xBdot array to which values of the residual function will be
77+ * written
78+ */
79+ virtual void fxBdot_ss (const realtype t, const AmiVector &xB,
80+ const AmiVector &dxB, AmiVector &xBdot) = 0;
81+
82+ /* *
83+ * @brief Sparse Jacobian function backward, steady state case
84+ * @param JB sparse matrix to which values of the Jacobian will be written
85+ */
86+ virtual void fJSparseB_ss (SUNMatrix JB) = 0;
87+
88+ /* *
89+ * @brief Computes the sparse backward Jacobian for steadystate integration
90+ * and writes it to the model member
91+ * @param t timepoint
92+ * @param cj scalar in Jacobian
93+ * @param x Vector with the states
94+ * @param dx Vector with the derivative states
95+ * @param xB Vector with the adjoint states
96+ * @param dxB Vector with the adjoint derivative states
97+ * @param xBdot Vector with the adjoint state right hand side
98+ */
99+ virtual void writeSteadystateJB (const realtype t, realtype cj,
100+ const AmiVector &x, const AmiVector &dx,
101+ const AmiVector &xB, const AmiVector &dxB,
102+ const AmiVector &xBdot) = 0;
103+
71104 /* *
72105 * @brief Dense Jacobian function
73106 * @param t time
@@ -81,6 +114,22 @@ class AbstractModel {
81114 const AmiVector &dx, const AmiVector &xdot,
82115 SUNMatrix J) = 0;
83116
117+ /* *
118+ * @brief Dense Jacobian function
119+ * @param t time
120+ * @param cj scaling factor (inverse of timestep, DAE only)
121+ * @param x state
122+ * @param dx time derivative of state (DAE only)
123+ * @param xB Vector with the adjoint states
124+ * @param dxB Vector with the adjoint derivative states
125+ * @param xBdot Vector with the adjoint right hand side (unused)
126+ * @param JB dense matrix to which values of the jacobian will be written
127+ */
128+ virtual void fJB (const realtype t, realtype cj, const AmiVector &x,
129+ const AmiVector &dx, const AmiVector &xB,
130+ const AmiVector &dxB, const AmiVector &xBdot,
131+ SUNMatrix JB) = 0;
132+
84133 /* *
85134 * @brief Sparse Jacobian function
86135 * @param t time
@@ -94,6 +143,22 @@ class AbstractModel {
94143 const AmiVector &dx, const AmiVector &xdot,
95144 SUNMatrix J) = 0;
96145
146+ /* *
147+ * @brief Sparse Jacobian function
148+ * @param t time
149+ * @param cj scaling factor (inverse of timestep, DAE only)
150+ * @param x state
151+ * @param dx time derivative of state (DAE only)
152+ * @param xB Vector with the adjoint states
153+ * @param dxB Vector with the adjoint derivative states
154+ * @param xBdot Vector with the adjoint right hand side (unused)
155+ * @param JB dense matrix to which values of the jacobian will be written
156+ */
157+ virtual void fJSparseB (const realtype t, realtype cj, const AmiVector &x,
158+ const AmiVector &dx, const AmiVector &xB,
159+ const AmiVector &dxB, const AmiVector &xBdot,
160+ SUNMatrix JB) = 0;
161+
97162 /* *
98163 * @brief Diagonal Jacobian function
99164 * @param t time
0 commit comments