317 size_t rowSz = rowMgr->GetNumBlocks();
318 size_t colSz = colMgr->GetNumBlocks();
322 if (rowSz == 0 && colSz == 0) {
330 if (mat == Teuchos::null)
return Teuchos::null;
334 if (matwrap != Teuchos::null) {
339 std::vector<Teuchos::RCP<const Map>> rowSubMaps(1, submap);
344 std::vector<Teuchos::RCP<const Map>> colSubMaps(1, submap2);
348 rbmat->setMatrix(0, 0, mat);
351 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
354 TEUCHOS_ASSERT(mat->getLocalNumEntries() == rbmat->getLocalNumEntries());
360 std::vector<Teuchos::RCP<const Map>> rowSubMaps(rowSz, Teuchos::null);
361 for (
size_t i = 0; i < rowSz; i++) {
374 std::vector<Teuchos::RCP<const Map>> rowSubMaps(1, submap);
380 std::vector<Teuchos::RCP<const Map>> colSubMaps(colSz, Teuchos::null);
381 for (
size_t j = 0; j < colSz; j++) {
394 std::vector<Teuchos::RCP<const Map>> colSubMaps(1, submap);
402 if (rowSz == 0 && colSz > 0) {
403 for (
size_t j = 0; j < colSz; j++) {
406 rbmat->setMatrix(0, j, Teuchos::rcp_const_cast<Matrix>(submat));
407 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
409 }
else if (rowSz > 0 && colSz == 0) {
410 for (
size_t i = 0; i < rowSz; i++) {
413 rbmat->setMatrix(i, 0, Teuchos::rcp_const_cast<Matrix>(submat));
414 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
417 for (
size_t i = 0; i < rowSz; i++) {
419 for (
size_t j = 0; j < colSz; j++) {
422 rbmat->setMatrix(i, j, Teuchos::rcp_const_cast<Matrix>(submat));
423 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
429 rbmat->fillComplete();
443 TEUCHOS_ASSERT(bmat->getRangeMapExtractor()->getThyraMode() ==
true);
444 TEUCHOS_ASSERT(bmat->getDomainMapExtractor()->getThyraMode() ==
true);
447 size_t rowSz = rowMgr->GetNumBlocks();
448 size_t colSz = colMgr->GetNumBlocks();
452 if (rowSz == 0 && colSz == 0) {
460 if (mat == Teuchos::null)
return Teuchos::null;
464 if (matwrap != Teuchos::null) {
471 std::vector<Teuchos::RCP<const Map>> rowXpSubMaps(1, xpsubmap);
472 std::vector<Teuchos::RCP<const Map>> rowTySubMaps(1, thysubmap);
480 std::vector<Teuchos::RCP<const Map>> colXpSubMaps(1, xpsubmap2);
481 std::vector<Teuchos::RCP<const Map>> colTySubMaps(1, tysubmap2);
488 rbmat->setMatrix(0, 0, mat);
491 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
494 TEUCHOS_ASSERT(mat->getLocalNumEntries() == rbmat->getLocalNumEntries());
500 std::vector<Teuchos::RCP<const Map>> rowXpSubMaps(rowSz, Teuchos::null);
501 std::vector<Teuchos::RCP<const Map>> rowTySubMaps(rowSz, Teuchos::null);
502 for (
size_t i = 0; i < rowSz; i++) {
518 std::vector<Teuchos::RCP<const Map>> rowXpSubMaps(1, xpsubmap);
519 std::vector<Teuchos::RCP<const Map>> rowTySubMaps(1, thysubmap);
526 std::vector<Teuchos::RCP<const Map>> colXpSubMaps(colSz, Teuchos::null);
527 std::vector<Teuchos::RCP<const Map>> colTySubMaps(colSz, Teuchos::null);
528 for (
size_t j = 0; j < colSz; j++) {
544 std::vector<Teuchos::RCP<const Map>> colXpSubMaps(1, xpsubmap);
545 std::vector<Teuchos::RCP<const Map>> colTySubMaps(1, tysubmap);
555 if (rowSz == 0 && colSz > 0) {
556 for (
size_t j = 0; j < colSz; j++) {
559 rbmat->setMatrix(0, j, Teuchos::rcp_const_cast<Matrix>(submat));
560 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
562 }
else if (rowSz > 0 && colSz == 0) {
563 for (
size_t i = 0; i < rowSz; i++) {
566 rbmat->setMatrix(i, 0, Teuchos::rcp_const_cast<Matrix>(submat));
567 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
570 for (
size_t i = 0; i < rowSz; i++) {
572 for (
size_t j = 0; j < colSz; j++) {
575 rbmat->setMatrix(i, j, Teuchos::rcp_const_cast<Matrix>(submat));
576 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
583 rbmat->fillComplete();
virtual void apply(const MultiVector &X, MultiVector &Y, Teuchos::ETransp mode, Scalar alpha, Scalar beta, bool sumInterfaceValues, const RCP< Xpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > ®ionInterfaceImporter, const Teuchos::ArrayRCP< LocalOrdinal > ®ionInterfaceLIDs) const
sparse matrix-multivector multiplication for the region layout matrices (currently no blocked impleme...
virtual void apply(const MultiVector &X, MultiVector &Y, Teuchos::ETransp mode, Scalar alpha, Scalar beta, bool sumInterfaceValues, const RCP< Xpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > ®ionInterfaceImporter, const Teuchos::ArrayRCP< LocalOrdinal > ®ionInterfaceLIDs) const
sparse matrix-multivector multiplication for the region layout matrices (currently no blocked impleme...