|
31 | 31 |
|
32 | 32 | ### evaluate_pds ###################################################### |
33 | 33 | # evaluate_pds is used in out-of-place implementations to evaluate |
34 | | -# the production and destruction terms |
| 34 | +# the production and destruction terms |
35 | 35 | @inline function evaluate_pds(f::PDSFunction, u, p, t) |
36 | 36 | P = f.p(u, p, t) |
37 | 37 | d = f.d(u, p, t) |
|
55 | 55 | end |
56 | 56 |
|
57 | 57 | ### lincomb and lincomb! ############################################### |
58 | | -# These functions are used to compute linear combinations of production |
| 58 | +# These functions are used to compute linear combinations of production |
59 | 59 | # matrices and/or destruction vectors. |
60 | 60 |
|
61 | 61 | # out-of-place versions |
|
97 | 97 | return nothing |
98 | 98 | end |
99 | 99 |
|
100 | | -# in-place version for sparse matrices |
| 100 | +# in-place version for sparse matrices |
101 | 101 | @muladd @generated function lincomb!(dest::SparseMatrixCSC, pairs...) |
102 | 102 | n = length(pairs) ÷ 2 |
103 | 103 | nz_names = [Symbol("nz_", i) for i in 1:n] |
@@ -188,10 +188,10 @@ end |
188 | 188 | end |
189 | 189 |
|
190 | 190 | ### build_mprk_matrix ############################################################ |
191 | | -# These functions build the system matrix M that needs to be solved in each |
| 191 | +# These functions build the system matrix M that needs to be solved in each |
192 | 192 | # Patankar step. |
193 | 193 |
|
194 | | -# out-of-place for dense matrices |
| 194 | +# out-of-place for dense matrices |
195 | 195 | function build_mprk_matrix(P, sigma, dt, d = nothing) |
196 | 196 | # re-use the in-place version implemented below |
197 | 197 | M = similar(P) |
|
723 | 723 | tmp = u - σ |
724 | 724 | atmp = calculate_residuals(tmp, uprev, u, integrator.opts.abstol, |
725 | 725 | integrator.opts.reltol, integrator.opts.internalnorm, t) |
726 | | - integrator.EEst = integrator.opts.internalnorm(atmp, t) |
| 726 | + set_EEst!(integrator, integrator.opts.internalnorm(atmp, t)) |
727 | 727 |
|
728 | 728 | integrator.u = u |
729 | 729 | end |
|
838 | 838 | # Now tmp stores error residuals |
839 | 839 | calculate_residuals!(tmp, σ, uprev, u, integrator.opts.abstol, |
840 | 840 | integrator.opts.reltol, integrator.opts.internalnorm, t, |
841 | | - False()) |
842 | | - integrator.EEst = integrator.opts.internalnorm(tmp, t) |
| 841 | + Serial()) |
| 842 | + set_EEst!(integrator, integrator.opts.internalnorm(tmp, t)) |
843 | 843 | end |
844 | 844 |
|
845 | 845 | ### MPRK43 ##################################################################################### |
@@ -1131,7 +1131,7 @@ end |
1131 | 1131 | tmp = u - σ |
1132 | 1132 | atmp = calculate_residuals(tmp, uprev, u, integrator.opts.abstol, |
1133 | 1133 | integrator.opts.reltol, integrator.opts.internalnorm, t) |
1134 | | - integrator.EEst = integrator.opts.internalnorm(atmp, t) |
| 1134 | + set_EEst!(integrator, integrator.opts.internalnorm(atmp, t)) |
1135 | 1135 |
|
1136 | 1136 | integrator.u = u |
1137 | 1137 | end |
@@ -1275,8 +1275,8 @@ end |
1275 | 1275 | # Now tmp2 stores error residuals |
1276 | 1276 | calculate_residuals!(tmp2, tmp, uprev, u, integrator.opts.abstol, |
1277 | 1277 | integrator.opts.reltol, integrator.opts.internalnorm, t, |
1278 | | - False()) |
1279 | | - integrator.EEst = integrator.opts.internalnorm(tmp2, t) |
| 1278 | + Serial()) |
| 1279 | + set_EEst!(integrator, integrator.opts.internalnorm(tmp2, t)) |
1280 | 1280 | end |
1281 | 1281 |
|
1282 | 1282 | ######################################################################################## |
0 commit comments