46 #ifndef MUELU_SMOOTHERBASECLONER_HPP 47 #define MUELU_SMOOTHERBASECLONER_HPP 55 #if defined(HAVE_MUELU_IFPACK2) 56 #include "MueLu_Ifpack2Smoother.hpp" 58 #include "MueLu_TrilinosSmoother.hpp" 62 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node1,
class Node2>
63 Teuchos::RCP<SmootherBase<Scalar,LocalOrdinal,GlobalOrdinal,Node2> >
66 const RCP<Node2>& node2)
68 #if defined(HAVE_MUELU_IFPACK2) 69 Teuchos::RCP<SmootherBase<Scalar, LocalOrdinal, GlobalOrdinal, Node2> > cloneSB;
70 Teuchos::RCP<TrilinosSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node1> > trilSmoother =
72 if (trilSmoother != Teuchos::null){
73 cloneSB = trilSmoother->
clone (node2, cloneA);
77 Teuchos::RCP<Ifpack2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node1> > ifSmoother =
79 if (ifSmoother != Teuchos::null){
80 cloneSB = ifSmoother->
clone(node2, cloneA);
85 TEUCHOS_TEST_FOR_EXCEPTION(
86 true, std::invalid_argument,
"MueLu::SmootherClone: " 87 "Invalid smoother type to clone (not TrilinosSmoother or Ifpack2 ) \"");
90 TEUCHOS_TEST_FOR_EXCEPTION(
91 true, std::invalid_argument,
"MueLu::SmootherClone: " 92 "clone() only available with IFPACK2 enabled.");
98 #define MUELU_SMOOTHERBASECLONER_SHORT 99 #endif //ifndef MUELU_SMOOTHERBASECLONER_HPP
RCP< MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > clone(const RCP< Node2 > &node2, const Teuchos::RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > &A_newnode) const
Class that encapsulates external library smoothers.
Namespace for MueLu classes and methods.
Base class for smoothers.
Teuchos::RCP< SmootherBase< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > clone(const Teuchos::RCP< SmootherBase< Scalar, LocalOrdinal, GlobalOrdinal, Node1 > > &SB, const Teuchos::RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > &cloneA, const RCP< Node2 > &node2)
Class that encapsulates Ifpack2 smoothers.
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.