[Trilinos-Users] CrsMatrix manipulations: get submatrix

Prokopenko, Andrey V. prokopenkoav at ornl.gov
Fri Feb 24 11:42:11 EST 2017


Hi wd,

I think there is variant number 4): construct a wrapper around a base 
matrix. You may want to take a look at 
trilinos/packages/ifpack2/src/Ifpack2_LocalFilter_decl.hpp for an 
example of how it could be done. This would be a variant with a smallest 
footprint.

-Andrey

On 02/24/2017 09:24 AM, whitedwarf wrote:
> Dear all,
>
> I have a question regarding matrix manipulations. I need to make heavy
> use of submatrices of a base matrix, i.e. get a specific part (in both
> dimensions) of the full matrix. E.g.: M_{p,...,q},{r,...,s} of
> M_{0,...,m},{0,...,n}.
> In the documentation, I did not manage to find any direct way to
> accomplish this. However, I can think of some workarounds but they all
> have obvious drawbacks:
> 1) Tpetra::CrsMatrix::getColumnMapMultiVector + "Offset view"
> constructor of Tpetra::MultiVector
> 2) Tpetra::CrsMatrix::replaceGlobalValues with zeros
> 3) Manually assemble a new matrix using data from
> CrsMatrix::getLocalMatrix or CrsMatrix::getLocalRowView
>
> Can you please tell me which one is preferable, especially when memory
> footprint matters? Is there any more direct way that I did not found?
>
> Best regards,
>
> wd
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at trilinos.org
> https://trilinos.org/mailman/listinfo/trilinos-users
>



More information about the Trilinos-Users mailing list