I think that this is a use case that we should support: for example, 
PETScWrappers::VectorBase can act as a wrapper around a user-provided Vec 
so we should definitely consider providing similar functionality for 
PETScWrappers::MatrixBase.

On Wednesday, May 24, 2017 at 5:18:46 AM UTC-4, Juan Carlos Araujo Cabarcas 
wrote:
>
> Dear all,
>
> I have a matrix written by using PETSc in a Binary file, and I am trying 
> work with it in my dealii environment. For this, I read a system matrix 
> from PETSc:
>
> Mat               M_read;
>
> PetscViewerBinaryOpen(PETSC_COMM_WORLD,file.c_str (),FILE_MODE_READ,&fd);
> MatCreate(PETSC_COMM_WORLD, &M_read);
> MatSetOptionsPrefix( M_read,"m_");
> MatSetFromOptions( M_read );
> MatLoad( local_M ,fd);
> PetscViewerDestroy(&fd);
> MatGetSize( M_read ,&mm,&nn);
> MatGetInfo( M_read ,MAT_LOCAL,&matinfo);
> printf("matinfo.nz_used %g\n", matinfo.nz_used);
>
> and I would like to initialize a *dealii PETScWrappers::SparseMatrix *by 
> using *M_read*.
>
> If I try the naĩve way:
>   PETScWrappers::SparseMatrix M = PETScWrappers::SparseMatrix (M_read);
>
> I get the error:
>
> error: ‘dealii::PETScWrappers::SparseMatrix::SparseMatrix(const 
> dealii::PETScWrappers::SparseMatrix&)’ is private
>      SparseMatrix(const SparseMatrix &);
>
> I know the *PETScWrappers::SparseMatrix* contains the protected member *Mat 
> matrix*, but I quite don't know how to copy it to initialize *M*.
>
> Is there a way to achieve this? any help is appreciated!
>
> Thanks in advance,
> Juan Carlos Araújo,
> Umeå Universitet
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to