[Trilinos-Users] Request for tpetra::RowMatrix<>::scalar_type as used by Ifpack2

Holger Brandsmeier holger.brandsmeier at sam.math.ethz.ch
Thu Jul 7 14:09:11 MDT 2011


Hello Alan,

ILUT only supports CrsMatrix? I don't see any use of Tpetra::CrsMatrix
anywhere in the source for ILUT. In fact CrsMatrix has been used
nowhere in ifpack2/src except for
Ifpack2_ExplicitInstantiationHelpers.hpp, and I suppose it could be
replaced by Tpetra::RowMatrix if you use the typedefs that Chris just
wrote he will add.

In fact the constructor for ILUT reads
	ILUT (const Teuchos::RCP< const Tpetra::RowMatrix< Scalar,
LocalOrdinal, GlobalOrdinal, Node > > &A)
so if I instantiate ILUT<Tpetra::CrsMatrix> there seems to be no
downcast of Tpetra::RowMatrix to Tpetra::CrsMatrix.

According to your design argument I wonder why the constructor reads
like this, shouldn't it be either
     ILUT (const Teuchos::RCP< const MatrixType > &A)
or the constructor stays like it is now, and the template arguments
change from MatrixType to
    class Scalar, class LocalOrdinal = int, class GlobalOrdinal
=LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType

-Holger

On Thu, Jul 7, 2011 at 20:24, Williams, Alan B <william at sandia.gov> wrote:
>> 2) why does Ifpack2 follow the style of having a base class with four
>> template parameters:
>> template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal =
>> LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
>> class Preconditioner
>> but then creates derived classes with only one template parameter:
>> template<class MatrixType> class ILUT: [...]
>> Wouldn't it be better to already have 4 template parameters in ILUT?
>
> Holger,
> The Preconditioner base-class doesn't depend on an input-matrix (none of the Preconditioner methods accept a matrix object), it only depends on those four template parameters for the low-level data-types etc.
>
> However, specific preconditioner implementations (such as ILUT) accept a matrix object and operate on it (accessing its data etc). The hope is that if the input-matrix type is a template parameter, then different matrix types (e.g. VbrMatrix vs CrsMatrix) could be supported with the same ILUT class declaration by simply specializing instantiations.
> This hasn't been tried yet, only CrsMatrix support is implemented; but that's the idea behind the design decision.
>
> Alan
>
>



-- 
Holger Brandsmeier, SAM, ETH Zürich
http://www.sam.math.ethz.ch/people/bholger




More information about the Trilinos-Users mailing list