[petsc-users] The Matrix and Vector Format Convert between PETSc and HYPRE

Sijie Tang sijietang1995 at gmail.com
Sat Feb 5 23:34:35 CST 2022

I make a mistake there is no hypre_ParCSRVector, that should be hypre_ParVector.


> On Feb 5, 2022, at 21:53, Sijie Tang <sijietang1995 at gmail.com> wrote:
> Hi developer,
> I have many questions about he Matrix and Vector Format Convert between PETSc and HYPRE, could you give me some answers or hints?
> Can I convert MATHYPRE (in PETSc) to hypre_ParCSRMatrix ( HYPRE ) use function MatHYPREGetParCSR() (in PETSc) ? 
> for 2, or I should use MatHYPRE_IJMatrixCreate  and MatHYPRE_IJMatrixCopy to get hypre_IJMatrix, then hypre_IJMatrix convert to hypre_ParCSRMatrix ?
> for the vector, I don't find any function can convert vector in PETSc to hypre_ParCSRVector, Is there any function can do this work ?
> But I find I can use VecHYPRE_IJVectorCreate and VecHYPRE_IJVectorCopy to get hypre_IJVector, then hypre_IJVector convert to hypre_ParCSRVector?
> Is there any function can convert the format back? like hypre_ParCSRMatrix convert to MATHYPRE, and hypre_ParCSRVector convert to PETSc's vector?
> Thanks,
> Sijie

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

More information about the petsc-users mailing list