46 #ifndef MUELU_HIERARCHYUTILS_DEF_HPP 47 #define MUELU_HIERARCHYUTILS_DEF_HPP 49 #include <Xpetra_Matrix.hpp> 50 #include <Xpetra_Operator.hpp> 55 #include "MueLu_SmootherFactory.hpp" 56 #include "MueLu_FactoryManager.hpp" 65 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
68 const std::string& levelName = it->first;
71 if (paramList.
isSublist(levelName) && levelName.find(
"level ") == 0 && levelName.size() > 6) {
72 int levelID = strtol(levelName.substr(6).c_str(), 0, 0);
87 const std::string& name = it2->first;
89 name !=
"Nullspace" && name !=
"Coordinates" &&
91 "MueLu::Utils::AddNonSerializableDataToHierarchy: parameter list contains unknown data type");
99 else if( name ==
"P" || name ==
"R") {
103 else if (name ==
"Nullspace")
110 else if(name ==
"Coordinates")
113 level->
Set(name, Teuchos::getValue<
RCP<Xpetra::MultiVector<double, LocalOrdinal, GlobalOrdinal, Node> > >(it2->second),
NoFactory::get());
116 #ifdef HAVE_MUELU_MATLAB 120 size_t typeNameStart = name.find_first_not_of(
' ');
121 size_t typeNameEnd = name.find(
' ', typeNameStart);
122 std::string
typeName = name.substr(typeNameStart, typeNameEnd - typeNameStart);
130 level->
Set(name, Teuchos::getValue<
RCP<Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > >(it2->second),
NoFactory::get());
131 else if(
typeName ==
"ordinalvector")
132 level->
Set(name, Teuchos::getValue<
RCP<Xpetra::Vector<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node> > >(it2->second),
NoFactory::get());
138 level->
Set(name, Teuchos::getValue<std::complex<double> >(it2->second),
NoFactory::get());
152 #define MUELU_HIERARCHY_UTILS_SHORT 153 #endif // MUELU_HIERARCHYHELPERS_DEF_HPP This class specifies the default factory that should generate some data on a Level if the data does n...
RCP< Level > & GetLevel(const int levelID=0)
Retrieve a certain level from hierarchy.
static void AddNonSerializableDataToHierarchy(HierarchyManager &HM, Hierarchy &H, const ParameterList &nonSerialList)
ConstIterator begin() const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
bool isSublist(const std::string &name) const
void AddNewLevel()
Add a new level at the end of the hierarchy.
User data are always kept. This flag is set automatically when Level::Set("data", data) is used...
Namespace for MueLu classes and methods.
bool IsParamMuemexVariable(const std::string &name)
RCP< FactoryManagerBase > GetFactoryManager(int levelID) const
static const NoFactory * get()
ConstIterator end() const
params_t::ConstIterator ConstIterator
void AddKeepFlag(const std::string &ename, const FactoryBase *factory=NoFactory::get(), KeepType keep=MueLu::Keep)
void Set(const std::string &ename, const T &entry, const FactoryBase *factory=NoFactory::get())
void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)
Set Factory.
const RCP< const FactoryBase > GetFactory(const std::string &varName) const
Get factory associated with a particular data name.
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
Provides methods to build a multigrid hierarchy and apply multigrid cycles.
std::string typeName(const T &t)
Exception throws to report invalid user entry.
static const RCP< const NoFactory > getRCP()
Static Get() functions.