| /petsc/src/mat/impls/aij/seq/ |
| H A D | aijfact.c | 231 FactorShiftCtx sctx; in MatLUFactorNumeric_SeqAIJ() local 240 PetscCall(PetscMemzero(&sctx, sizeof(FactorShiftCtx))); in MatLUFactorNumeric_SeqAIJ() 244 sctx.shift_top = info->zeropivot; in MatLUFactorNumeric_SeqAIJ() 252 if (rs > sctx.shift_top) sctx.shift_top = rs; in MatLUFactorNumeric_SeqAIJ() 254 sctx.shift_top *= 1.1; in MatLUFactorNumeric_SeqAIJ() 255 sctx.nshift_max = 5; in MatLUFactorNumeric_SeqAIJ() 256 sctx.shift_lo = 0.; in MatLUFactorNumeric_SeqAIJ() 257 sctx.shift_hi = 1.; in MatLUFactorNumeric_SeqAIJ() 266 sctx.newshift = PETSC_FALSE; in MatLUFactorNumeric_SeqAIJ() 285 rtmp[i] += sctx.shift_amount; /* shift the diagonal of the matrix */ in MatLUFactorNumeric_SeqAIJ() [all …]
|
| H A D | inode.c | 1209 FactorShiftCtx sctx; in MatLUFactorNumeric_SeqAIJ_Inode() local 1219 PetscCall(PetscMemzero(&sctx, sizeof(FactorShiftCtx))); in MatLUFactorNumeric_SeqAIJ_Inode() 1223 sctx.shift_top = info->zeropivot; in MatLUFactorNumeric_SeqAIJ_Inode() 1231 if (rs > sctx.shift_top) sctx.shift_top = rs; in MatLUFactorNumeric_SeqAIJ_Inode() 1233 sctx.shift_top *= 1.1; in MatLUFactorNumeric_SeqAIJ_Inode() 1234 sctx.nshift_max = 5; in MatLUFactorNumeric_SeqAIJ_Inode() 1235 sctx.shift_lo = 0.; in MatLUFactorNumeric_SeqAIJ_Inode() 1236 sctx.shift_hi = 1.; in MatLUFactorNumeric_SeqAIJ_Inode() 1287 sctx.newshift = PETSC_FALSE; in MatLUFactorNumeric_SeqAIJ_Inode() 1312 rtmp1[i] += sctx.shift_amount; /* shift the diagonal of the matrix */ in MatLUFactorNumeric_SeqAIJ_Inode() [all …]
|
| /petsc/src/mat/impls/baij/seq/ |
| H A D | baijfact.c | 461 FactorShiftCtx sctx; in MatLUFactorNumeric_SeqBAIJ_1() local 468 PetscCall(PetscMemzero(&sctx, sizeof(FactorShiftCtx))); in MatLUFactorNumeric_SeqBAIJ_1() 472 sctx.shift_top = info->zeropivot; in MatLUFactorNumeric_SeqBAIJ_1() 480 if (rs > sctx.shift_top) sctx.shift_top = rs; in MatLUFactorNumeric_SeqBAIJ_1() 482 sctx.shift_top *= 1.1; in MatLUFactorNumeric_SeqBAIJ_1() 483 sctx.nshift_max = 5; in MatLUFactorNumeric_SeqBAIJ_1() 484 sctx.shift_lo = 0.; in MatLUFactorNumeric_SeqBAIJ_1() 485 sctx.shift_hi = 1.; in MatLUFactorNumeric_SeqBAIJ_1() 494 sctx.newshift = PETSC_FALSE; in MatLUFactorNumeric_SeqBAIJ_1() 514 rtmp[i] += sctx.shift_amount; /* shift the diagonal of the matrix */ in MatLUFactorNumeric_SeqBAIJ_1() [all …]
|
| /petsc/src/mat/impls/sbaij/seq/ |
| H A D | sbaijfact.c | 1198 FactorShiftCtx sctx; in MatCholeskyFactorNumeric_SeqSBAIJ_1_inplace() local 1202 PetscCall(PetscMemzero(&sctx, sizeof(FactorShiftCtx))); in MatCholeskyFactorNumeric_SeqSBAIJ_1_inplace() 1231 sctx.newshift = PETSC_FALSE; in MatCholeskyFactorNumeric_SeqSBAIJ_1_inplace() 1250 if (sctx.nshift) rtmp[k] += sctx.shift_amount; in MatCholeskyFactorNumeric_SeqSBAIJ_1_inplace() 1294 sctx.rs = rs; in MatCholeskyFactorNumeric_SeqSBAIJ_1_inplace() 1295 sctx.pv = dk; in MatCholeskyFactorNumeric_SeqSBAIJ_1_inplace() 1296 PetscCall(MatPivotCheck(C, A, info, &sctx, k)); in MatCholeskyFactorNumeric_SeqSBAIJ_1_inplace() 1297 if (sctx.newshift) break; /* sctx.shift_amount is updated */ in MatCholeskyFactorNumeric_SeqSBAIJ_1_inplace() 1298 dk = sctx.pv; in MatCholeskyFactorNumeric_SeqSBAIJ_1_inplace() 1317 } while (sctx.newshift); in MatCholeskyFactorNumeric_SeqSBAIJ_1_inplace() [all …]
|
| /petsc/src/ksp/pc/impls/fieldsplit/ |
| H A D | fieldsplit.c | 26 VecScatter sctx; member 724 PetscCall(VecScatterCreate(xtmp, ilink->is, jac->x[i], NULL, &ilink->sctx)); in PCSetUp_FieldSplit() 1200 PetscCall(VecScatterBegin(ilinkA->sctx, x, ilinkA->x, INSERT_VALUES, SCATTER_FORWARD)); in PCApply_FieldSplit_Schur() 1201 PetscCall(VecScatterBegin(ilinkD->sctx, x, ilinkD->x, INSERT_VALUES, SCATTER_FORWARD)); in PCApply_FieldSplit_Schur() 1202 PetscCall(VecScatterEnd(ilinkA->sctx, x, ilinkA->x, INSERT_VALUES, SCATTER_FORWARD)); in PCApply_FieldSplit_Schur() 1207 PetscCall(VecScatterBegin(ilinkA->sctx, ilinkA->y, y, INSERT_VALUES, SCATTER_REVERSE)); in PCApply_FieldSplit_Schur() 1208 PetscCall(VecScatterEnd(ilinkD->sctx, x, ilinkD->x, INSERT_VALUES, SCATTER_FORWARD)); in PCApply_FieldSplit_Schur() 1216 PetscCall(VecScatterEnd(ilinkA->sctx, ilinkA->y, y, INSERT_VALUES, SCATTER_REVERSE)); in PCApply_FieldSplit_Schur() 1217 PetscCall(VecScatterBegin(ilinkD->sctx, ilinkD->y, y, INSERT_VALUES, SCATTER_REVERSE)); in PCApply_FieldSplit_Schur() 1218 PetscCall(VecScatterEnd(ilinkD->sctx, ilinkD->y, y, INSERT_VALUES, SCATTER_REVERSE)); in PCApply_FieldSplit_Schur() [all …]
|
| /petsc/include/petsc/private/ |
| H A D | matimpl.h | 789 …Check_nz(PETSC_UNUSED Mat mat, const MatFactorInfo *info, FactorShiftCtx *sctx, PETSC_UNUSED Petsc… in MatPivotCheck_nz() argument 791 PetscReal _rs = sctx->rs; in MatPivotCheck_nz() 795 if (PetscAbsScalar(sctx->pv) <= _zero && !PetscIsNanScalar(sctx->pv)) { in MatPivotCheck_nz() 797 if (!sctx->nshift) sctx->shift_amount = info->shiftamount; in MatPivotCheck_nz() 798 else sctx->shift_amount *= 2.0; in MatPivotCheck_nz() 799 sctx->newshift = PETSC_TRUE; in MatPivotCheck_nz() 800 (sctx->nshift)++; in MatPivotCheck_nz() 802 sctx->newshift = PETSC_FALSE; in MatPivotCheck_nz() 807 …Check_pd(PETSC_UNUSED Mat mat, const MatFactorInfo *info, FactorShiftCtx *sctx, PETSC_UNUSED Petsc… in MatPivotCheck_pd() argument 809 PetscReal _rs = sctx->rs; in MatPivotCheck_pd() [all …]
|
| /petsc/src/snes/impls/vi/rs/ |
| H A D | virs.c | 628 SNESMatlabContext *sctx = (SNESMatlabContext *)ctx; in SNESVIRedundancyCheck_Matlab() local 650 prhs[3] = mxCreateString(sctx->funcname); in SNESVIRedundancyCheck_Matlab() 651 prhs[4] = sctx->ctx; in SNESVIRedundancyCheck_Matlab() 664 SNESMatlabContext *sctx; in SNESVISetRedundancyCheckMatlab() local 668 PetscCall(PetscNew(&sctx)); in SNESVISetRedundancyCheckMatlab() 669 PetscCall(PetscStrallocpy(func, &sctx->funcname)); in SNESVISetRedundancyCheckMatlab() 670 sctx->ctx = mxDuplicateArray(ctx); in SNESVISetRedundancyCheckMatlab() 671 PetscCall(SNESVISetRedundancyCheck(snes, SNESVIRedundancyCheck_Matlab, sctx)); in SNESVISetRedundancyCheckMatlab()
|
| /petsc/src/snes/impls/multiblock/ |
| H A D | multiblock.c | 10 VecScatter sctx; /* Scatter mapping global Vec to blockVec */ member 37 PetscCall(VecScatterDestroy(&blocks->sctx)); in SNESReset_Multiblock() 364 if (!mb->blocks->sctx) { in SNESSetUp_Multiblock() 370 PetscCall(VecScatterCreate(xtmp, blocks->is, blocks->x, NULL, &blocks->sctx)); in SNESSetUp_Multiblock() 501 PetscCall(VecScatterBegin(blocks->sctx, X, blocks->x, INSERT_VALUES, SCATTER_FORWARD)); in SNESSolve_Multiblock() 502 PetscCall(VecScatterEnd(blocks->sctx, X, blocks->x, INSERT_VALUES, SCATTER_FORWARD)); in SNESSolve_Multiblock() 504 PetscCall(VecScatterBegin(blocks->sctx, blocks->x, X, INSERT_VALUES, SCATTER_REVERSE)); in SNESSolve_Multiblock() 505 PetscCall(VecScatterEnd(blocks->sctx, blocks->x, X, INSERT_VALUES, SCATTER_REVERSE)); in SNESSolve_Multiblock()
|
| /petsc/src/mat/impls/aij/mpi/ |
| H A D | fdmpiaij.c | 31 PetscErrorCode MatFDColoringApply_BAIJ(Mat J, MatFDColoring coloring, Vec x1, void *sctx) in MatFDColoringApply_BAIJ() argument 53 PetscCall((*f)(sctx, x1, w1, fctx)); in MatFDColoringApply_BAIJ() 132 PetscCall((*f)(sctx, w3, w2, fctx)); in MatFDColoringApply_BAIJ() 182 PetscErrorCode MatFDColoringApply_AIJ(Mat J, MatFDColoring coloring, Vec x1, void *sctx) in MatFDColoringApply_AIJ() argument 207 PetscCall((*f)(sctx, x1, w1, fctx)); in MatFDColoringApply_AIJ() 288 PetscCall((*f)(sctx, w3, w2, fctx)); in MatFDColoringApply_AIJ() 359 PetscCall((*f)(sctx, w3, w2, fctx)); in MatFDColoringApply_AIJ()
|
| /petsc/src/ksp/pc/impls/telescope/ |
| H A D | telescope_dmda.c | 130 VecScatter sctx; in PCTelescopeSetUp_dmda_repart_coors2d() local 178 PetscCall(VecScatterCreate(coor_natural, is_fine, perm_coors, is_local, &sctx)); in PCTelescopeSetUp_dmda_repart_coors2d() 179 PetscCall(VecScatterBegin(sctx, coor_natural, perm_coors, INSERT_VALUES, SCATTER_FORWARD)); in PCTelescopeSetUp_dmda_repart_coors2d() 180 PetscCall(VecScatterEnd(sctx, coor_natural, perm_coors, INSERT_VALUES, SCATTER_FORWARD)); in PCTelescopeSetUp_dmda_repart_coors2d() 205 PetscCall(VecScatterDestroy(&sctx)); in PCTelescopeSetUp_dmda_repart_coors2d() 221 VecScatter sctx; in PCTelescopeSetUp_dmda_repart_coors3d() local 274 PetscCall(VecScatterCreate(coor_natural, is_fine, perm_coors, is_local, &sctx)); in PCTelescopeSetUp_dmda_repart_coors3d() 275 PetscCall(VecScatterBegin(sctx, coor_natural, perm_coors, INSERT_VALUES, SCATTER_FORWARD)); in PCTelescopeSetUp_dmda_repart_coors3d() 276 PetscCall(VecScatterEnd(sctx, coor_natural, perm_coors, INSERT_VALUES, SCATTER_FORWARD)); in PCTelescopeSetUp_dmda_repart_coors3d() 304 PetscCall(VecScatterDestroy(&sctx)); in PCTelescopeSetUp_dmda_repart_coors3d()
|
| /petsc/src/mat/matfd/ |
| H A D | fdmatrix.c | 579 PetscErrorCode MatFDColoringApply(Mat J, MatFDColoring coloring, Vec x1, void *sctx) in MatFDColoringApply() argument 594 PetscUseTypeMethod(J, fdcoloringapply, coloring, x1, sctx); in MatFDColoringApply()
|
| /petsc/src/ts/tutorials/ |
| H A D | ex30.c | 578 SingleSourceCtx sctx; in source() local 581 sctx.x0[0] = s->x0[dim * i]; in source() 582 sctx.x0[1] = s->x0[dim * i + 1]; in source() 583 sctx.x0[2] = dim > 2 ? s->x0[dim * i + 2] : 0.0; in source() 584 sctx.w = s->w[i]; in source() 585 sctx.k = s->k[i]; in source() 586 sctx.p = s->p[i]; in source() 587 sctx.r = s->r[i]; in source() 589 PetscCall(gaussian(dim, time, x, Nf, ut, &sctx)); in source()
|
| /petsc/src/dm/interface/ |
| H A D | dm.c | 8817 static PetscErrorCode MatFDColoringApply_AIJDM(Mat J, MatFDColoring coloring, Vec x1, void *sctx) in MatFDColoringApply_AIJDM() argument 8830 PetscCall(MatFDColoringApply_AIJ(J, coloring, x1, sctx)); in MatFDColoringApply_AIJDM()
|