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

Function CVDiagSolve

externalpackages/PVODE/source/cvdiag.cpp:249–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247**********************************************************************/
248
249static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector ycur,
250 N_Vector fcur)
251{
252 boole invOK;
253 real r;
254 CVDiagMem cvdiag_mem;
255
256 cvdiag_mem = (CVDiagMem) lmem;
257
258 /* If gamma has changed, update factor in M, and save gamma value */
259
260 if (gammasv != gamma) {
261 r = gamma / gammasv;
262 N_VInv(M, M);
263 N_VAddConst(M, -ONE, M);
264 N_VScale(r, M, M);
265 N_VAddConst(M, ONE, M);
266 invOK = N_VInvTest(M, M);
267 if (!invOK) return (1);
268
269 gammasv = gamma;
270 }
271
272 /* Apply M-inverse to b */
273 N_VProd(b, M, b);
274 return(0);
275}
276
277/*************** CVDiagFree ******************************************
278

Callers

nothing calls this directly

Calls 5

N_VInvFunction · 0.85
N_VAddConstFunction · 0.85
N_VScaleFunction · 0.85
N_VInvTestFunction · 0.85
N_VProdFunction · 0.85

Tested by

no test coverage detected