[petsc-users] Using matrix-free with KSP

Barry Smith bsmith at petsc.dev
Tue May 24 13:12:46 CDT 2022


   You can use MatCreateMFFD https://petsc.org/main/docs/manualpages/Mat/MatCreateMFFD/ <https://petsc.org/main/docs/manualpages/Mat/MatCreateMFFD/> MatMFFDSetFunction MatSetFromOptions MatMFFDSetBase and provide the matrix to KSP. Note you will need to use -pc_type none or provide your own custom preconditioner with https://petsc.org/main/docs/manualpages/PC/PCSHELL/ <https://petsc.org/main/docs/manualpages/PC/PCSHELL/>



> On May 24, 2022, at 1:21 PM, Tu, Jiannan <Jiannan_Tu at uml.edu> wrote:
> 
> I want to use a matrix-free matrix to solve a large linear equation system because the matrix is too large to be stored. Petsc user manual describes matrix-free method for SNES with examples. The matrix-free matrices section explains how to set up such a matrix, but I can't find any example of matrix-free method with KSP. I am wondering how to apply the method to KSP iterative solver in parallel.
> 
> I greatly appreciate your help for me to understand this topic. 
> 
> Jiannan Tu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220524/57015e52/attachment.html>


More information about the petsc-users mailing list