46 #ifndef MUELU_HIERARCHYMANAGER_DECL_HPP 47 #define MUELU_HIERARCHYMANAGER_DECL_HPP 52 #include <Teuchos_Array.hpp> 60 #include "MueLu_Hierarchy.hpp" 72 template <
class Scalar =
double,
class LocalOrdinal =
int,
class GlobalOrdinal = LocalOrdinal,
class Node = KokkosClassic::DefaultNode::DefaultNodeType>
74 #undef MUELU_HIERARCHYMANAGER_SHORT 76 typedef std::pair<std::string, const FactoryBase*>
keep_pair;
93 void AddFactoryManager(
int startLevel,
int numDesiredLevel, RCP<FactoryManagerBase> manager) {
94 const int lastLevel = startLevel + numDesiredLevel - 1;
98 for (
int iLevel = startLevel; iLevel <= lastLevel; iLevel++)
129 #ifdef HAVE_MUELU_DEBUG 139 RCP<Operator> Op = l0->Get<RCP<Operator> >(
"A");
176 std::map<int, std::vector<keep_pair> >::const_iterator it =
keep_.find(i);
177 if (it !=
keep_.end()) {
179 const std::vector<keep_pair>& keeps = it->second;
180 for (
size_t j = 0; j < keeps.size(); j++)
181 l->Keep(keeps[j].first, keeps[j].second);
184 RCP<Level> newLevel = rcp(
new Level());
191 bool isLastLevel =
false;
193 while (!isLastLevel) {
194 bool r = H.
Setup(levelID,
195 LvlMngr(levelID-1, lastLevelID),
197 LvlMngr(levelID+1, lastLevelID));
199 isLastLevel = r || (levelID == lastLevelID);
203 RCP<Teuchos::FancyOStream> fos = this->getOStream();
204 fos->setOutputToRootOnly(0);
228 typedef std::map<std::string, RCP<const FactoryBase> >
FactoryMap;
242 Teuchos::RCP<FactoryManagerBase>
LvlMngr(
int levelID,
int lastLevelID)
const {
245 return Teuchos::null;
247 if (levelID == lastLevelID+1)
248 return Teuchos::null;
252 static RCP<FactoryManagerBase> defaultMngr = rcp(
new FactoryManager());
272 std::map<int, std::vector<keep_pair> >
keep_;
278 for (
int i = 0; i < data.size(); ++i) {
284 if (L->IsAvailable(name)) {
285 RCP<T> M = L->template Get< RCP<T> >(name);
300 #define MUELU_HIERARCHYMANAGER_SHORT 301 #endif // MUELU_HIERARCHYMANAGER_HPP virtual void SetupOperator(Operator &Op) const
Setup Matrix object.
This class specifies the default factory that should generate some data on a Level if the data does n...
Teuchos::Array< int > matricesToPrint_
RCP< Level > & GetLevel(const int levelID=0)
Retrieve a certain level from hierarchy.
std::string toString(const T &what)
Little helper function to convert non-string types to strings.
static void SetDefaultVerbLevel(const VerbLevel defaultVerbLevel)
Set the default (global) verbosity level.
void AddLevel(const RCP< Level > &level)
Add a level at the end of the hierarchy.
void SetMaxCoarseSize(Xpetra::global_size_t maxCoarseSize)
void AddFactoryManager(int startLevel, int numDesiredLevel, RCP< FactoryManagerBase > manager)
void WriteData(Hierarchy &H, const Teuchos::Array< int > &data, const std::string &name) const
void Clear(int startLevel=0)
Clear impermanent data from previous setup.
Namespace for MueLu classes and methods.
RCP< FactoryManagerBase > GetFactoryManager(int levelID) const
std::map< std::string, RCP< const FactoryBase > > FactoryMap
Static class that holds the complete list of valid MueLu parameters.
virtual void SetupHierarchy(Hierarchy &H) const
Setup Hierarchy object.
virtual ~HierarchyManager()
Teuchos::RCP< FactoryManagerBase > LvlMngr(int levelID, int lastLevelID) const
Class that holds all level-specific information.
Teuchos::Array< int > nullspaceToPrint_
Array< RCP< FactoryManagerBase > > levelManagers_
void describe(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the Hierarchy with some verbosity level to a FancyOStream object.
void SetPRrebalance(bool doPRrebalance)
void SetImplicitTranspose(const bool &implicit)
virtual RCP< Hierarchy > CreateHierarchy() const
Create an empty Hierarchy object.
Teuchos::Array< int > prolongatorsToPrint_
virtual void SetupExtra(Hierarchy &H) const
Setup extra data.
Teuchos::Array< int > coordinatesToPrint_
std::map< int, std::vector< keep_pair > > keep_
HierarchyManager(int numDesiredLevel=MasterList::getDefault< int >("max levels"))
Exception throws to report errors in the internal logical of the program.
std::pair< std::string, const FactoryBase * > keep_pair
size_t getNumFactoryManagers() const
returns number of factory managers stored in levelManagers_ vector.
void setlib(Xpetra::UnderlyingLib inlib)
Xpetra::global_size_t maxCoarseSize_
bool Setup(int coarseLevelID, const RCP< const FactoryManagerBase > fineLevelManager, const RCP< const FactoryManagerBase > coarseLevelManager, const RCP< const FactoryManagerBase > nextLevelManager=Teuchos::null)
Multi-level setup phase: build a new level of the hierarchy.
Teuchos::Array< int > restrictorsToPrint_
void EnableGraphDumping(const std::string &filename, int levelID=1)
Provides methods to build a multigrid hierarchy and apply multigrid cycles.