46#ifndef MUELU_TRANSPFACTORY_DEF_HPP
47#define MUELU_TRANSPFACTORY_DEF_HPP
49#include <Teuchos_ParameterList.hpp>
50#include <Teuchos_Time.hpp>
52#include <Xpetra_Matrix.hpp>
58#include "MueLu_PerfUtils.hpp"
59#include "MueLu_Utilities.hpp"
63 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
65 RCP<ParameterList> validParamList = rcp(
new ParameterList());
66 validParamList->set< RCP<const FactoryBase> >(
"P", Teuchos::null,
"Generating factory of the matrix P");
69 ParameterList norecurse;
70 norecurse.disableRecursiveValidation();
71 validParamList->set<ParameterList> (
"matrixmatrix: kernel params", norecurse,
"MatrixMatrix kernel parameters");
73 return validParamList;
76 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
78 Input(coarseLevel,
"P");
81 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
84 std::string label =
"MueLu::TransP-" + Teuchos::toString(coarseLevel.
GetLevelID());
86 RCP<Matrix> P = Get< RCP<Matrix> >(coarseLevel,
"P");
89 if (P == Teuchos::null)
return;
91 const Teuchos::ParameterList& pL = GetParameterList();
94 RCP<ParameterList> Tparams;
95 if(pL.isSublist(
"matrixmatrix: kernel params"))
96 Tparams=rcp(
new ParameterList(pL.sublist(
"matrixmatrix: kernel params")));
98 Tparams= rcp(
new ParameterList);
101 Tparams->set(
"compute global constants: temporaries",Tparams->get(
"compute global constants: temporaries",
false));
102 Tparams->set(
"compute global constants",Tparams->get(
"compute global constants",
false));
107 RCP<ParameterList> params = rcp(
new ParameterList());
108 params->set(
"printLoadBalancingInfo",
true);
109 params->set(
"printCommInfo",
true);
113 Set(coarseLevel,
"R", R);
116 if (P->IsView(
"stridedMaps"))
117 R->CreateView(
"stridedMaps", P,
true);
Timer to be used in factories. Similar to Monitor but with additional timers.
Class that holds all level-specific information.
int GetLevelID() const
Return level number.
static std::string PrintMatrixInfo(const Matrix &A, const std::string &msgTag, RCP< const Teuchos::ParameterList > params=Teuchos::null)
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
static RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Transpose(Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Op, bool optimizeTranspose=false, const std::string &label=std::string(), const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Namespace for MueLu classes and methods.
@ Statistics2
Print even more statistics.