83 RCP<MultiVector> nullspace, tentativeNullspace;
91 tentativeNullspace = currentLevel.
Get< RCP<MultiVector> >(
"Nullspace",
NoFactory::get());
94 tentativeNullspace = currentLevel.
Get< RCP<MultiVector> >(
"Nullspace", GetFactory(
"Nullspace").get());
98 tentativeNullspace = currentLevel.
Get< RCP<MultiVector> >(
"Nullspace", GetFactory(
"Nullspace").get());
103 RCP<Matrix> A = Get< RCP<Matrix> >(currentLevel,
"A");
107 if(A->IsView(
"stridedMaps")==
true) {
108 Xpetra::viewLabel_t oldView = A->SwitchToView(
"stridedMaps");
109 TEUCHOS_TEST_FOR_EXCEPTION(Teuchos::rcp_dynamic_cast<const StridedMap>(A->getRowMap()) == Teuchos::null,
Exceptions::BadCast,
"MueLu::ScaledNullspaceFactory::Build: cast to strided row map failed.");
110 numPDEs = Teuchos::rcp_dynamic_cast<const StridedMap>(A->getRowMap())->getFixedBlockSize();
111 oldView = A->SwitchToView(oldView);
114 GetOStream(
Runtime1) <<
"ScaledNullspaceFactory: Generating scaled nullspace, blocksize = "<< tentativeNullspace->getNumVectors() <<std::endl;
115 nullspace = MultiVectorFactory::Build(tentativeNullspace->getMap(), tentativeNullspace->getNumVectors());
116 *nullspace = *tentativeNullspace;
117 RCP<MultiVector> blockDiagonal = MultiVectorFactory::Build(A->getDomainMap(), numPDEs);
119 Xpetra::MatrixUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::extractBlockDiagonal(*A,*blockDiagonal);
120 Xpetra::MatrixUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::inverseScaleBlockDiagonal(*blockDiagonal,
true,*nullspace);
123 Set(currentLevel,
"Scaled Nullspace", nullspace);
T & Get(const std::string &ename, const FactoryBase *factory=NoFactory::get())
Get data without decrementing associated storage counter (i.e., read-only access)....