10#ifndef MUELU_INITIALBLOCKNUMBER_FACTORY_DEF_HPP
11#define MUELU_INITIALBLOCKNUMBER_FACTORY_DEF_HPP
13#include "Xpetra_VectorFactory.hpp"
14#include "Xpetra_Map.hpp"
15#include "Xpetra_Matrix.hpp"
16#include "Xpetra_IO.hpp"
26template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
28 RCP<ParameterList> validParamList = rcp(
new ParameterList());
29#define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name))
33 validParamList->set<RCP<const FactoryBase> >(
"A", Teuchos::null,
"Generating factory of the matrix A");
35 return validParamList;
38template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
40 Input(currentLevel,
"A");
43template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
49 LO blocksize = as<LO>(pL.get<
int>(
"aggregation: block diagonal: interleaved blocksize"));
51 GetOStream(
Statistics1) <<
"Generating interleaved blocking with " << blocksize <<
" equations" << std::endl;
52 RCP<LocalOrdinalVector> BlockNumber = LocalOrdinalVectorFactory::Build(A->getRowMap(),
false);
53 Teuchos::ArrayRCP<LO> bn_data = BlockNumber->getDataNonConst(0);
54 for (LO i = 0; i < (LO)A->getRowMap()->getLocalNumElements(); i++)
55 bn_data[i] = i % blocksize;
57 Set(currentLevel,
"BlockNumber", BlockNumber);
#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
void Build(Level ¤tLevel) const
Build an object with this factory.
void DeclareInput(Level ¤tLevel) const
Specifies the data that this class needs, and the factories that generate that data.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
Class that holds all level-specific information.
virtual const Teuchos::ParameterList & GetParameterList() const
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.
@ Statistics1
Print more statistics.