Lines Matching refs:matshellctx
47 MatShellCtx *matshellctx; in MatMultMtM_SeqAIJ() local
50 PetscCall(MatShellGetContext(MtM, &matshellctx)); in MatMultMtM_SeqAIJ()
51 PetscCheck(matshellctx, PETSC_COMM_WORLD, PETSC_ERR_ARG_OUTOFRANGE, "No context"); in MatMultMtM_SeqAIJ()
52 PetscCall(MatMult(matshellctx->Mp, xx, matshellctx->ff)); in MatMultMtM_SeqAIJ()
53 PetscCall(MatMult(matshellctx->MpTrans, matshellctx->ff, yy)); in MatMultMtM_SeqAIJ()
59 MatShellCtx *matshellctx; in MatMultAddMtM_SeqAIJ() local
62 PetscCall(MatShellGetContext(MtM, &matshellctx)); in MatMultAddMtM_SeqAIJ()
63 PetscCheck(matshellctx, PETSC_COMM_WORLD, PETSC_ERR_ARG_OUTOFRANGE, "No context"); in MatMultAddMtM_SeqAIJ()
64 PetscCall(MatMult(matshellctx->Mp, xx, matshellctx->ff)); in MatMultAddMtM_SeqAIJ()
65 PetscCall(MatMultAdd(matshellctx->MpTrans, matshellctx->ff, yy, zz)); in MatMultAddMtM_SeqAIJ()
166 MatShellCtx *matshellctx = NULL; in gridToParticles() local
188 PetscCall(PetscNew(&matshellctx)); in gridToParticles()
189 PetscCall(MatCreateVecs(M_p, &matshellctx->uu, &matshellctx->ff)); in gridToParticles()
196 …reateShell(PetscObjectComm((PetscObject)dm), N, N, PETSC_DECIDE, PETSC_DECIDE, matshellctx, &MtM)); in gridToParticles()
197 PetscCall(MatTranspose(M_p, MAT_INITIAL_MATRIX, &matshellctx->MpTrans)); in gridToParticles()
198 matshellctx->Mp = M_p; in gridToParticles()
202 PetscCall(MatViewFromOptions(matshellctx->MpTrans, NULL, "-ftop2_MpT_mat_view")); in gridToParticles()
207 PetscCall(MatGetRow(matshellctx->MpTrans, i, &nzl, &cols, &vals)); in gridToParticles()
215 PetscCall(MatDestroy(&matshellctx->MpTrans)); in gridToParticles()
216 PetscCall(VecDestroy(&matshellctx->ff)); in gridToParticles()
217 PetscCall(VecDestroy(&matshellctx->uu)); in gridToParticles()
220 PetscCall(PetscFree(matshellctx)); in gridToParticles()
233 PetscCall(MatViewFromOptions(matshellctx->MpTrans, NULL, "-ftop2_MpTranspose_mat_view")); in gridToParticles()
254 PetscCall(KSPSolve(ksp, work_ferhs, matshellctx->uu)); in gridToParticles()
256 PetscCall(MatMult(M_p, matshellctx->uu, ff)); in gridToParticles()
259 if (matshellctx->MpTrans) PetscCall(MatDestroy(&matshellctx->MpTrans)); in gridToParticles()
260 PetscCall(VecDestroy(&matshellctx->ff)); in gridToParticles()
261 PetscCall(VecDestroy(&matshellctx->uu)); in gridToParticles()
262 PetscCall(PetscFree(matshellctx)); in gridToParticles()