46 #ifndef MUELU_IFPACK2SMOOTHER_DECL_HPP
47 #define MUELU_IFPACK2SMOOTHER_DECL_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,
90 class LocalOrdinal =
typename SmootherPrototype<Scalar>::local_ordinal_type,
91 class GlobalOrdinal =
typename SmootherPrototype<Scalar, LocalOrdinal>::global_ordinal_type,
92 class Node =
typename SmootherPrototype<Scalar, LocalOrdinal, GlobalOrdinal>::node_type>
94 #undef MUELU_IFPACK2SMOOTHER_SHORT
139 template<
class Scalar2,
class LocalOrdinal2,
class GlobalOrdinal2,
class Node2>
179 void Apply(MultiVector& X,
const MultiVector& B,
bool InitialGuessIsZero =
false)
const;
190 #ifdef HAVE_MUELU_DEPRECATED_CODE
191 template<
typename Node2>
243 #ifdef HAVE_MUELU_DEPRECATED_CODE
244 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
245 template<
typename Node2>
249 #ifdef HAVE_XPETRA_TPETRA
251 typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> Matrix1;
252 typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node2> Matrix2;
263 cloneSmoother->prec_ = factory.clone<Matrix1, Matrix2>(prec_, tmp->getTpetra_CrsMatrix(), paramList);
264 cloneSmoother->type_ = type_;
265 cloneSmoother->SetParameterList(paramList);
266 cloneSmoother->IsSetup(this->IsSetup());
267 return cloneSmoother;
270 "MueLu::Ifpack2Smoother::clone(): clone only available with Tpetra.");
275 #ifdef HAVE_MUELU_EPETRA
277 # if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
278 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
286 #undef MUELU_AMESOS2SMOOTHER_SHORT
292 template<
class Scalar2,
class LocalOrdinal2,
class GlobalOrdinal2,
class Node2>
305 void Apply(MultiVector& X,
const MultiVector& B,
bool InitialGuessIsZero =
false)
const {}
308 #ifdef HAVE_MUELU_DEPRECATED_CODE
309 template<
typename Node2>
325 #endif // HAVE_MUELU_EPETRA
329 #define MUELU_IFPACK2SMOOTHER_SHORT
330 #endif // HAVE_MUELU_TPETRA && HAVE_MUELU_IFPACK2
331 #endif // MUELU_IFPACK2SMOOTHER_DECL_HPP
Ifpack2Smoother(const std::string &type, const Teuchos::ParameterList ¶mList=Teuchos::ParameterList(), const LocalOrdinal &overlap=0)
void DeclareInput(Level ¤tLevel) const
Input.
void Setup(Level ¤tLevel)
void SetupGeneric(Level ¤tLevel)
RCP< Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const Map< LocalOrdinal, GlobalOrdinal, Node1 > &map, const RCP< Node2 > &node2)
RCP< Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getPreconditioner()
For diagnostic purposes.
friend class Ifpack2Smoother
Constructor.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
RCP< Matrix > A_
matrix, used in apply if solving residual equation
Base class for smoother prototypes.
void SetParameterList(const Teuchos::ParameterList ¶mList)
Set parameters from a parameter list and return with default values.
RCP< SmootherPrototype > Copy() const
virtual ~Ifpack2Smoother()
LO overlap_
overlap when using the smoother in additive Schwarz mode
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
void SetParameterList(const Teuchos::ParameterList ¶mList)
Set parameters from a parameter list and return with default values.
std::string type_
ifpack2-specific key phrase that denote smoother type
void SetupBlockRelaxation(Level ¤tLevel)
void SetupSchwarz(Level ¤tLevel)
void SetupLineSmoothing(Level ¤tLevel)
std::string description() const
Return a simple one-line description of this object.
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
RCP< SmootherPrototype > Copy() const
Class that holds all level-specific information.
void Setup(Level ¤tLevel)
Set up the smoother.
void DeclareInput(Level ¤tLevel) const
Input.
void SetupTopological(Level ¤tLevel)
#define MUELU_TPETRA_ETI_EXCEPTION(cl, obj, go)
std::string description() const
Return a simple one-line description of this object.
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
void SetPrecParameters(const Teuchos::ParameterList &list=Teuchos::ParameterList()) const
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply smoother.
void SetPrecParameters(const Teuchos::ParameterList &list=Teuchos::ParameterList()) const
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
virtual ~Ifpack2Smoother()
Destructor.
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.
void SetupChebyshev(Level ¤tLevel)
Class that encapsulates Ifpack2 smoothers.
RCP< Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node > > prec_
pointer to Ifpack2 preconditioner object