Ifpack2 Templated Preconditioning Package  Version 1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Ifpack2_BorderedOperator_def.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
4 //
5 // Copyright 2009 NTESS and the Ifpack2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 
11 #ifndef IFPACK2_BORDEREDOPERATOR_DEF_HPP
12 #define IFPACK2_BORDEREDOPERATOR_DEF_HPP
13 
14 #include "Ifpack2_BorderedOperator_decl.hpp"
15 #include "Tpetra_MultiVector.hpp"
17 
18 namespace Ifpack2 {
19 
20 template< class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node >
22 BorderedOperator (const Teuchos::RCP<const Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node > >& A) :
23  A_ (A)
24 {
26  A_.is_null (), std::runtime_error,
27  Teuchos::typeName (*this) << "::BorderedOperator constructor: "
28  "The input Operator A is null.");
29 }
30 
31 template< class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node >
34 {
35  return A_->getDomainMap();
36 }
37 
38 template< class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node >
41 {
42  return A_->getRangeMap();
43 }
44 
45 template< class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node >
46 bool
48 {
49  return A_->hasTransposeApply();
50 }
51 
52 template< class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node >
53 void
55 apply (const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node >& X,
56  Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node >& Y,
57  Teuchos::ETransp mode,
58  Scalar coefAx,
59  Scalar coefY ) const
60 {
62  X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
63  "Ifpack2::BorderedOperator::apply(): X.getNumVectors() = "
64  << X.getNumVectors() << " != Y.getNumVectors() = "
65  << Y.getNumVectors() << ".");
66  A_->apply (X, Y, mode, coefAx, coefY );
67 }
68 
69 } // namespace Ifpack2
70 
71 #define IFPACK2_BORDEREDOPERATOR_INSTANT(S,LO,GO,N) \
72  template class Ifpack2::BorderedOperator< S, LO, GO, N >;
73 
74 #endif /* IFPACK2_BorderedOperator_DEF_HPP */
virtual Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
The range Map of this operator. It must be compatible with Y.getMap().
Definition: Ifpack2_BorderedOperator_def.hpp:40
void apply(const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Apply the bordered operator.
Definition: Ifpack2_BorderedOperator_def.hpp:55
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
The domain Map of this operator. It must be compatible with X.getMap().
Definition: Ifpack2_BorderedOperator_def.hpp:33
bool hasTransposeApply() const
Whether this operator can apply the transpose or conjugate transpose.
Definition: Ifpack2_BorderedOperator_def.hpp:47
BorderedOperator(const Teuchos::RCP< const Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &A)
Constructor with Tpetra::Operator input.
Definition: Ifpack2_BorderedOperator_def.hpp:22
std::string typeName(const T &t)
bool is_null() const