Matrix-free with Petsc vectors

40 views
Skip to first unread message

Thomas Cheetham

unread,
Jan 16, 2025, 12:35:43 PM1/16/25
to deal.II User Group
Hello,

I have a working matrix-based solver using Petsc vectors which i am currently trying to transform to a matrix-free code. When I use the deal.ii Matrix-free infrastructure with Petsc-vectors eg. using the distribute_local_to_global function I get the following error message:

 error: cannot convert ‘dealii::LinearAlgebraPETSc::MPI::Vector’ {aka ‘dealii::PETScWrappers::MPI::Vector’} to ‘dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host>&’
   51 |     system_matrix.initialize_dof_vector(system_rhs);
      |                                         ^~~~~~~~~~

I was wondering if there was a way of interfacing the Matrix-free infrastructure to Petsc vectors or alternatively a method of copying a dealii distributed vector to a Petsc MPI vector?

Many thanks,

Tom

Reply all
Reply to author
Forward
0 new messages