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

Function CVStep

externalpackages/PVODE/source/cvode.cpp:1341–1369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1339********************************************************************/
1340
1341static int CVStep(CVodeMem cv_mem)
1342{
1343 real saved_t, dsm;
1344 int ncf, nef, nflag, kflag;
1345 boole passed;
1346
1347 saved_t = tn;
1348 ncf = nef = 0;
1349 nflag = FIRST_CALL;
1350
1351 if ((nst > 0) && (hprime != h)) CVAdjustParams(cv_mem);
1352
1353 /* Looping point for attempts to take a step */
1354 loop {
1355 CVPredict(cv_mem);
1356 CVSet(cv_mem);
1357
1358 nflag = CVnls(cv_mem, nflag);
1359 kflag = CVHandleNFlag(cv_mem, &nflag, saved_t, &ncf);
1360 if (kflag == PREDICT_AGAIN) continue;
1361 if (kflag != DO_ERROR_TEST) return(kflag);
1362 /* Return if nonlinear solve failed and recovery not possible. */
1363
1364 passed = CVDoErrorTest(cv_mem, &nflag, &kflag, saved_t, &nef, &dsm);
1365 if ((!passed) && (kflag == REP_ERR_FAIL)) return(kflag);
1366 /* Return if error test failed and recovery not possible. */
1367 if (passed) break;
1368 /* Retry step if error test failed, nflag == PREV_ERR_FAIL */
1369 }
1370
1371 /* Nonlinear system solve and error test were both successful;
1372 update data, and consider change of step and/or order */

Callers 1

CVodeFunction · 0.85

Calls 6

CVAdjustParamsFunction · 0.85
CVPredictFunction · 0.85
CVSetFunction · 0.85
CVnlsFunction · 0.85
CVHandleNFlagFunction · 0.85
CVDoErrorTestFunction · 0.85

Tested by

no test coverage detected