petsc-3.7.1 2016-05-15
Report Typos and Errors

# MatMFFDSetFunctionError

Sets the error_rel for the approximation of matrix-vector products using finite differences.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode  MatMFFDSetFunctionError(Mat mat,PetscReal error)

Logically Collective on Mat Many br

### Input Parameters

| mat | - the matrix free matrix created via MatCreateMFFD() or MatCreateSNESMF() Many br
| error_rel | - relative error (should be set to the square root of Many brthe relative error in the function evaluations) Many br

### Options Database Keys

| -mat_mffd_err <error_rel> | - Sets error_rel Many br

Many br

### Notes

The default matrix-free matrix-vector product routine computes Many br

         F'(u)*a = [F(u+h*a) - F(u)]/h where
         h = error_rel*u'a/||a||^2                        if  |u'a| > umin*||a||_{1}
           = error_rel*umin*sign(u'a)*||a||_{1}/||a||^2   else

Many br

### Keywords

SNES, matrix-free, parameters

### See Also

MatCreateSNESMF(),MatMFFDGetH(), MatCreateMFFD(), MATMFFD
MatMFFDSetHHistory(), MatMFFDResetHHistory() Many br

Level:advanced
Location:src/mat/impls/mffd/mffd.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages