[petsc-users] Using PETSc solvers and preconditioners with mfem

Matthew Knepley knepley at gmail.com
Tue Oct 25 12:53:48 CDT 2016


On Tue, Oct 25, 2016 at 12:50 PM, Jed Brown <jed at jedbrown.org> wrote:

> Matthew Knepley <knepley at gmail.com> writes:
>
> > On Tue, Oct 25, 2016 at 12:19 PM, Stefano Zampini <
> stefano.zampini at gmail.com
> >> wrote:
> >
> >> I have a working conversion from HypreParCSR to PETSc MPIAIJ format.
> >> I could add this code to PETSc, maybe in the contrib folder. Barry, what
> >> do you think?
> >>
> >
> > No, no one looks there. Add it to src/mat/utils and make an interface
> > function like MatCreateFromHypreParCSR().
>
> Note that mhyp.c contains code to convert AIJ matrices to ParCSR.  If we
> were to create a MatHypreParCSR implementation, we could use those
> functions for MatConvert_{Seq,MPI}AIJ_HypreParCSR and use your function
> for the reverse.  That would be consistent with how external matrix
> formats are normally represented and may enable some new capability to
> mix PETSc and Hypre components in the future.  Here, I'm envisioning
>
>   PetscErrorCode MatCreateHypreParCSR(hyper_ParCSRMatrix *A,Mat *B);
>
> This way, if a user chooses -pc_type hypre, there would be no copies for
> going through PETSc.  Similarly, if we implement
> MatSetValues_HypreParCSR, a pure PETSc application could use Hypre
> preconditioners with no copies.
>

This is a better way, but I did not suggest it because it entails the extra
work of implementing
the Mat methods for the new class. If Stefano has time for that, fantastic.

  Matt

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20161025/94cd1a5d/attachment-0001.html>


More information about the petsc-users mailing list