# 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, PetscErrorCode (*fun)(void *, Vec, Vec, PetscScalar *), void *ctx)
```
Logically Collective on mat


## Input Parameters

- ***J -*** the `MATMFFD` matrix
- ***fun -*** the function that checks h
- ***ctx -*** any context needed by the function



## Options Database Keys

- ***-mat_mffd_check_positivity <bool> -*** Insure 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
 `MATMFFD`, `MatMFFDCheckPositivity()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/mffd/mffd.c.html#MatMFFDSetCheckh">src/mat/impls/mffd/mffd.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/mffd/mffd.c.html#MatMFFDSetCheckh_MFFD">MatMFFDSetCheckh_MFFD in src/mat/impls/mffd/mffd.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/mffd/mffd.c)


[Index of all Mat routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
