46 #ifndef MUELU_TWOLEVELFACTORY_HPP
47 #define MUELU_TWOLEVELFACTORY_HPP
54 #include "MueLu_Utilities.hpp"
93 std::ostringstream errStr;
94 errStr <<
"LevelID = " << requestedLevel.
GetLevelID();
112 #ifdef HAVE_MUELU_DEBUG
114 TEUCHOS_TEST_FOR_EXCEPTION((multipleCallCheck_ == ENABLED) && (multipleCallCheckGlobal_ == ENABLED) && (lastLevelID_ == levelID),
116 this->
ShortClassName() <<
"::Build() called twice for the same level (levelID=" << levelID
117 <<
"). This is likely due to a configuration error, or calling hierarchy setup multiple times "
118 <<
"without resetting debug info through FactoryManager::ResetDebugData().");
119 if (multipleCallCheck_ == FIRSTCALL)
120 multipleCallCheck_ = ENABLED;
122 lastLevelID_ = levelID;
127 if (comm.is_null()) {
133 comm = prevLevel->GetComm();
142 if (this->timerSync_ && !comm.is_null()) {
149 if (this->timerSync_ && !comm.is_null()) {
169 #define MUELU_TWOLEVELFACTORY_SHORT
170 #endif // ifndef MUELU_TWOLEVELFACTORY_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.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Base class for factories that use two levels (fineLevel and coarseLevel).
virtual void CallBuild(Level &requestedLevel) const
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.
Class that holds all level-specific information.
bool IsPrint(MsgType type, int thisProcRankOnly=-1) const
Find out whether we need to print out information for a specific message type.
virtual ~TwoLevelFactoryBase()
Destructor.
virtual void Build(Level &fineLevel, Level &coarseLevel) const =0
Build an object with this factory.
int SetProcRankVerbose(int procRank) const
Set proc rank used for printing.
TwoLevelFactoryBase()
Constructor.
virtual void CallDeclareInput(Level &requestedLevel) const
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
virtual void DeclareInput(Level &fineLevel, Level &coarseLevel) const =0
Input.
Exception throws to report data dependency problems between factories.