Lines Matching full:w
198 static PetscErrorCode PCDeflationSetSpace_Deflation(PC pc, Mat W, PetscBool transpose) in PCDeflationSetSpace_Deflation() argument
203 /* possibly allows W' = Wt (which is valid but not tested) */ in PCDeflationSetSpace_Deflation()
204 PetscCall(PetscObjectReference((PetscObject)W)); in PCDeflationSetSpace_Deflation()
207 def->Wt = W; in PCDeflationSetSpace_Deflation()
209 PetscCall(MatDestroy(&def->W)); in PCDeflationSetSpace_Deflation()
210 def->W = W; in PCDeflationSetSpace_Deflation()
222 . W - deflation matrix
223 - transpose - indicates that W is an explicit transpose of the deflation matrix
228 Setting W as a multipliplicative `MATCOMPOSITE` enables use of the multilevel
229 deflation. If W = W0*W1*W2*...*Wn, W0 is taken as the first deflation space and
234 they are merged into a deflation matrix ...*W{n-1}*Wn.
238 PetscErrorCode PCDeflationSetSpace(PC pc, Mat W, PetscBool transpose) in PCDeflationSetSpace() argument
242 PetscValidHeaderSpecific(W, MAT_CLASSID, 2); in PCDeflationSetSpace()
244 PetscTryMethod(pc, "PCDeflationSetSpace_C", (PC, Mat, PetscBool), (pc, W, transpose)); in PCDeflationSetSpace()
260 PCDeflationSetProjectionNullSpaceMat - Set the projection null space matrix (W'*A).
381 x <- x + W*(W'*A*W)^{-1}*W'*r = x + Q*r
406 PetscCall(MatMult(def->Wt, r, w1)); /* w1 <- W'*r */ in PCPreSolve_Deflation()
408 PetscCall(MatMultHermitianTranspose(def->W, r, w1)); /* w1 <- W'*r */ in PCPreSolve_Deflation()
410 PetscCall(KSPSolve(def->WtAWinv, w1, w2)); /* w2 <- (W'*A*W)^{-1}*w1 */ in PCPreSolve_Deflation()
411 PetscCall(MatMult(def->W, w2, r)); /* r <- W*w2 */ in PCPreSolve_Deflation()
418 z <- M^{-1}r - W*(W'*A*W)^{-1}*(W'*A*M^{-1}r - l*W'*r) = (P*M^{-1} + l*Q)*r
420 z <- M^{-1}*r - W*(W'*A*W)^{-1}*W'*A*M{-1}*r = P*M^{-1}*r
437 PetscCall(MatMult(def->WtA, z, w1)); /* w1 <- W'*A*z */ in PCApply_Deflation()
440 PetscCall(MatMult(def->Wt, r, w2)); /* w2 <- W'*r */ in PCApply_Deflation()
442 PetscCall(MatMultHermitianTranspose(def->W, r, w2)); /* w2 <- W'*r */ in PCApply_Deflation()
446 PetscCall(KSPSolve(def->WtAWinv, w1, w2)); /* w2 <- (W'*A*W)^{-1}*w1 */ in PCApply_Deflation()
447 PetscCall(MatMult(def->W, w2, u)); /* u <- W*w2 */ in PCApply_Deflation()
475 if (def->W || def->Wt) { in PCSetUp_Deflation()
482 if (def->W) { in PCSetUp_Deflation()
483 PetscCall(PetscObjectTypeCompare((PetscObject)def->W, MATCOMPOSITE, &match)); in PCSetUp_Deflation()
485 PetscCall(MatCompositeGetType(def->W, &ctype)); in PCSetUp_Deflation()
486 PetscCall(MatCompositeGetNumberMat(def->W, &size)); in PCSetUp_Deflation()
489 PetscCall(MatCreateHermitianTranspose(def->Wt, &def->W)); in PCSetUp_Deflation()
501 for (i = 0; i < size; i++) PetscCall(MatCompositeGetMat(def->W, i, &mats[i])); in PCSetUp_Deflation()
503 PetscCall(MatDestroy(&def->W)); in PCSetUp_Deflation()
504 def->W = mats[size]; in PCSetUp_Deflation()
516 /* PetscCall(MatCompositeSetMergeType(def->W,MAT_COMPOSITE_MERGE_LEFT)); */ in PCSetUp_Deflation()
517 PetscCall(MatCompositeMerge(def->W)); in PCSetUp_Deflation()
536 /* PetscCall(MatCompositeSetMergeType(def->W,MAT_COMPOSITE_MERGE_LEFT)); */ in PCSetUp_Deflation()
543 PetscCall(MatDestroy(&def->W)); in PCSetUp_Deflation()
544 PetscCall(MatHermitianTranspose(def->Wt, MAT_INITIAL_MATRIX, &def->W)); in PCSetUp_Deflation()
553 PetscCall(MatHermitianTranspose(def->W, MAT_INITIAL_MATRIX, &def->Wt)); in PCSetUp_Deflation()
556 PetscCall(MatTransposeMatMult(def->W, Amat, MAT_INITIAL_MATRIX, PETSC_CURRENT, &def->WtA)); in PCSetUp_Deflation()
562 PetscCall(MatGetSize(def->W, NULL, &m)); in PCSetUp_Deflation()
564 PetscCall(MatMatMult(def->WtA, def->W, MAT_INITIAL_MATRIX, PETSC_CURRENT, &def->WtAW)); in PCSetUp_Deflation()
569 /* Check columns of W are not in kernel of A */ in PCSetUp_Deflation()
574 …ctComm((PetscObject)def->WtAW), PETSC_ERR_SUP, "Column %" PetscInt_FMT " of W is in kernel of A.",… in PCSetUp_Deflation()
684 PetscCall(MatDestroy(&def->W)); in PCReset_Deflation()
770 …Given a (complex - transpose is always Hermitian) full rank deflation matrix W, the deflation (int…
771 preconditioner uses projections Q = W*(W'*A*W)^{-1}*W' and P = I - Q*A, where A is pmat.
785 …deflation matrix, and the coarse problem (W'*A*W)^{-1} is solved by `KSPFCG` (if A is `MAT_SPD`) o…
854 def->W = NULL; in PCCreate_Deflation()