46 #ifndef MUELU_PATTERNFACTORY_DEF_HPP 47 #define MUELU_PATTERNFACTORY_DEF_HPP 49 #include <Xpetra_Matrix.hpp> 50 #include <Xpetra_MatrixMatrix.hpp> 60 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
62 RCP<ParameterList> validParamList = rcp(
new ParameterList());
64 #define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name)) 66 #undef SET_VALID_ENTRY 68 validParamList->set< RCP<const FactoryBase> >(
"A", Teuchos::null,
"Generating factory for the matrix");
69 validParamList->set< RCP<const FactoryBase> >(
"P", Teuchos::null,
"Generating factory for the matrix providing nonzero graph");
71 return validParamList;
74 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 Input(coarseLevel,
"P");
78 const ParameterList& pL = GetParameterList();
79 if (pL.get<
int>(
"emin: pattern order") > 0)
80 Input(fineLevel,
"A");
83 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
87 RCP<Matrix> P = Get< RCP<Matrix> >(coarseLevel,
"P");
89 const ParameterList& pL = GetParameterList();
90 int k = pL.get<
int>(
"emin: pattern order");
93 RCP<Matrix> A = Get< RCP<Matrix> >(fineLevel,
"A");
96 bool doFillComplete =
true;
97 bool optimizeStorage =
true;
99 for (
int i = 0; i < k; i++) {
100 AP = Xpetra::MatrixMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Multiply(*A,
false, *P,
false, GetOStream(
Statistics2), doFillComplete, optimizeStorage);
105 Set(coarseLevel,
"Ppattern", P->getCrsGraph());
111 #endif // MUELU_PATTERNFACTORY_DEF_HPP #define SET_VALID_ENTRY(name)
Timer to be used in factories. Similar to Monitor but with additional timers.
Namespace for MueLu classes and methods.
void Build(Level &fineLevel, Level &coarseLevel) const
Build method.
Print even more statistics.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
Class that holds all level-specific information.
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.