46 #ifndef MUELU_SINGLELEVELFACTORY_HPP
47 #define MUELU_SINGLELEVELFACTORY_HPP
54 #include "MueLu_Utilities.hpp"
93 virtual void Build(
Level& currentLevel)
const = 0;
97 #ifdef HAVE_MUELU_DEBUG
100 TEUCHOS_TEST_FOR_EXCEPTION((multipleCallCheck_ == ENABLED) && (multipleCallCheckGlobal_ == ENABLED) && (lastLevelID_ == levelID),
102 this->
ShortClassName() <<
"::Build() called twice for the same level (levelID=" << levelID
103 <<
"). This is likely due to a configuration error, or calling hierarchy setup multiple times "
104 <<
"without resetting debug info through FactoryManager::ResetDebugData().");
105 if (multipleCallCheck_ == FIRSTCALL)
106 multipleCallCheck_ = ENABLED;
108 lastLevelID_ = levelID;
118 comm = prevLevel->GetComm();
127 if (this->timerSync_ && !comm.
is_null()) {
132 Build(requestedLevel);
134 if (this->timerSync_ && !comm.
is_null()) {
158 #define MUELU_SINGLELEVELFACTORY_SHORT
159 #endif // ifndef MUELU_SINGLELEVELFACTORY_HPP
virtual const Teuchos::ParameterList & GetParameterList() const
RCP< Level > & GetPreviousLevel()
Previous level.
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
std::string toString(const T &what)
Little helper function to convert non-string types to strings.
virtual void CallBuild(Level &requestedLevel) const
virtual ~SingleLevelFactoryBase()
Destructor.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Integrates Teuchos::TimeMonitor with MueLu verbosity system.
virtual std::string ShortClassName() const
Return the class name of the object, without template parameters and without namespace.
virtual void DeclareInput(Level ¤tLevel) const =0
Specifies the data that this class needs, and the factories that generate that data.
Class that holds all level-specific information.
virtual void CallDeclareInput(Level &requestedLevel) const
bool IsPrint(MsgType type, int thisProcRankOnly=-1) const
Find out whether we need to print out information for a specific message type.
SingleLevelFactoryBase()
Constructor.
int SetProcRankVerbose(int procRank) const
Set proc rank used for printing.
int GetLevelID() const
Return level number.
Exception throws to report errors in the internal logical of the program.
RCP< const Teuchos::Comm< int > > GetComm() const
Base class for factories that use one level (currentLevel).
virtual void Build(Level ¤tLevel) const =0
Build an object with this factory.