Lines Matching refs:mat
69 static PetscErrorCode MatMFFDSetType_MFFD(Mat mat, MatMFFDType ftype) in MatMFFDSetType_MFFD() argument
76 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatMFFDSetType_MFFD()
78 PetscCall(MatShellGetContext(mat, &ctx)); in MatMFFDSetType_MFFD()
88 …PetscCheck(r, PetscObjectComm((PetscObject)mat), PETSC_ERR_ARG_UNKNOWN_TYPE, "Unknown MatMFFD type… in MatMFFDSetType_MFFD()
117 PetscErrorCode MatMFFDSetType(Mat mat, MatMFFDType ftype) in MatMFFDSetType() argument
120 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatMFFDSetType()
122 PetscTryMethod(mat, "MatMFFDSetType_C", (Mat, MatMFFDType), (mat, ftype)); in MatMFFDSetType()
129 static PetscErrorCode MatMFFDSetFunctioniBase_MFFD(Mat mat, FCN1 func) in MatMFFDSetFunctioniBase_MFFD() argument
134 PetscCall(MatShellGetContext(mat, &ctx)); in MatMFFDSetFunctioniBase_MFFD()
140 static PetscErrorCode MatMFFDSetFunctioni_MFFD(Mat mat, FCN2 funci) in MatMFFDSetFunctioni_MFFD() argument
145 PetscCall(MatShellGetContext(mat, &ctx)); in MatMFFDSetFunctioni_MFFD()
147 PetscCall(MatShellSetOperation(mat, MATOP_GET_DIAGONAL, (PetscErrorCodeFn *)MatGetDiagonal_MFFD)); in MatMFFDSetFunctioni_MFFD()
151 static PetscErrorCode MatMFFDGetH_MFFD(Mat mat, PetscScalar *h) in MatMFFDGetH_MFFD() argument
156 PetscCall(MatShellGetContext(mat, &ctx)); in MatMFFDGetH_MFFD()
203 static PetscErrorCode MatDestroy_MFFD(Mat mat) in MatDestroy_MFFD() argument
208 PetscCall(MatShellGetContext(mat, &ctx)); in MatDestroy_MFFD()
215 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatMFFDSetBase_C", NULL)); in MatDestroy_MFFD()
216 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatMFFDSetFunctioniBase_C", NULL)); in MatDestroy_MFFD()
217 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatMFFDSetFunctioni_C", NULL)); in MatDestroy_MFFD()
218 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatMFFDSetFunction_C", NULL)); in MatDestroy_MFFD()
219 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatMFFDSetFunctionError_C", NULL)); in MatDestroy_MFFD()
220 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatMFFDSetCheckh_C", NULL)); in MatDestroy_MFFD()
221 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatMFFDSetPeriod_C", NULL)); in MatDestroy_MFFD()
222 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatMFFDResetHHistory_C", NULL)); in MatDestroy_MFFD()
223 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatMFFDSetHHistory_C", NULL)); in MatDestroy_MFFD()
224 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatMFFDSetType_C", NULL)); in MatDestroy_MFFD()
225 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatMFFDGetH_C", NULL)); in MatDestroy_MFFD()
226 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatSNESMFSetReuseBase_C", NULL)); in MatDestroy_MFFD()
227 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatSNESMFGetReuseBase_C", NULL)); in MatDestroy_MFFD()
228 PetscCall(PetscObjectComposeFunction((PetscObject)mat, "MatShellSetContext_C", NULL)); in MatDestroy_MFFD()
303 static PetscErrorCode MatMult_MFFD(Mat mat, Vec a, Vec y) in MatMult_MFFD() argument
311 PetscCall(MatShellGetContext(mat, &ctx)); in MatMult_MFFD()
312 …PetscCheck(ctx->current_u, PetscObjectComm((PetscObject)mat), PETSC_ERR_ARG_WRONGSTATE, "MatMFFDSe… in MatMult_MFFD()
326 PetscCall(MatMFFDSetType(mat, MATMFFD_WP)); in MatMult_MFFD()
327 PetscCall(MatSetFromOptions(mat)); in MatMult_MFFD()
336 …PetscCheck(!mat->erroriffailure || !PetscIsInfOrNanScalar(h), PETSC_COMM_SELF, PETSC_ERR_PLIB, "Co… in MatMult_MFFD()
342 …PetscCall(PetscInfo(mat, "Current differencing parameter: %g + %g i\n", (double)PetscRealPart(h), … in MatMult_MFFD()
344 PetscCall(PetscInfo(mat, "Current differencing parameter: %15.12e\n", (double)PetscRealPart(h))); in MatMult_MFFD()
371 if (mat->nullsp) PetscCall(MatNullSpaceRemove(mat->nullsp, y)); in MatMult_MFFD()
385 static PetscErrorCode MatGetDiagonal_MFFD(Mat mat, Vec a) in MatGetDiagonal_MFFD() argument
394 PetscCall(MatShellGetContext(mat, &ctx)); in MatGetDiagonal_MFFD()
483 PetscErrorCode MatMFFDSetOptionsPrefix(Mat mat, const char prefix[]) in MatMFFDSetOptionsPrefix() argument
488 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatMFFDSetOptionsPrefix()
489 PetscCall(MatShellGetContext(mat, &mfctx)); in MatMFFDSetOptionsPrefix()
495 static PetscErrorCode MatSetFromOptions_MFFD(Mat mat, PetscOptionItems PetscOptionsObject) in MatSetFromOptions_MFFD() argument
502 PetscCall(MatShellGetContext(mat, &mfctx)); in MatSetFromOptions_MFFD()
506 if (flg) PetscCall(MatMFFDSetType(mat, ftype)); in MatSetFromOptions_MFFD()
513 if (flg) PetscCall(MatMFFDSetCheckh(mat, MatMFFDCheckPositivity, NULL)); in MatSetFromOptions_MFFD()
522 static PetscErrorCode MatMFFDSetPeriod_MFFD(Mat mat, PetscInt period) in MatMFFDSetPeriod_MFFD() argument
527 PetscCall(MatShellGetContext(mat, &ctx)); in MatMFFDSetPeriod_MFFD()
532 static PetscErrorCode MatMFFDSetFunction_MFFD(Mat mat, MatMFFDFn *func, void *funcctx) in MatMFFDSetFunction_MFFD() argument
537 PetscCall(MatShellGetContext(mat, &ctx)); in MatMFFDSetFunction_MFFD()
543 static PetscErrorCode MatMFFDSetFunctionError_MFFD(Mat mat, PetscReal error) in MatMFFDSetFunctionError_MFFD() argument
549 PetscCall(MatShellGetContext(mat, &ctx)); in MatMFFDSetFunctionError_MFFD()
615 mfctx->mat = A; in MatCreate_MFFD()
733 PetscErrorCode MatMFFDGetH(Mat mat, PetscScalar *h) in MatMFFDGetH() argument
736 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatMFFDGetH()
738 PetscUseMethod(mat, "MatMFFDGetH_C", (Mat, PetscScalar *), (mat, h)); in MatMFFDGetH()
763 PetscErrorCode MatMFFDSetFunction(Mat mat, MatMFFDFn *func, void *funcctx) in MatMFFDSetFunction() argument
766 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatMFFDSetFunction()
767 PetscTryMethod(mat, "MatMFFDSetFunction_C", (Mat, MatMFFDFn *, void *), (mat, func, funcctx)); in MatMFFDSetFunction()
792 PetscErrorCode MatMFFDSetFunctioni(Mat mat, MatMFFDiFn *funci) in MatMFFDSetFunctioni() argument
795 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatMFFDSetFunctioni()
796 PetscTryMethod(mat, "MatMFFDSetFunctioni_C", (Mat, MatMFFDiFn *), (mat, funci)); in MatMFFDSetFunctioni()
820 PetscErrorCode MatMFFDSetFunctioniBase(Mat mat, MatMFFDiBaseFn *func) in MatMFFDSetFunctioniBase() argument
823 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatMFFDSetFunctioniBase()
824 PetscTryMethod(mat, "MatMFFDSetFunctioniBase_C", (Mat, MatMFFDiBaseFn *), (mat, func)); in MatMFFDSetFunctioniBase()
845 PetscErrorCode MatMFFDSetPeriod(Mat mat, PetscInt period) in MatMFFDSetPeriod() argument
848 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatMFFDSetPeriod()
849 PetscValidLogicalCollectiveInt(mat, period, 2); in MatMFFDSetPeriod()
850 PetscTryMethod(mat, "MatMFFDSetPeriod_C", (Mat, PetscInt), (mat, period)); in MatMFFDSetPeriod()
879 PetscErrorCode MatMFFDSetFunctionError(Mat mat, PetscReal error) in MatMFFDSetFunctionError() argument
882 PetscValidHeaderSpecific(mat, MAT_CLASSID, 1); in MatMFFDSetFunctionError()
883 PetscValidLogicalCollectiveReal(mat, error, 2); in MatMFFDSetFunctionError()
884 PetscTryMethod(mat, "MatMFFDSetFunctionError_C", (Mat, PetscReal), (mat, error)); in MatMFFDSetFunctionError()