10 #ifndef MUELU_INITIALBLOCKNUMBER_FACTORY_DEF_HPP
11 #define MUELU_INITIALBLOCKNUMBER_FACTORY_DEF_HPP
14 #include "Xpetra_Map.hpp"
26 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
30 #define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name))
32 #undef SET_VALID_ENTRY
35 validParamList->
set<
RCP<const FactoryBase>>(
"BlockNumber", Teuchos::null,
"Generating factory of the BlockNumber vector");
37 return validParamList;
40 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
42 Input(currentLevel,
"A");
45 Input(currentLevel,
"BlockNumber");
48 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
57 BlockNumber = Get<RCP<LocalOrdinalVector>>(currentLevel,
"BlockNumber");
58 GetOStream(
Statistics1) <<
"Use user-given blocknumber with length=" << BlockNumber->getGlobalLength() << std::endl;
61 RCP<Matrix> A = Get<RCP<Matrix>>(currentLevel,
"A");
62 LO blocksize = as<LO>(pL.
get<
int>(
"aggregation: block diagonal: interleaved blocksize"));
64 GetOStream(
Statistics1) <<
"Generating new interleaved blocking with " << blocksize <<
" equations" << std::endl;
65 BlockNumber = LocalOrdinalVectorFactory::Build(A->getRowMap(),
false);
67 for (
LO i = 0; i < (
LO)A->getRowMap()->getLocalNumElements(); i++)
68 bn_data[i] = i % blocksize;
71 Set(currentLevel,
"BlockNumber", BlockNumber);
76 #endif // MUELU_INITIALBLOCKNUMBER_FACTORY_DEF_HPP
void DeclareInput(Level ¤tLevel) const
Specifies the data that this class needs, and the factories that generate that data.
#define SET_VALID_ENTRY(name)
T & get(const std::string &name, T def_value)
void Build(Level ¤tLevel) const
Build an object with this factory.
Timer to be used in factories. Similar to Monitor but with additional timers.
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
static const NoFactory * get()
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Class that holds all level-specific information.
int GetLevelID() const
Return level number.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
bool IsAvailable(const std::string &ename, const FactoryBase *factory=NoFactory::get()) const
Test whether a need's value has been saved.