Lines Matching refs:mat

27 PetscErrorCode MatGetRootType_Private(Mat mat, MatType *rootType)  in MatGetRootType_Private()  argument
34 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatGetRootType_Private()
35 PetscCall(MatGetType(mat, &inType)); in MatGetRootType_Private()
64 PetscErrorCode MatGetMPIMatType_Private(Mat mat, MatType *MPIType) in MatGetMPIMatType_Private() argument
71 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatGetMPIMatType_Private()
72 PetscCall(MatGetType(mat, &inType)); in MatGetMPIMatType_Private()
107 PetscErrorCode MatSetType(Mat mat, MatType matype) in MatSetType() argument
114 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatSetType()
117 PetscCall(PetscObjectTypeCompare((PetscObject)mat, matype, &sametype)); in MatSetType()
124 …if (((PetscObject)mat)->type_name) PetscCall(PetscStrbeginswith(((PetscObject)mat)->type_name, "mp… in MatSetType()
126mat), PETSC_ERR_SUP, "Changing an MPI matrix (%s) to a sequential one (%s) is not allowed. Please … in MatSetType()
132 PetscCallMPI(MPI_Comm_size(PetscObjectComm((PetscObject)mat), &size)); in MatSetType()
140 PetscCall(PetscObjectTypeCompare((PetscObject)mat, matype, &sametype)); in MatSetType()
144 …PetscCheck(r, PetscObjectComm((PetscObject)mat), PETSC_ERR_ARG_UNKNOWN_TYPE, "Unknown Mat type giv… in MatSetType()
146 …if (mat->assembled && ((PetscObject)mat)->type_name) PetscCall(PetscStrbeginswith(matype, ((PetscO… in MatSetType()
148 PetscCall(MatConvert(mat, matype, MAT_INPLACE_MATRIX, &mat)); in MatSetType()
151 if (names && mat->assembled) { in MatSetType()
154 PetscCall(MatConvert(mat, MATSELL, MAT_INPLACE_MATRIX, &mat)); /* convert to matsell first */ in MatSetType()
155 PetscCall(MatConvert(mat, matype, MAT_INPLACE_MATRIX, &mat)); in MatSetType()
159 PetscTryTypeMethod(mat, destroy); in MatSetType()
160 mat->ops->destroy = NULL; in MatSetType()
163 PetscCall(MatNullSpaceDestroy(&mat->nullsp)); in MatSetType()
164 PetscCall(MatNullSpaceDestroy(&mat->nearnullsp)); in MatSetType()
166 PetscCall(PetscMemzero(mat->ops, sizeof(struct _MatOps))); in MatSetType()
167 mat->preallocated = PETSC_FALSE; in MatSetType()
168 mat->assembled = PETSC_FALSE; in MatSetType()
169 mat->was_assembled = PETSC_FALSE; in MatSetType()
176 mat->nonzerostate++; in MatSetType()
177 PetscCall(PetscObjectStateIncrease((PetscObject)mat)); in MatSetType()
180 PetscCall((*r)(mat)); in MatSetType()
199 PetscErrorCode MatGetType(Mat mat, MatType *type) in MatGetType() argument
202 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatGetType()
204 *type = ((PetscObject)mat)->type_name; in MatGetType()
223 PetscErrorCode MatGetVecType(Mat mat, VecType *vtype) in MatGetVecType() argument
226 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatGetVecType()
228 *vtype = mat->defaultvectype; in MatGetVecType()
248 PetscErrorCode MatSetVecType(Mat mat, VecType vtype) in MatSetVecType() argument
251 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatSetVecType()
252 PetscCall(PetscFree(mat->defaultvectype)); in MatSetVecType()
253 PetscCall(PetscStrallocpy(vtype, &mat->defaultvectype)); in MatSetVecType()