53 #ifndef MUELU_BLOCKEDCOARSEMAPFACTORY_DEF_HPP_
54 #define MUELU_BLOCKEDCOARSEMAPFACTORY_DEF_HPP_
56 #include <Xpetra_MultiVector.hpp>
57 #include <Xpetra_StridedMapFactory.hpp>
58 #include <Xpetra_Matrix.hpp>
62 #include "MueLu_Aggregates.hpp"
69 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
73 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
82 validParamList->
set<
RCP<const FactoryBase> >(
"CoarseMap", Teuchos::null,
"Generating factory of previous coarse map. (must be set by user!).");
85 validParamList->
set< std::string >(
"Striding info",
"{}",
"Striding information");
86 validParamList->
set<
LocalOrdinal >(
"Strided block id", -1,
"Strided block id");
88 return validParamList;
91 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
93 this->Input(currentLevel,
"Aggregates");
94 this->Input(currentLevel,
"Nullspace");
102 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
104 FactoryMonitor m(*
this,
"BlockedCoarseMap factory", currentLevel);
109 GlobalOrdinal maxGlobalIndex = subPDomainMap->getMaxAllGlobalIndex();
111 RCP<Aggregates> aggregates = Factory::Get< RCP<Aggregates> >(currentLevel,
"Aggregates");
118 RCP<MultiVector> nullspace = Factory::Get< RCP<MultiVector> >(currentLevel,
"Nullspace");
119 const size_t NSDim = nullspace->getNumVectors();
124 if( stridedBlockId== -1 ) {
152 this->Set(currentLevel,
"CoarseMap", coarseMap);
MueLu::DefaultLocalOrdinal LocalOrdinal
T & Get(const std::string &ename, const FactoryBase *factory=NoFactory::get())
Get data without decrementing associated storage counter (i.e., read-only access). Usage: Level->Get< RCP<Matrix> >("A", factory) if factory == NULL => use default factory.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Timer to be used in factories. Similar to Monitor but with additional timers.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void Build(Level ¤tLevel) const
Build an object with this factory.
const RCP< const Map > GetMap() const
returns (overlapping) map of aggregate/node distribution
Print even more statistics.
virtual ~BlockedCoarseMapFactory()
Destructor.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Class that holds all level-specific information.
LO GetNumAggregates() const
returns the number of aggregates of the current processor. Note: could/should be renamed to GetNumLoc...
void DeclareInput(Level ¤tLevel) const
Specifies the data that this class needs, and the factories that generate that data.
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
std::vector< size_t > stridingInfo_
virtual LocalOrdinal getStridedBlockId() const
getStridedBlockId returns strided block id for the domain DOF map of Ptent (= coarse map) or -1 if fu...
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
BlockedCoarseMapFactory()
Constructor.
Exception throws to report errors in the internal logical of the program.
virtual size_t getFixedBlockSize() const
getFixedBlockSize returns the full block size (number of DOFs per node) of the domain DOF map (= coar...
void DeclareInput(const std::string &ename, const FactoryBase *factory, const FactoryBase *requestedBy=NoFactory::get())
Callback from FactoryBase::CallDeclareInput() and FactoryBase::DeclareInput()