Dear, deal.ii colleagues,

A vector conversion problem has been troubled me for a long time.

It is the conversion between between dealii::PETScWrappers::MPI::Vector and 
a PETSc Vec.

I have some functions written based on PETSc directly. So that I would like 
to use them directly in deal.ii. However, I need to convert vectors between 
dealii's MPI vectors to PETSc's generic vectors.

Here is an simplified example:
Vec a;  // PETSc vector
VecDuplicate(x, &a);  // x is a dealii::PETScWrappers::MPI Vector generated 
previously
VecCopy(x, a);   
dealii::PETScWrappers::MPI::Vector b(a);   // dealii MPI vector

I try to construct a dealii vector named with "b" based on PETSc Vector 
named "a". This should be OK in my opinion based on the constructor that is 
VectorBase 
<https://www.dealii.org/current/doxygen/deal.II/classPETScWrappers_1_1VectorBase.html#a08f6d7c4850e085271c225c5c19d7502>
 
(const Vec &v) in the deal.ii's document: 
https://www.dealii.org/current/doxygen/deal.II/classPETScWrappers_1_1VectorBase.html#a08f6d7c4850e085271c225c5c19d7502

In addition, dealii::PETScWrappers::MPI::Vector is inherited from 
VectorBase, so the constructor VectorBase 
<https://www.dealii.org/current/doxygen/deal.II/classPETScWrappers_1_1VectorBase.html#a08f6d7c4850e085271c225c5c19d7502>
 
(const Vec &v) should be able to be called by 
dealii::PETScWrappers::MPI::Vector as well.

However, the error reported is:
no matching function for call to 
dealii::PETScWrappers::MPI::Vector::Vector(_p_Vec*&)


So may I get some information about this vector conversion problem?
Thank you very much in advance!

Zhidong Brian Zhang


BTW, I found some info in the following forum but it is related to Mat 
conversion between deal.ii and PETSc:
https://groups.google.com/forum/#!searchin/dealii/petscwrappers$3A$3Avector|sort:date/dealii/1HHsnUeJC28/qgBaE0SVBgAJ

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/b013a870-32bd-4d91-884d-1b3fc2eff9a3%40googlegroups.com.

Reply via email to