Replying to my own post since I found the solution in case someone else 
ever encounters this.

It was a silly bug from my end. I basically used the empty constructor of 
LinearAlgebra::ReadWriteVector to transfer the LA::dist::Vector into the 
TrilinosWrappers::MPI::Vector. As a consequence, the resulting Trilinos 
vector was empty and would of course not have the same parallel 
distribution as the matrix it was supposed to be multiplied with.

Doug

On Wednesday, December 4, 2019 at 6:25:49 PM UTC-5, Doug Shi-Dong wrote:
>
> Hello,
>
> I am trying to solve a block system using the LinearOperators and Trilinos 
> matrices and vectors.
>
> Currently, all my matrices uses TrilinosWrappers::SparseMatrix, but my 
> vectors use the deal.II LinearAlgebra::distributed::Vector because of how 
> easily it handles ghosted vectors.
>
> When time comes to solve my typical linear system, I directly use the 
> Epetra_Vector, and give it a View, BlockMap, and vector pointer, as done in 
> step-33. For example,
>
> Epetra_Vector b(View,
> system_matrix.trilinos_matrix().RangeMap(),
> right_hand_side.begin());
>
> Note that the RangeMap of this matrix corresponds to the right_hand_side 
> locally relevant degrees of freedom.
>
> However, now that I am using the deal.II LinearOperator, I need to use the 
> TrilinosWrappers::MPI::Vector, to be consistent with the 
> TrilinosWrappers::SparseMatrix. Now this is partly fine, since I can 
> transfer dealii::LA::dist::Vector my right_hand_side to a 
> TrilinosWrappers::MPI::Vector 
> right_hand_side_trilinos using LinearAlgebra::ReadWriteVector. However, the 
> issue is that the BlockMap of right_hand_side_trilinos does not 
> correspond to the system_matrix.trilinos_matrix().RangeMap(). As a result, 
> I can't perform matrix-vector multiplication between the system_matrix and 
> the right_hand_side_trilinos.
>
> The question is basically: How can I convert a 
> LinearAlgebra::distributed::Vector into a TrilinosWrappers::MPI::Vector 
> such that the deal.II Vector's locally relevant degrees of freedom 
> correspond to the Trilinos' Vector BlockMap in order to perform the 
> appropriate matrix-vector multiplication?
>
> Another note: the matrix I'm looking to use is rectangular, and therefore 
> DomainMap() != RangeMap().
>
> Best regards,
>
> Doug
>

-- 
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/de6ced63-698b-46ea-a490-ee1572c93185%40googlegroups.com.

Reply via email to