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))
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");
79 if (pL.get<
int>(
"emin: pattern order") > 0)
80 Input(fineLevel,
"A");
83 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
90 int k = pL.get<
int>(
"emin: pattern order");
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());
#define SET_VALID_ENTRY(name)
Timer to be used in factories. Similar to Monitor but with additional timers.
void Input(Level &level, const std::string &varName) const
T Get(Level &level, const std::string &varName) const
void Set(Level &level, const std::string &varName, const T &data) const
Class that holds all level-specific information.
virtual const Teuchos::ParameterList & GetParameterList() const
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
void Build(Level &fineLevel, Level &coarseLevel) const
Build method.
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
Namespace for MueLu classes and methods.
@ Statistics2
Print even more statistics.