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