Skip to main content
`Ctrl`+`K`

# MatMFFDSetCheckh

Sets a function that checks the computed `h` and adjusts it to satisfy some criteria for the `MATMFFD` matrix

## Synopsis

    #include "petscmat.h"
    PetscErrorCode MatMFFDSetCheckh(Mat J, MatMFFDCheckhFn *fun, PetscCtx ctx)

Logically Collective

## Input Parameters

- J - the `MATMFFD` matrix

- fun - the function that checks `h`, see `MatMFFDCheckhFn`

- ctx - any context needed by the function

## Options Database Keys

- -mat_mffd_check_positivity (true|false) - Ensure that \(U + h*a \) is non-negative

## Notes

For example, `MatMFFDCheckPositivity()` insures that all entries of U + h*a are non-negative

The function you provide is called after the default `h` has been computed and allows you to modify it.

## See Also

Matrices, `Mat`, `MATMFFD`, `MatMFFDCheckhFn`, `MatMFFDCheckPositivity()`

## Level

advanced

## Location

src/mat/impls/mffd/mffd.c

## Implementations

MatMFFDSetCheckh_MFFD() in src/mat/impls/mffd/mffd.c

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages