46 #ifndef MUELU_FACTORY_HPP
47 #define MUELU_FACTORY_HPP
52 #include "Teuchos_ENull.hpp"
53 #include "Teuchos_FilteredIterator.hpp"
58 #include "Teuchos_StringIndexedOrderedValueObjectContainer.hpp"
75 #ifdef HAVE_MUELU_DEBUG
76 : multipleCallCheck_(FIRSTCALL)
98 if (varName ==
"NoFactory")
107 return Teuchos::null;
124 while (it != paramList->end()) {
125 it = paramList->begin();
127 for (; it != paramList->end(); it++)
129 paramList->remove(it->first);
141 return Teuchos::null;
145 void Input(
Level& level,
const std::string& varName)
const {
149 void Input(
Level& level,
const std::string& varName,
const std::string& varParamName)
const {
154 T Get(
Level& level,
const std::string& varName)
const {
159 T Get(
Level& level,
const std::string& varName,
const std::string& varParamName)
const {
160 return level.
Get<T>(varName,
GetFactory(varParamName).get());
164 void Set(
Level& level,
const std::string& varName,
const T& data)
const {
165 return level.
Set<T>(varName, data,
this);
169 bool IsType(
Level& level,
const std::string& varName)
const {
173 bool IsAvailable(
Level& level,
const std::string& varName)
const {
178 static void EnableTimerSync() { timerSync_ =
true; }
179 static void DisableTimerSync() { timerSync_ =
false; }
182 static bool timerSync_;
184 #ifdef HAVE_MUELU_DEBUG
186 enum multipleCallCheckEnum{ENABLED, DISABLED, FIRSTCALL};
191 if (multipleCallCheck_ == FIRSTCALL && lastLevelID_ == -1)
194 multipleCallCheck_ = FIRSTCALL;
211 fact->ResetDebugData();
219 mutable multipleCallCheckEnum multipleCallCheck_;
220 static multipleCallCheckEnum multipleCallCheckGlobal_;
221 mutable int lastLevelID_;
234 #define MUELU_FACTORY_SHORT
235 #endif // ifndef MUELU_FACTORY_HPP
virtual const Teuchos::ParameterList & GetParameterList() const
void DisableMultipleCallCheck() const
ConstIterator end() const
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.
T & get(const std::string &name, T def_value)
static void DisableMultipleCheckGlobally()
Base class for factories (e.g., R, P, and A_coarse).
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Class that holds all level-specific information.
void EnableMultipleCallCheck() const
Constructor.
params_t::ConstIterator ConstIterator
ConstIterator begin() const
static void EnableMultipleCheckGlobally()
void ResetDebugData() const
void Set(const std::string &ename, const T &entry, const FactoryBase *factory=NoFactory::get())
void SetParameter(const std::string &name, const ParameterEntry &entry)
Set a parameter directly as a ParameterEntry.
bool IsType(const std::string &ename, const FactoryBase *factory=NoFactory::get())
virtual void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)=0
Configuration.
bool isType(const std::string &name) const
virtual const RCP< const FactoryBase > GetFactory(const std::string &varName) const =0
void DeclareInput(const std::string &ename, const FactoryBase *factory, const FactoryBase *requestedBy=NoFactory::get())
Callback from FactoryBase::CallDeclareInput() and FactoryBase::DeclareInput()
bool IsAvailable(const std::string &ename, const FactoryBase *factory=NoFactory::get()) const
Test whether a need's value has been saved.
virtual Teuchos::RCP< const Teuchos::ParameterList > GetValidParameterList() const =0
Return a const parameter list of valid parameters that setParameterList() will accept.
static const RCP< const NoFactory > getRCP()
Static Get() functions.