17#ifndef PACKAGES_MUELU_SRC_MUECENTRAL_MUELU_TOPRAPFACTORY_DEF_HPP_
18#define PACKAGES_MUELU_SRC_MUECENTRAL_MUELU_TOPRAPFACTORY_DEF_HPP_
28template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
30 : PFact_(parentFactoryManager->GetFactory(
"P"))
31 , RFact_(parentFactoryManager->GetFactory(
"R"))
32 , AcFact_(parentFactoryManager->GetFactory(
"A")) {}
34template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
36 : PFact_(parentFactoryManagerCoarse->GetFactory(
"P"))
37 , RFact_(parentFactoryManagerCoarse->GetFactory(
"R"))
38 , AcFact_(parentFactoryManagerCoarse->GetFactory(
"A")) {}
40template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
43template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
45 if (PFact_ != Teuchos::null) coarseLevel.
DeclareInput(
"P", PFact_.get());
46 if (RFact_ != Teuchos::null) coarseLevel.
DeclareInput(
"R", RFact_.get());
50template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
53 RCP<Operator> oP = coarseLevel.
Get<RCP<Operator> >(
"P", PFact_.get());
56 if (oP == Teuchos::null)
return;
57 RCP<Matrix> P = rcp_dynamic_cast<Matrix>(oP);
67 RCP<Operator> oR = coarseLevel.
Get<RCP<Operator> >(
"R", RFact_.get());
68 RCP<Matrix> R = rcp_dynamic_cast<Matrix>(oR);
78 RCP<Operator> oA = coarseLevel.
Get<RCP<Operator> >(
"A", AcFact_.get());
79 RCP<Matrix> A = rcp_dynamic_cast<Matrix>(oA);
Class that holds all level-specific information.
void DeclareInput(const std::string &ename, const FactoryBase *factory, const FactoryBase *requestedBy=NoFactory::get())
Callback from FactoryBase::CallDeclareInput() and FactoryBase::DeclareInput()
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)
T & Get(const std::string &ename, const FactoryBase *factory=NoFactory::get())
Get data without decrementing associated storage counter (i.e., read-only access)....
void Set(const std::string &ename, const T &entry, const FactoryBase *factory=NoFactory::get())
static const RCP< const NoFactory > getRCP()
Static Get() functions.
static const NoFactory * get()
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
TopRAPFactory(RCP< const FactoryManagerBase > parentFactoryManager)
Namespace for MueLu classes and methods.
@ Final
Keep data only for this run. Used to keep data useful for Hierarchy::Iterate(). Data will be deleted ...
@ UserData
User data are always kept. This flag is set automatically when Level::Set("data", data) is used....