41 typedef Xpetra::BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> BlockCrs;
43 RCP<Matrix> originalA = Get<RCP<Matrix> >(currentLevel,
"A");
44 RCP<BlockCrs> A = Teuchos::rcp_dynamic_cast<BlockCrs>(originalA);
47 TEUCHOS_TEST_FOR_EXCEPTION(A == Teuchos::null,
Exceptions::BadCast,
"MueLu::RepartitionBlockDiagonalFactory::Build: input matrix A is not of type BlockedCrsMatrix! error.");
50 RCP<BlockCrs> DiagonalMatrix = Teuchos::rcp(
new BlockCrs(A->getBlockedRangeMap(), A->getBlockedDomainMap(), 0));
51 for (
size_t i = 0; i < A->Rows(); i++)
52 DiagonalMatrix->setMatrix(i, i, A->getMatrix(i, i));
54 Set(currentLevel,
"A", Teuchos::rcp_dynamic_cast<Matrix>(DiagonalMatrix));