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"
76 #ifdef HAVE_MUELU_DEBUG
77 : multipleCallCheck_(FIRSTCALL), lastLevelID_(-1)
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;
146 void Input(
Level& level,
const std::string& varName)
const {
150 void Input(
Level& level,
const std::string& varName,
const std::string& varParamName)
const {
155 T Get(
Level& level,
const std::string& varName)
const {
160 T Get(
Level& level,
const std::string& varName,
const std::string& varParamName)
const {
161 return level.
Get<T>(varName,
GetFactory(varParamName).get());
165 void Set(
Level& level,
const std::string& varName,
const T& data)
const {
166 return level.
Set<T>(varName, data,
this);
169 bool IsAvailable(
Level& level,
const std::string& varName)
const {
174 static void EnableTimerSync() { timerSync_ =
true; }
175 static void DisableTimerSync() { timerSync_ =
false; }
178 static bool timerSync_;
180 #ifdef HAVE_MUELU_DEBUG
182 enum multipleCallCheckEnum { ENABLED, DISABLED, FIRSTCALL };
187 if (multipleCallCheck_ == FIRSTCALL && lastLevelID_ == -1)
190 multipleCallCheck_ = FIRSTCALL;
207 fact->ResetDebugData();
215 mutable multipleCallCheckEnum multipleCallCheck_;
216 static multipleCallCheckEnum multipleCallCheckGlobal_;
217 mutable int lastLevelID_;
230 #define MUELU_FACTORY_SHORT
231 #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.
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.