46 #ifndef MUELU_IFPACK2SMOOTHER_DECL_HPP 47 #define MUELU_IFPACK2SMOOTHER_DECL_HPP 49 #include <Teuchos_ParameterList.hpp> 56 #ifdef HAVE_XPETRA_TPETRA // needed for clone() 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,
94 #undef MUELU_IFPACK2SMOOTHER_SHORT 139 template<
class Scalar2,
class LocalOrdinal2,
class GlobalOrdinal2,
class Node2>
143 Ifpack2Smoother(
const std::string& type,
const Teuchos::ParameterList& paramList = Teuchos::ParameterList(),
const LO& overlap = 0);
179 void Apply(MultiVector& X,
const MultiVector& B,
bool InitialGuessIsZero =
false)
const;
186 RCP<SmootherPrototype>
Copy()
const;
191 template<
typename Node2>
192 RCP<MueLu::Ifpack2Smoother<Scalar,LocalOrdinal,GlobalOrdinal,Node2> >
209 void SetPrecParameters(
const Teuchos::ParameterList& list = Teuchos::ParameterList())
const;
225 RCP<Ifpack2::Preconditioner<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
prec_;
232 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
233 template<
typename Node2>
234 RCP<MueLu::Ifpack2Smoother<Scalar,LocalOrdinal,GlobalOrdinal,Node2> >
236 #ifdef HAVE_XPETRA_TPETRA 237 const ParameterList& paramList = this->GetParameterList();
240 RCP<Ifpack2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node2> > cloneSmoother =
244 RCP<const Xpetra::CrsMatrixWrap<Scalar, LocalOrdinal, GlobalOrdinal, Node2> > crsOp =
246 const RCP<const Xpetra::TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node2> >& tmp =
250 cloneSmoother->prec_ = factory.
clone<Matrix1, Matrix2>(prec_, tmp->getTpetra_CrsMatrix(), paramList);
251 cloneSmoother->type_ = type_;
252 cloneSmoother->SetParameterList(paramList);
253 cloneSmoother->IsSetup(this->IsSetup());
254 return cloneSmoother;
257 "MueLu::Ifpack2Smoother::clone(): clone only available with Tpetra.");
261 #ifdef HAVE_MUELU_EPETRA 263 # if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ 264 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) 272 #undef MUELU_AMESOS2SMOOTHER_SHORT 278 template<
class Scalar2,
class LocalOrdinal2,
class GlobalOrdinal2,
class Node2>
291 void Apply(MultiVector& X,
const MultiVector& B,
bool InitialGuessIsZero =
false)
const {}
292 RCP<SmootherPrototype>
Copy()
const {
return Teuchos::null;}
294 template<
typename Node2>
295 RCP<MueLu::Ifpack2Smoother<Scalar,LocalOrdinal,GlobalOrdinal,Node2> >
296 clone(
const RCP<Node2>& node2,
const Teuchos::RCP<const Matrix >& A_newnode)
const {
return Teuchos::null; }
304 #endif // HAVE_MUELU_EPETRA 308 #define MUELU_IFPACK2SMOOTHER_SHORT 309 #endif // HAVE_MUELU_TPETRA && HAVE_MUELU_IFPACK2 310 #endif // MUELU_IFPACK2SMOOTHER_DECL_HPP Ifpack2Smoother(const std::string &type, const Teuchos::ParameterList ¶mList=Teuchos::ParameterList(), const LocalOrdinal &overlap=0)
void Setup(Level ¤tLevel)
void SetupGeneric(Level ¤tLevel)
RCP< SmootherPrototype > Copy() const
void SetPrecParameters(const Teuchos::ParameterList &list=Teuchos::ParameterList()) const
std::string description() const
Return a simple one-line description of this object.
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply smoother.
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
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())
virtual ~Ifpack2Smoother()
LO overlap_
overlap when using the smoother in additive Schwarz mode
void SetParameterList(const Teuchos::ParameterList ¶mList)
RCP< MueLu::Ifpack2Smoother< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > clone(const RCP< Node2 > &node2, const Teuchos::RCP< const Matrix > &A_newnode) const
std::string type_
ifpack2-specific key phrase that denote smoother type
void SetupSchwarz(Level ¤tLevel)
void SetupLineSmoothing(Level ¤tLevel)
Class that holds all level-specific information.
void Setup(Level ¤tLevel)
Set up the smoother.
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply the preconditioner.
#define MUELU_TPETRA_ETI_EXCEPTION(cl, obj, go)
void DeclareInput(Level ¤tLevel) const
Input.
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
virtual ~Ifpack2Smoother()
Destructor.
void DeclareInput(Level ¤tLevel) const
Input.
GlobalOrdinal global_ordinal_type
void SetPrecParameters(const Teuchos::ParameterList &list=Teuchos::ParameterList()) const
RCP< SmootherPrototype > Copy() const
std::string description() const
Return a simple one-line description of this object.
Exception throws to report errors in the internal logical of the program.
void SetupChebyshev(Level ¤tLevel)
Class that encapsulates Ifpack2 smoothers.
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
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.
RCP< Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node > > prec_
pointer to Ifpack2 preconditioner object