8 #ifndef PACKAGES_MUELU_SRC_MUECENTRAL_MUELU_TOPSMOOTHERFACTORY_DEF_HPP_
9 #define PACKAGES_MUELU_SRC_MUECENTRAL_MUELU_TOPSMOOTHERFACTORY_DEF_HPP_
16 #include "MueLu_TopSmootherFactory.hpp"
20 #include "MueLu_SmootherFactory.hpp"
21 #include "MueLu_SmootherPrototype.hpp"
26 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
30 if (varName ==
"CoarseSolver") {
36 if (coarseSmootherFactory != Teuchos::null) {
41 if (preProto == postProto)
42 preSmootherFact_ = parentFactoryManager->
GetFactory(
"CoarseSolver");
45 if(preProto != Teuchos::null)
46 preSmootherFact_ = parentFactoryManager->
GetFactory(
"CoarseSolver");
47 if(postProto != Teuchos::null)
48 postSmootherFact_ = parentFactoryManager->
GetFactory(
"CoarseSolver");
52 preSmootherFact_ = parentFactoryManager->
GetFactory(
"CoarseSolver");
55 preSmootherFact_ = parentFactoryManager->
GetFactory(
"PreSmoother");
56 postSmootherFact_ = parentFactoryManager->
GetFactory(
"PostSmoother");
60 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
63 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
65 if (preSmootherFact_ != Teuchos::null)
66 level.
DeclareInput(
"PreSmoother", preSmootherFact_.get());
67 if (postSmootherFact_ != Teuchos::null)
68 level.
DeclareInput(
"PostSmoother", postSmootherFact_.get());
71 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
73 if (preSmootherFact_.is_null() && postSmootherFact_.is_null())
84 if (!preSmootherFact_.is_null()) {
107 if (!postSmootherFact_.is_null()) {
Generic Smoother Factory for generating the smoothers of the MG hierarchy.
void Build(Level &level) const
Build an object with this factory.
T & Get(const std::string &ename, const FactoryBase *factory=NoFactory::get())
Get data without decrementing associated storage counter (i.e., read-only access). Usage: Level->Get< RCP<Matrix> >("A", factory) if factory == NULL => use default factory.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
User data are always kept. This flag is set automatically when Level::Set("data", data) is used...
static const NoFactory * get()
virtual ~TopSmootherFactory()
virtual const RCP< const FactoryBase > GetFactory(const std::string &varName) const =0
Get.
Class that holds all level-specific information.
Keep data only for this run. Used to keep data useful for Hierarchy::Iterate(). Data will be deleted ...
void RemoveKeepFlag(const std::string &ename, const FactoryBase *factory, KeepType keep=MueLu::All)
void AddKeepFlag(const std::string &ename, const FactoryBase *factory=NoFactory::get(), KeepType keep=MueLu::Keep)
void Set(const std::string &ename, const T &entry, const FactoryBase *factory=NoFactory::get())
void GetSmootherPrototypes(RCP< SmootherPrototype > &preSmootherPrototype, RCP< SmootherPrototype > &postSmootherPrototype) const
Get smoother prototypes.
Exception throws to report errors in the internal logical of the program.
void DeclareInput(const std::string &ename, const FactoryBase *factory, const FactoryBase *requestedBy=NoFactory::get())
Callback from FactoryBase::CallDeclareInput() and FactoryBase::DeclareInput()
void DeclareInput(Level &level) const
Specifies the data that this class needs, and the factories that generate that data.
TopSmootherFactory(RCP< const FactoryManagerBase > parentFactoryManager, const std::string &varName)