10#ifndef MUELU_PATTERNFACTORY_DEF_HPP
11#define MUELU_PATTERNFACTORY_DEF_HPP
13#include <Xpetra_Matrix.hpp>
14#include <Xpetra_MatrixMatrix.hpp>
24template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
26 RCP<ParameterList> validParamList = rcp(
new ParameterList());
28#define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name))
32 validParamList->set<RCP<const FactoryBase> >(
"A", Teuchos::null,
"Generating factory for the matrix");
33 validParamList->set<RCP<const FactoryBase> >(
"P", Teuchos::null,
"Generating factory for the matrix providing nonzero graph");
35 return validParamList;
38template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
40 Input(coarseLevel,
"P");
43 if (pL.get<
int>(
"emin: pattern order") > 0)
44 Input(fineLevel,
"A");
47template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
54 int k = pL.get<
int>(
"emin: pattern order");
60 bool doFillComplete =
true;
61 bool optimizeStorage =
true;
63 for (
int i = 0; i < k; i++) {
64 AP = Xpetra::MatrixMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Multiply(*A,
false, *P,
false,
GetOStream(
Statistics2), doFillComplete, optimizeStorage);
69 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.