53 int *ipc,
double *rpc,
54 double *ac,
double *cc,
double *fc,
55 double *x,
double *p,
double *ap,
double *r,
56 int *
itmax,
int *iters,
57 double *
errtol,
double *omega,
58 int *iresid,
int *iadjoint) {
60 double rsnrm, pAp, denom;
61 double rhok1, rhok2, alpha, beta;
66 if (*iters >= *itmax && *iresid == 0)
69 Vmresid(nx, ny, nz, ipc, rpc, ac, cc, fc, x, r);
70 denom =
Vxnrm2(nx, ny, nz, r);
81 rhok2 =
Vxdot(nx, ny, nz, r, r);
84 if (rsnrm / denom <= *errtol)
96 Vxaxpy(nx, ny, nz, &alpha, r, p);
97 Vxscal(nx, ny, nz, &beta, p);
101 Vmatvec(nx, ny, nz, ipc, rpc, ac, cc, p, ap);
102 pAp =
Vxdot(nx, ny, nz, p, ap);
109 Vxaxpy(nx, ny, nz, &alpha, p, x);
113 Vxaxpy(nx, ny, nz, &alpha, ap, r);
VPUBLIC void Vxscal(int *nx, int *ny, int *nz, double *fac, double *x)
Scale operation for a grid function with boundary values.
VPUBLIC void Vmatvec(int *nx, int *ny, int *nz, int *ipc, double *rpc, double *ac, double *cc, double *x, double *y)
Matrix-vector multiplication routines.
VPUBLIC void Vxcopy(int *nx, int *ny, int *nz, double *x, double *y)
A collection of useful low-level routines (timing, etc).
VPUBLIC double Vxdot(int *nx, int *ny, int *nz, double *x, double *y)
Inner product operation for a grid function with boundary values.
VPUBLIC void Vxaxpy(int *nx, int *ny, int *nz, double *alpha, double *x, double *y)
saxpy operation for a grid function with boundary values.
VPUBLIC double Vxnrm2(int *nx, int *ny, int *nz, double *x)
Norm operation for a grid function with boundary values.
VPUBLIC void Vcghs(int *nx, int *ny, int *nz, int *ipc, double *rpc, double *ac, double *cc, double *fc, double *x, double *p, double *ap, double *r, int *itmax, int *iters, double *errtol, double *omega, int *iresid, int *iadjoint)
A collection of useful low-level routines (timing, etc).
VPUBLIC void Vmresid(int *nx, int *ny, int *nz, int *ipc, double *rpc, double *ac, double *cc, double *fc, double *x, double *r)
Break the matrix data-structure into diagonals and then call the residual routine.