Exemple #1
0
int PVBBDPSol(integer N, real t, N_Vector y, N_Vector fy,
	      N_Vector vtemp, real gamma, N_Vector ewt,
	      real delta, long int *nfePtr, N_Vector r,
	      int lr, void *P_data, N_Vector z)
{
  PVBBDData pdata;

  pdata = (PVBBDData)P_data;

  /* Copy r to z, then do backsolve and return */
  N_VScale(ONE, r, z);
  BandBacksolve(savedP, pivots, z);
 
  return(0);
}
Exemple #2
0
static int IDABandSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight,
                        N_Vector ycur, N_Vector ypcur, N_Vector rrcur)
{
  IDABandMem idaband_mem;
  realtype *bd;

  idaband_mem = (IDABandMem) lmem;
  
  bd = N_VGetArrayPointer(b);
  BandBacksolve(JJ, pivots, bd);

  /* Scale the correction to account for change in cj. */
  if (cjratio != ONE) N_VScale(TWO/(ONE + cjratio), b, b);
  
  last_flag = 0;
  return(0);
}
static int CVBBDPrecSolve(realtype t, N_Vector y, N_Vector fy, 
                          N_Vector r, N_Vector z, 
                          realtype gamma, realtype delta,
                          int lr, void *bbd_data, N_Vector tmp)
{
  CVBBDPrecData pdata;
  realtype *zd;

  pdata = (CVBBDPrecData) bbd_data;

  /* Copy r to z, then do backsolve and return */
  N_VScale(ONE, r, z);
  
  zd = N_VGetArrayPointer(z);

  BandBacksolve(savedP, pivots, zd);

  return(0);
}
static int CVBandSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight,
                       N_Vector ycur, N_Vector fcur)
{
  CVBandMem cvband_mem;
  realtype *bd;

  cvband_mem = (CVBandMem) lmem;

  bd = N_VGetArrayPointer(b);

  BandBacksolve(M, pivots, bd);

  /* If CV_BDF, scale the correction to account for change in gamma */
  if ((lmm == CV_BDF) && (gamrat != ONE)) {
    N_VScale(TWO/(ONE + gamrat), b, b);
  }

  last_flag = CVBAND_SUCCESS;
  return(0);
}
static int CVBandPrecSolve(realtype t, N_Vector y, N_Vector fy,
                           N_Vector r, N_Vector z,
                           realtype gamma, realtype delta,
                           int lr, void *bp_data, N_Vector tmp)
{
    CVBandPrecData pdata;
    realtype *zd;

    /* Assume matrix and pivots have already been allocated. */
    pdata = (CVBandPrecData) bp_data;

    /* Copy r to z. */
    N_VScale(ONE, r, z);

    /* Do band backsolve on the vector z. */
    zd = N_VGetArrayPointer(z);

    BandBacksolve(savedP, pivots, zd);

    return(0);
}