| Line 189... |
Line 189... |
|
|
/* if the user did not set the shift, use the target value */
|
/* if the user did not set the shift, use the target value */
|
if (!st->sigma_set) st->sigma = st->defsigma;
|
if (!st->sigma_set) st->sigma = st->defsigma;
|
|
|
if (!ctx->nu_set) { ctx->nu = st->sigma; }
|
if (!ctx->nu_set) { ctx->nu = st->sigma; }
|
if (ctx->nu == 0.0 && st->sigma == 0.0) {
|
if (ctx->nu == 0.0 && st->sigma == 0.0) SETERRQ(((PetscObject)st)->comm,1,"Values of shift and antishift cannot be zero simultaneously");
|
SETERRQ(((PetscObject)st)->comm,1,"Values of shift and antishift cannot be zero simultaneously");
|
|
}
|
|
|
|
if (!st->ksp) { ierr = STGetKSP(st,&st->ksp);CHKERRQ(ierr); }
|
if (!st->ksp) { ierr = STGetKSP(st,&st->ksp);CHKERRQ(ierr); }
|
switch (st->shift_matrix) {
|
switch (st->shift_matrix) {
|
case ST_MATMODE_INPLACE:
|
case ST_MATMODE_INPLACE:
|
st->mat = PETSC_NULL;
|
st->mat = PETSC_NULL;
|
| Line 239... |
Line 237... |
ST_CAYLEY *ctx = (ST_CAYLEY*)st->data;
|
ST_CAYLEY *ctx = (ST_CAYLEY*)st->data;
|
MatStructure flg;
|
MatStructure flg;
|
|
|
PetscFunctionBegin;
|
PetscFunctionBegin;
|
if (!ctx->nu_set) { ctx->nu = newshift; }
|
if (!ctx->nu_set) { ctx->nu = newshift; }
|
if (ctx->nu == 0.0 && newshift == 0.0) {
|
if (ctx->nu == 0.0 && newshift == 0.0) SETERRQ(((PetscObject)st)->comm,1,"Values of shift and antishift cannot be zero simultaneously");
|
SETERRQ(((PetscObject)st)->comm,1,"Values of shift and antishift cannot be zero simultaneously");
|
|
}
|
|
|
|
/* Nothing to be done if STSetUp has not been called yet */
|
/* Nothing to be done if STSetUp has not been called yet */
|
if (!st->setupcalled) PetscFunctionReturn(0);
|
if (!st->setupcalled) PetscFunctionReturn(0);
|
|
|
/* Check if the new KSP matrix has the same zero structure */
|
/* Check if the new KSP matrix has the same zero structure */
|