10#ifndef MUELU_GENERICRFACTORY_DEF_HPP
11#define MUELU_GENERICRFACTORY_DEF_HPP
13#include <Xpetra_Matrix.hpp>
18#include "MueLu_PFactory.hpp"
25template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
27 RCP<ParameterList> validParamList = rcp(
new ParameterList());
28 validParamList->set<RCP<const FactoryBase> >(
"P", Teuchos::null,
"Generating factory of the matrix P");
29 return validParamList;
32template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
34 RCP<const FactoryBase> PFact1 = GetFactory(
"P");
35 if (PFact1 == Teuchos::null) {
38 RCP<PFactory> PFact = Teuchos::rcp_const_cast<PFactory>(rcp_dynamic_cast<const PFactory>(PFact1));
41 bool rmode = PFact->isRestrictionModeSet();
42 PFact->setRestrictionMode(
true);
55 PFact->setRestrictionMode(rmode);
58template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
60 FactoryMonitor m(*
this,
"Call prolongator factory for calculating restrictor", coarseLevel);
62 RCP<const FactoryBase> PFact1 = GetFactory(
"P");
63 if (PFact1 == Teuchos::null) {
66 RCP<PFactory> PFact = Teuchos::rcp_const_cast<PFactory>(rcp_dynamic_cast<const PFactory>(PFact1));
71 bool rmode = PFact->isRestrictionModeSet();
72 PFact->setRestrictionMode(
true);
75 RCP<Matrix> R = coarseLevel.
Get<RCP<Matrix> >(
"R", PFact.get());
77 PFact->setRestrictionMode(rmode);
79 Set(coarseLevel,
"R", R);
85#define MUELU_GENERICRFACTORY_SHORT
An exception safe way to call the method TwoLevelFactoryBase::DisableMultipleCallCheck.
Timer to be used in factories. Similar to Monitor but with additional timers.
RCP< const ParameterList > GetValidParameterList() const
Input.
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
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()
const RCP< const FactoryManagerBase > GetFactoryManager()
returns the current factory manager
T & Get(const std::string &ename, const FactoryBase *factory=NoFactory::get())
Get data without decrementing associated storage counter (i.e., read-only access)....
void DeclareDependencies(const FactoryBase *factory, bool bRequestOnly=false, bool bReleaseOnly=false)
Callback from FactoryBase::CallDeclareInput() and FactoryBase::DeclareInput() to declare factory depe...
Namespace for MueLu classes and methods.