[petsc-users] Element by element comparison of matrices

Stefano Zampini stefano.zampini at gmail.com
Thu Jan 2 15:51:22 CST 2025


MatAXPY for the difference, MatNorm for the relative error

On Thu, Jan 2, 2025, 22:32 Hammond, Glenn E via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> PETSc Users,
>
>
>
> I want to compare two Jacobians matrices (one with derivatives calculated
> analytically; the other numerically). I want to apply relatives and/or
> absolute tolerances. Does anyone know if such capability is built into
> PETSc? I cannot find anything other the MatEqual() with compares down to
> the bit. Otherwise, I plan to use MatGetValues() and compare the elements
> individually. Just hoping there is something more convenient hidden
> somewhere.
>
>
>
> Thanks,
>
>
>
> Glenn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250102/7c713025/attachment.html>


More information about the petsc-users mailing list