47 #ifndef MUELU_ZEROSUBBLOCKAFACTORY_DEF_HPP_
48 #define MUELU_ZEROSUBBLOCKAFACTORY_DEF_HPP_
63 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
69 validParamList->
set<
int>(
"block row", 0,
"Block row of subblock in block matrix A");
70 validParamList->
set<
int>(
"block col", 0,
"Block column of subblock in block matrix A");
72 return validParamList;
75 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
77 Input(currentLevel,
"A");
80 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
85 const size_t row = Teuchos::as<size_t>(pL.
get<
int>(
"block row"));
86 const size_t col = Teuchos::as<size_t>(pL.
get<
int>(
"block col"));
108 if (stridedRangeMap.is_null()) {
110 "Range map extractor contains non-strided maps in block row " << row <<
". This should not be.");
111 stridedRangeMap = rcp_dynamic_cast<
const StridedMap>(rangeMapExtractor->getMap(row));
114 if (stridedDomainMap.
is_null()) {
116 "Domain map extractor contains non-strided maps in block row " << row <<
". This should not be.");
117 stridedDomainMap = rcp_dynamic_cast<
const StridedMap>(domainMapExtractor->getMap(col));
123 RCP<Matrix> Op = MatrixFactory::Build(stridedRangeMap, stridedDomainMap, static_cast<size_t>(0));
126 Op->fillComplete(stridedDomainMap, stridedRangeMap);
129 GetOStream(
Statistics1) <<
"A(" << row <<
"," << col <<
") is a single block and has strided maps:"
130 <<
"\n range map fixed block size = " << stridedRangeMap->getFixedBlockSize() <<
", strided block id = " << stridedRangeMap->getStridedBlockId()
131 <<
"\n domain map fixed block size = " << stridedDomainMap->getFixedBlockSize() <<
", strided block id = " << stridedDomainMap->getStridedBlockId() << std::endl;
132 GetOStream(
Statistics2) <<
"A(" << row <<
"," << col <<
") has " << Op->getGlobalNumRows() <<
"x" << Op->getGlobalNumCols() <<
" rows and columns." << std::endl;
134 if (Op->IsView(
"stridedMaps") ==
true)
135 Op->RemoveView(
"stridedMaps");
136 Op->CreateView(
"stridedMaps", stridedRangeMap, stridedDomainMap);
138 currentLevel.
Set(
"A", Op,
this);
Exception indicating invalid cast attempted.
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.
void DeclareInput(Level ¤tLevel) const override
Specifies the data that this class needs, and the factories that generate that data.
void Build(Level ¤tLevel) const override
Build a zero sub-block object with this factory.
T & get(const std::string &name, T def_value)
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)
Print even more statistics.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Class that holds all level-specific information.
RCP< const ParameterList > GetValidParameterList() const override
Input.
void Set(const std::string &ename, const T &entry, const FactoryBase *factory=NoFactory::get())
Exception throws to report errors in the internal logical of the program.
#define TEUCHOS_ASSERT(assertion_test)
static const RCP< const NoFactory > getRCP()
Static Get() functions.