46#ifndef MUELU_INITIALBLOCKNUMBER_FACTORY_DEF_HPP
47#define MUELU_INITIALBLOCKNUMBER_FACTORY_DEF_HPP
49#include "Xpetra_VectorFactory.hpp"
50#include "Xpetra_Map.hpp"
51#include "Xpetra_Matrix.hpp"
52#include "Xpetra_IO.hpp"
62 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
64 RCP<ParameterList> validParamList = rcp(
new ParameterList());
65#define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name))
69 validParamList->set< RCP<const FactoryBase> >(
"A", Teuchos::null,
"Generating factory of the matrix A");
71 return validParamList;
74 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 Input(currentLevel,
"A");
79 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
82 const ParameterList & pL = GetParameterList();
84 RCP<Matrix> A = Get< RCP<Matrix> >(currentLevel,
"A");
85 LO blocksize = as<LO>(pL.get<
int>(
"aggregation: block diagonal: interleaved blocksize"));
87 GetOStream(
Statistics1) <<
"Generating interleaved blocking with "<<blocksize<<
" equations"<<std::endl;
88 RCP<LocalOrdinalVector> BlockNumber = LocalOrdinalVectorFactory::Build(A->getRowMap(),
false);
89 Teuchos::ArrayRCP<LO> bn_data = BlockNumber->getDataNonConst(0);
90 for(LO i=0; i<(LO)A->getRowMap()->getLocalNumElements();i++)
91 bn_data[i] = i % blocksize;
93 Set(currentLevel,
"BlockNumber",BlockNumber);
#define SET_VALID_ENTRY(name)
Timer to be used in factories. Similar to Monitor but with additional timers.
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.
Namespace for MueLu classes and methods.
@ Statistics1
Print more statistics.