Lines Matching refs:nmat
16 PetscInt nmat; member
50 for (i = 0; i < shell->nmat; i++) PetscCall(VecDestroy(&shell->lvecs[i])); in MatDestroy_Composite()
95 for (PetscInt i = 0; i < shell->nmat; i++) scale *= shell->scalings[i]; in MatMult_Composite_Multiplicative()
123 for (PetscInt i = 0; i < shell->nmat; i++) scale *= shell->scalings[i]; in MatMultTranspose_Composite_Multiplicative()
167 PetscCall(PetscMalloc3(tot, &shell->location, tot, &shell->larray, shell->nmat, &shell->lvecs)); in MatMult_Composite()
388 PetscErrorCode MatCreateComposite(MPI_Comm comm, PetscInt nmat, const Mat *mats, Mat *mat) in MatCreateComposite() argument
391 …PetscCheck(nmat >= 1, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Must pass in at least one matrix… in MatCreateComposite()
395 for (PetscInt i = 0; i < nmat; i++) PetscCall(MatCompositeAddMat(*mat, mats[i])); in MatCreateComposite()
423 shell->nmat += 1; in MatCompositeAddMat_Composite()
428 if (shell->nmat == 1) PetscCall(MatSetVecType(mat, vtype_smat)); in MatCompositeAddMat_Composite()
437 PetscCall(PetscRealloc(sizeof(PetscScalar) * shell->nmat, &shell->scalings)); in MatCompositeAddMat_Composite()
438 shell->scalings[shell->nmat - 1] = 1.0; in MatCompositeAddMat_Composite()
442 if (shell->nmat == 1) PetscCall(PetscLayoutReference(smat->cmap, &mat->cmap)); in MatCompositeAddMat_Composite()
674 i = shell->nmat - 1; in MatCompositeMerge_Composite()
696 for (i = 0; i < shell->nmat; i++) scale *= shell->scalings[i]; in MatCompositeMerge_Composite()
746 static PetscErrorCode MatCompositeGetNumberMat_Composite(Mat mat, PetscInt *nmat) in MatCompositeGetNumberMat_Composite() argument
752 *nmat = shell->nmat; in MatCompositeGetNumberMat_Composite()
771 PetscErrorCode MatCompositeGetNumberMat(Mat mat, PetscInt *nmat) in MatCompositeGetNumberMat() argument
775 PetscAssertPointer(nmat, 2); in MatCompositeGetNumberMat()
776 PetscUseMethod(mat, "MatCompositeGetNumberMat_C", (Mat, PetscInt *), (mat, nmat)); in MatCompositeGetNumberMat()
788 …hell->nmat, PetscObjectComm((PetscObject)mat), PETSC_ERR_ARG_OUTOFRANGE, "index out of range: %" P… in MatCompositeGetMat_Composite()
824 PetscInt nmat; in MatCompositeSetScalings_Composite() local
828 PetscCall(MatCompositeGetNumberMat(mat, &nmat)); in MatCompositeSetScalings_Composite()
829 if (!shell->scalings) PetscCall(PetscMalloc1(nmat, &shell->scalings)); in MatCompositeSetScalings_Composite()
830 PetscCall(PetscArraycpy(shell->scalings, scalings, nmat)); in MatCompositeSetScalings_Composite()
883 b->nmat = 0; in MatCreate_Composite()