MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / CVPrepareNextStep

Function CVPrepareNextStep

externalpackages/PVODE/source/cvode.cpp:2230–2264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2228******************************************************************/
2229
2230static 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

Callers 1

cvode.cppFile · 0.85

Calls 6

N_VScaleFunction · 0.85
RPowerRFunction · 0.85
CVSetEtaFunction · 0.85
CVComputeEtaqm1Function · 0.85
CVComputeEtaqp1Function · 0.85
CVChooseEtaFunction · 0.85

Tested by

no test coverage detected