| 2228 | ******************************************************************/ |
| 2229 | |
| 2230 | static void CVPrepareNextStep(CVodeMem cv_mem, real dsm) |
| 2231 | { |
| 2232 | real etaqm1, etaq, etaqp1; |
| 2233 | |
| 2234 | /* If etamax = 1, defer step size or order changes */ |
| 2235 | if (etamax == ONE) { |
| 2236 | qwait = MAX(qwait, 2); |
| 2237 | qprime = q; |
| 2238 | hprime = h; |
| 2239 | eta = ONE; |
| 2240 | etamax = (nst <= SMALL_NST) ? ETAMX2 : ETAMX3; |
| 2241 | N_VScale(ONE/tq[2], acor, acor); |
| 2242 | return; |
| 2243 | } |
| 2244 | |
| 2245 | /* etaq is the ratio of new to old h at the current order */ |
| 2246 | etaq = ONE /(RPowerR(BIAS2*dsm,ONE/L) + ADDON); |
| 2247 | |
| 2248 | /* If no order change, adjust eta and acor in CVSetEta and return */ |
| 2249 | if (qwait != 0) { |
| 2250 | eta = etaq; |
| 2251 | qprime = q; |
| 2252 | CVSetEta(cv_mem); |
| 2253 | return; |
| 2254 | } |
| 2255 | |
| 2256 | /* If qwait = 0, consider an order change. etaqm1 and etaqp1 are |
| 2257 | the ratios of new to old h at orders q-1 and q+1, respectively. |
| 2258 | CVChooseEta selects the largest; CVSetEta adjusts eta and acor */ |
| 2259 | qwait = 2; |
| 2260 | etaqm1 = CVComputeEtaqm1(cv_mem); |
| 2261 | etaqp1 = CVComputeEtaqp1(cv_mem); |
| 2262 | CVChooseEta(cv_mem, etaqm1, etaq, etaqp1); |
| 2263 | CVSetEta(cv_mem); |
| 2264 | } |
| 2265 | |
| 2266 | /***************** CVSetEta *************************************** |
| 2267 |
no test coverage detected