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

Function CVAdamsStart

externalpackages/PVODE/source/cvode.cpp:1655–1674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1653******************************************************************/
1654
1655static real CVAdamsStart(CVodeMem cv_mem, real m[])
1656{
1657 real hsum, xi_inv, sum;
1658 int i, j;
1659
1660 hsum = h;
1661 m[0] = ONE;
1662 for (i=1; i <= q; i++) m[i] = ZERO;
1663 for (j=1; j < q; j++) {
1664 if ((j==q-1) && (qwait == 1)) {
1665 sum = CVAltSum(q-2, m, 2);
1666 tq[1] = m[q-2] / (q * sum);
1667 }
1668 xi_inv = h / hsum;
1669 for (i=j; i >= 1; i--) m[i] += m[i-1] * xi_inv;
1670 hsum += tau[j];
1671 /* The m[i] are coefficients of product(1 to j) (1 + x/xi_i) */
1672 }
1673 return(hsum);
1674}
1675
1676/****************** CVAdamsFinish *******************************
1677

Callers 1

CVSetAdamsFunction · 0.85

Calls 1

CVAltSumFunction · 0.85

Tested by

no test coverage detected