Lines Matching refs:l
143 PetscErrorCode PCMGSetResidual(PC pc, PetscInt l, PetscErrorCode (*residual)(Mat, Vec, Vec, Vec), M… in PCMGSetResidual() argument
151 if (residual) mglevels[l]->residual = residual; in PCMGSetResidual()
152 if (!mglevels[l]->residual) mglevels[l]->residual = PCMGResidualDefault; in PCMGSetResidual()
153 mglevels[l]->matresidual = PCMGMatResidualDefault; in PCMGSetResidual()
155 PetscCall(MatDestroy(&mglevels[l]->A)); in PCMGSetResidual()
156 mglevels[l]->A = mat; in PCMGSetResidual()
177 PetscErrorCode PCMGSetResidualTranspose(PC pc, PetscInt l, PetscErrorCode (*residualt)(Mat, Vec, Ve… in PCMGSetResidualTranspose() argument
185 if (residualt) mglevels[l]->residualtranspose = residualt; in PCMGSetResidualTranspose()
186 …if (!mglevels[l]->residualtranspose) mglevels[l]->residualtranspose = PCMGResidualTransposeDefault; in PCMGSetResidualTranspose()
187 mglevels[l]->matresidualtranspose = PCMGMatResidualTransposeDefault; in PCMGSetResidualTranspose()
189 PetscCall(MatDestroy(&mglevels[l]->A)); in PCMGSetResidualTranspose()
190 mglevels[l]->A = mat; in PCMGSetResidualTranspose()
216 PetscErrorCode PCMGSetInterpolation(PC pc, PetscInt l, Mat mat) in PCMGSetInterpolation() argument
224 …PetscCheck(l, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_OUTOFRANGE, "Do not set interpolatio… in PCMGSetInterpolation()
226 PetscCall(MatDestroy(&mglevels[l]->interpolate)); in PCMGSetInterpolation()
228 mglevels[l]->interpolate = mat; in PCMGSetInterpolation()
247 PetscErrorCode PCMGSetOperators(PC pc, PetscInt l, Mat Amat, Mat Pmat) in PCMGSetOperators() argument
257 PetscCall(KSPSetOperators(mglevels[l]->smoothd, Amat, Pmat)); in PCMGSetOperators()
278 PetscErrorCode PCMGGetInterpolation(PC pc, PetscInt l, Mat *mat) in PCMGGetInterpolation() argument
287 …l > 0 && l < mg->nlevels, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_OUTOFRANGE, "Level %" Pe… in PCMGGetInterpolation()
288 …if (!mglevels[l]->interpolate && mglevels[l]->restrct) PetscCall(PCMGSetInterpolation(pc, l, mglev… in PCMGGetInterpolation()
289 if (mat) *mat = mglevels[l]->interpolate; in PCMGGetInterpolation()
318 PetscErrorCode PCMGSetRestriction(PC pc, PetscInt l, Mat mat) in PCMGSetRestriction() argument
327 …PetscCheck(l, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_OUTOFRANGE, "Do not set restriction … in PCMGSetRestriction()
329 PetscCall(MatDestroy(&mglevels[l]->restrct)); in PCMGSetRestriction()
331 mglevels[l]->restrct = mat; in PCMGSetRestriction()
352 PetscErrorCode PCMGGetRestriction(PC pc, PetscInt l, Mat *mat) in PCMGGetRestriction() argument
361 …l > 0 && l < mg->nlevels, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_OUTOFRANGE, "Level %" Pe… in PCMGGetRestriction()
362 …if (!mglevels[l]->restrct && mglevels[l]->interpolate) PetscCall(PCMGSetRestriction(pc, l, mglevel… in PCMGGetRestriction()
363 if (mat) *mat = mglevels[l]->restrct; in PCMGGetRestriction()
385 PetscErrorCode PCMGSetRScale(PC pc, PetscInt l, Vec rscale) in PCMGSetRScale() argument
393 …l > 0 && l < mg->nlevels, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_OUTOFRANGE, "Level %" Pe… in PCMGSetRScale()
395 PetscCall(VecDestroy(&mglevels[l]->rscale)); in PCMGSetRScale()
397 mglevels[l]->rscale = rscale; in PCMGSetRScale()
419 PetscErrorCode PCMGGetRScale(PC pc, PetscInt l, Vec *rscale) in PCMGGetRScale() argument
427 …l > 0 && l < mg->nlevels, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_OUTOFRANGE, "Level %" Pe… in PCMGGetRScale()
428 if (!mglevels[l]->rscale) { in PCMGGetRScale()
433 PetscCall(PCMGGetRestriction(pc, l, &R)); in PCMGGetRScale()
448 mglevels[l]->rscale = coarse; in PCMGGetRScale()
450 *rscale = mglevels[l]->rscale; in PCMGGetRScale()
469 PetscErrorCode PCMGSetInjection(PC pc, PetscInt l, Mat mat) in PCMGSetInjection() argument
478 …PetscCheck(l, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_OUTOFRANGE, "Do not set restriction … in PCMGSetInjection()
480 PetscCall(MatDestroy(&mglevels[l]->inject)); in PCMGSetInjection()
482 mglevels[l]->inject = mat; in PCMGSetInjection()
503 PetscErrorCode PCMGGetInjection(PC pc, PetscInt l, Mat *mat) in PCMGGetInjection() argument
512 …l > 0 && l < mg->nlevels, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_OUTOFRANGE, "Level %" Pe… in PCMGGetInjection()
513 if (mat) *mat = mglevels[l]->inject; in PCMGGetInjection()
541 PetscErrorCode PCMGGetSmoother(PC pc, PetscInt l, KSP *ksp) in PCMGGetSmoother() argument
548 *ksp = mglevels[l]->smoothd; in PCMGGetSmoother()
572 PetscErrorCode PCMGGetSmootherUp(PC pc, PetscInt l, KSP *ksp) in PCMGGetSmootherUp() argument
586 …PetscCheck(l, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_OUTOFRANGE, "There is no such thing … in PCMGGetSmootherUp()
587 if (mglevels[l]->smoothu == mglevels[l]->smoothd) { in PCMGGetSmootherUp()
594 PetscCall(PetscObjectGetComm((PetscObject)mglevels[l]->smoothd, &comm)); in PCMGGetSmootherUp()
595 PetscCall(KSPGetOptionsPrefix(mglevels[l]->smoothd, &prefix)); in PCMGGetSmootherUp()
596 PetscCall(KSPGetTolerances(mglevels[l]->smoothd, &rtol, &abstol, &dtol, &maxits)); in PCMGGetSmootherUp()
597 PetscCall(KSPGetType(mglevels[l]->smoothd, &ksptype)); in PCMGGetSmootherUp()
598 PetscCall(KSPGetNormType(mglevels[l]->smoothd, &normtype)); in PCMGGetSmootherUp()
599 PetscCall(KSPGetPC(mglevels[l]->smoothd, &ipc)); in PCMGGetSmootherUp()
602 PetscCall(KSPCreate(comm, &mglevels[l]->smoothu)); in PCMGGetSmootherUp()
603 PetscCall(KSPSetNestLevel(mglevels[l]->smoothu, pc->kspnestlevel)); in PCMGGetSmootherUp()
604 PetscCall(KSPSetErrorIfNotConverged(mglevels[l]->smoothu, pc->erroriffailure)); in PCMGGetSmootherUp()
605 …etscObjectIncrementTabLevel((PetscObject)mglevels[l]->smoothu, (PetscObject)pc, mglevels[0]->level… in PCMGGetSmootherUp()
606 PetscCall(KSPSetOptionsPrefix(mglevels[l]->smoothu, prefix)); in PCMGGetSmootherUp()
607 PetscCall(KSPSetTolerances(mglevels[l]->smoothu, rtol, abstol, dtol, maxits)); in PCMGGetSmootherUp()
608 PetscCall(KSPSetType(mglevels[l]->smoothu, ksptype)); in PCMGGetSmootherUp()
609 PetscCall(KSPSetNormType(mglevels[l]->smoothu, normtype)); in PCMGGetSmootherUp()
610 PetscCall(KSPSetConvergenceTest(mglevels[l]->smoothu, KSPConvergedSkip, NULL, NULL)); in PCMGGetSmootherUp()
611 PetscCall(KSPGetPC(mglevels[l]->smoothu, &ipc)); in PCMGGetSmootherUp()
613 …Call(PetscObjectComposedDataSetInt((PetscObject)mglevels[l]->smoothu, PetscMGLevelId, mglevels[l]-… in PCMGGetSmootherUp()
615 if (ksp) *ksp = mglevels[l]->smoothu; in PCMGGetSmootherUp()
640 PetscErrorCode PCMGGetSmootherDown(PC pc, PetscInt l, KSP *ksp) in PCMGGetSmootherDown() argument
648 if (l) PetscCall(PCMGGetSmootherUp(pc, l, NULL)); in PCMGGetSmootherDown()
649 *ksp = mglevels[l]->smoothd; in PCMGGetSmootherDown()
667 PetscErrorCode PCMGSetCycleTypeOnLevel(PC pc, PetscInt l, PCMGCycleType c) in PCMGSetCycleTypeOnLevel() argument
675 PetscValidLogicalCollectiveInt(pc, l, 2); in PCMGSetCycleTypeOnLevel()
677 mglevels[l]->cycles = c; in PCMGSetCycleTypeOnLevel()
698 PetscErrorCode PCMGSetRhs(PC pc, PetscInt l, Vec c) in PCMGSetRhs() argument
706 …PetscCheck(l != mglevels[0]->levels - 1, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_INCOMP, "… in PCMGSetRhs()
708 PetscCall(VecDestroy(&mglevels[l]->b)); in PCMGSetRhs()
710 mglevels[l]->b = c; in PCMGSetRhs()
731 PetscErrorCode PCMGSetX(PC pc, PetscInt l, Vec c) in PCMGSetX() argument
739 …PetscCheck(l != mglevels[0]->levels - 1, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_INCOMP, "… in PCMGSetX()
741 PetscCall(VecDestroy(&mglevels[l]->x)); in PCMGSetX()
743 mglevels[l]->x = c; in PCMGSetX()
764 PetscErrorCode PCMGSetR(PC pc, PetscInt l, Vec c) in PCMGSetR() argument
772 …PetscCheck(l, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_OUTOFRANGE, "Need not set residual v… in PCMGSetR()
774 PetscCall(VecDestroy(&mglevels[l]->r)); in PCMGSetR()
776 mglevels[l]->r = c; in PCMGSetR()