46 #ifndef MUELU_IFPACK2SMOOTHER_DECL_HPP 47 #define MUELU_IFPACK2SMOOTHER_DECL_HPP 49 #include <Teuchos_ParameterList.hpp> 51 #include <Xpetra_BlockedCrsMatrix_fwd.hpp> 52 #include <Xpetra_CrsMatrixWrap.hpp> 53 #include <Xpetra_Matrix_fwd.hpp> 54 #include <Xpetra_Matrix.hpp> 55 #include <Xpetra_MultiVectorFactory_fwd.hpp> 56 #ifdef HAVE_XPETRA_TPETRA // needed for clone() 57 #include <Xpetra_TpetraCrsMatrix.hpp> 63 #if defined(HAVE_MUELU_TPETRA) && defined(HAVE_MUELU_IFPACK2) 65 #include <Tpetra_CrsMatrix.hpp> 67 #include <Ifpack2_Factory_decl.hpp> 68 #include <Ifpack2_Factory_def.hpp> 74 #include "MueLu_SmootherPrototype.hpp" 89 template <class Scalar = SmootherPrototype<>::scalar_type,
95 #undef MUELU_IFPACK2SMOOTHER_SHORT 140 template<
class Scalar2,
class LocalOrdinal2,
class GlobalOrdinal2,
class Node2>
144 Ifpack2Smoother(
const std::string& type,
const Teuchos::ParameterList& paramList = Teuchos::ParameterList(),
const LO& overlap = 0);
180 void Apply(MultiVector& X,
const MultiVector& B,
bool InitialGuessIsZero =
false)
const;
187 RCP<SmootherPrototype>
Copy()
const;
192 template<
typename Node2>
193 RCP<MueLu::Ifpack2Smoother<Scalar,LocalOrdinal,GlobalOrdinal,Node2> >
194 clone(
const RCP<Node2>& node2,
const Teuchos::RCP<
const Xpetra::Matrix<Scalar,LocalOrdinal,GlobalOrdinal,Node2> >& A_newnode)
const;
210 void SetPrecParameters(
const Teuchos::ParameterList& list = Teuchos::ParameterList())
const;
221 RCP<Ifpack2::Preconditioner<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
prec_;
228 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
229 template<
typename Node2>
230 RCP<MueLu::Ifpack2Smoother<Scalar,LocalOrdinal,GlobalOrdinal,Node2> >
232 #ifdef HAVE_XPETRA_TPETRA 234 typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> Matrix1;
235 typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node2> Matrix2;
236 RCP<Ifpack2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node2> > cloneSmoother =
240 RCP<const Xpetra::CrsMatrixWrap<Scalar, LocalOrdinal, GlobalOrdinal, Node2> > crsOp =
241 rcp_dynamic_cast<
const Xpetra::CrsMatrixWrap<Scalar, LocalOrdinal, GlobalOrdinal, Node2> >(A_newnode);
242 const RCP<const Xpetra::TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node2> >& tmp =
243 rcp_dynamic_cast<
const Xpetra::TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node2> >(crsOp->getCrsMatrix());
246 cloneSmoother->prec_ = factory.
clone<Matrix1, Matrix2>(
prec_, tmp->getTpetra_CrsMatrix(), paramList);
247 cloneSmoother->type_ =
type_;
248 cloneSmoother->SetParameterList(paramList);
249 cloneSmoother->IsSetup(this->
IsSetup());
250 return cloneSmoother;
253 "MueLu::Ifpack2Smoother::clone(): clone only available with Tpetra.");
260 #define MUELU_IFPACK2SMOOTHER_SHORT 261 #endif // HAVE_MUELU_TPETRA && HAVE_MUELU_IFPACK2 262 #endif // MUELU_IFPACK2SMOOTHER_DECL_HPP void DeclareInput(Level ¤tLevel) const
Input.
friend class Ifpack2Smoother
Constructor.
RCP< Matrix > A_
matrix, used in apply if solving residual equation
Base class for smoother prototypes.
void SetParameterList(const Teuchos::ParameterList ¶mList)
Namespace for MueLu classes and methods.
LocalOrdinal local_ordinal_type
virtual const Teuchos::ParameterList & GetParameterList() const
static Teuchos::RCP< Preconditioner< typename OutputMatrixType::scalar_type, typename OutputMatrixType::local_ordinal_type, typename OutputMatrixType::global_ordinal_type, typename OutputMatrixType::node_type > > clone(const Teuchos::RCP< Preconditioner< typename InputMatrixType::scalar_type, typename InputMatrixType::local_ordinal_type, typename InputMatrixType::global_ordinal_type, typename InputMatrixType::node_type > > &prec, const Teuchos::RCP< const OutputMatrixType > &matrix, const Teuchos::ParameterList ¶ms=Teuchos::ParameterList())
LO overlap_
overlap when using the smoother in additive Schwarz mode
std::string type_
ifpack2-specific key phrase that denote smoother type
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
RCP< SmootherPrototype > Copy() const
Class that holds all level-specific information.
void Setup(Level ¤tLevel)
Set up the smoother.
std::string description() const
Return a simple one-line description of this object.
bool IsSetup() const
Get the state of a smoother prototype.
void SetPrecParameters(const Teuchos::ParameterList &list=Teuchos::ParameterList()) const
virtual ~Ifpack2Smoother()
Destructor.
GlobalOrdinal global_ordinal_type
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply the preconditioner.
Exception throws to report errors in the internal logical of the program.
RCP< MueLu::Ifpack2Smoother< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > clone(const RCP< Node2 > &node2, const Teuchos::RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > &A_newnode) const
Clone the smoother to a different node type.
Class that encapsulates Ifpack2 smoothers.
RCP< Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node > > prec_
pointer to Ifpack2 preconditioner object