Esempio n. 1
0
PetscErrorCode KSPSetFromOptions_BCGSL(KSP ksp)
{
    KSP_BCGSL      *bcgsl = (KSP_BCGSL *)ksp->data;
    PetscErrorCode ierr;
    PetscInt       this_ell;
    PetscReal      delta;
    PetscTruth     flga = PETSC_FALSE, flg;

    PetscFunctionBegin;
    /* PetscOptionsBegin/End are called in KSPSetFromOptions. They
       don't need to be called here.
    */
    ierr = PetscOptionsHead("KSP BiCGStab(L) Options");
    CHKERRQ(ierr);

    /* Set number of search directions */
    ierr = PetscOptionsInt("-ksp_bcgsl_ell","Number of Krylov search directions","KSPBCGSLSetEll",bcgsl->ell,&this_ell,&flg);
    CHKERRQ(ierr);
    if (flg) {
        ierr = KSPBCGSLSetEll(ksp, this_ell);
        CHKERRQ(ierr);
    }

    /* Set polynomial type */
    ierr = PetscOptionsTruth("-ksp_bcgsl_cxpoly", "Polynomial part of BiCGStabL is MinRes + OR", "KSPBCGSLSetPol", flga,&flga,PETSC_NULL);
    CHKERRQ(ierr);
    if (flga) {
        ierr = KSPBCGSLSetPol(ksp, PETSC_TRUE);
        CHKERRQ(ierr);
    } else {
        flg  = PETSC_FALSE;
        ierr = PetscOptionsTruth("-ksp_bcgsl_mrpoly", "Polynomial part of BiCGStabL is MinRes", "KSPBCGSLSetPol", flg,&flg,PETSC_NULL);
        CHKERRQ(ierr);
        ierr = KSPBCGSLSetPol(ksp, PETSC_FALSE);
        CHKERRQ(ierr);
    }

    /* Will computed residual be refreshed? */
    ierr = PetscOptionsReal("-ksp_bcgsl_xres", "Threshold used to decide when to refresh computed residuals", "KSPBCGSLSetXRes", bcgsl->delta, &delta, &flg);
    CHKERRQ(ierr);
    if (flg) {
        ierr = KSPBCGSLSetXRes(ksp, delta);
        CHKERRQ(ierr);
    }
    ierr = PetscOptionsTail();
    CHKERRQ(ierr);
    PetscFunctionReturn(0);
}
Esempio n. 2
0
void PETSC_STDCALL  kspbcgslsetpol_(KSP ksp,PetscBool  *uMROR, int *__ierr ){
*__ierr = KSPBCGSLSetPol(
	(KSP)PetscToPointer((ksp) ),*uMROR);
}