46 #ifndef MUELU_GENERICRFACTORY_DEF_HPP 47 #define MUELU_GENERICRFACTORY_DEF_HPP 49 #include <Xpetra_Matrix.hpp> 54 #include "MueLu_PFactory.hpp" 61 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
63 RCP<ParameterList> validParamList = rcp(
new ParameterList());
64 validParamList->set< RCP<const FactoryBase> >(
"P", Teuchos::null,
"Generating factory of the matrix P");
65 return validParamList;
68 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
70 RCP<const FactoryBase> PFact1 = GetFactory(
"P");
71 if (PFact1 == Teuchos::null) { PFact1 = coarseLevel.
GetFactoryManager()->GetFactory(
"P"); }
72 RCP<PFactory> PFact = Teuchos::rcp_const_cast<
PFactory>(rcp_dynamic_cast<
const PFactory>(PFact1));;
74 bool rmode = PFact->isRestrictionModeSet();
75 PFact->setRestrictionMode(
true);
88 PFact->setRestrictionMode(rmode);
91 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
93 FactoryMonitor m(*
this,
"Call prolongator factory for calculating restrictor", coarseLevel);
95 RCP<const FactoryBase> PFact1 = GetFactory(
"P");
96 if (PFact1 == Teuchos::null) { PFact1 = coarseLevel.
GetFactoryManager()->GetFactory(
"P"); }
97 RCP<PFactory> PFact = Teuchos::rcp_const_cast<
PFactory>(rcp_dynamic_cast<
const PFactory>(PFact1));;
101 bool rmode = PFact->isRestrictionModeSet();
102 PFact->setRestrictionMode(
true);
105 RCP<Matrix> R = coarseLevel.
Get<RCP<Matrix> >(
"R",PFact.get());
107 PFact->setRestrictionMode(rmode);
109 Set(coarseLevel,
"R", R);
115 #define MUELU_GENERICRFACTORY_SHORT 116 #endif // MUELU_GENERICRFACTORY_DEF_HPP RCP< const ParameterList > GetValidParameterList() const
Input.
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.
void DeclareDependencies(const FactoryBase *factory, bool bRequestOnly=false, bool bReleaseOnly=false)
Callback from FactoryBase::CallDeclareInput() and FactoryBase::DeclareInput() to declare factory depe...
Timer to be used in factories. Similar to Monitor but with additional timers.
Namespace for MueLu classes and methods.
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
Class that holds all level-specific information.
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
An exception safe way to call the method TwoLevelFactoryBase::DisableMultipleCallCheck.
const RCP< const FactoryManagerBase > GetFactoryManager()
returns the current factory manager
Factory that provides an interface for a concrete implementation of a prolongation operator...
void DeclareInput(const std::string &ename, const FactoryBase *factory, const FactoryBase *requestedBy=NoFactory::get())
Callback from FactoryBase::CallDeclareInput() and FactoryBase::DeclareInput()