366 size_t rowSz = rowMgr->GetNumBlocks();
367 size_t colSz = colMgr->GetNumBlocks();
371 if(rowSz == 0 && colSz == 0) {
379 if (mat == Teuchos::null)
return Teuchos::null;
383 if(matwrap != Teuchos::null) {
388 std::vector<Teuchos::RCP<const Map> > rowSubMaps (1, submap);
393 std::vector<Teuchos::RCP<const Map> > colSubMaps (1, submap2);
397 rbmat->setMatrix(0,0,mat);
400 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
403 TEUCHOS_ASSERT(mat->getLocalNumEntries() == rbmat->getLocalNumEntries());
409 std::vector<Teuchos::RCP<const Map> > rowSubMaps (rowSz, Teuchos::null);
410 for(
size_t i = 0; i < rowSz; i++) {
423 std::vector<Teuchos::RCP<const Map> > rowSubMaps (1, submap);
429 std::vector<Teuchos::RCP<const Map> > colSubMaps (colSz, Teuchos::null);
430 for(
size_t j = 0; j < colSz; j++) {
443 std::vector<Teuchos::RCP<const Map> > colSubMaps (1, submap);
451 if (rowSz == 0 && colSz > 0) {
452 for(
size_t j = 0; j < colSz; j++) {
455 rbmat->setMatrix(0,j,Teuchos::rcp_const_cast<Matrix>(submat));
456 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
458 }
else if (rowSz > 0 && colSz == 0) {
459 for(
size_t i = 0; i < rowSz; i++) {
462 rbmat->setMatrix(i,0,Teuchos::rcp_const_cast<Matrix>(submat));
463 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
466 for(
size_t i = 0; i < rowSz; i++) {
468 for(
size_t j = 0; j < colSz; j++) {
471 rbmat->setMatrix(i,j,Teuchos::rcp_const_cast<Matrix>(submat));
472 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
478 rbmat->fillComplete();
493 TEUCHOS_ASSERT(bmat->getRangeMapExtractor()->getThyraMode() ==
true);
494 TEUCHOS_ASSERT(bmat->getDomainMapExtractor()->getThyraMode() ==
true);
497 size_t rowSz = rowMgr->GetNumBlocks();
498 size_t colSz = colMgr->GetNumBlocks();
502 if(rowSz == 0 && colSz == 0) {
510 if(mat == Teuchos::null)
return Teuchos::null;
514 if(matwrap != Teuchos::null) {
521 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (1, xpsubmap);
522 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (1, thysubmap);
530 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (1, xpsubmap2);
531 std::vector<Teuchos::RCP<const Map> > colTySubMaps (1, tysubmap2);
538 rbmat->setMatrix(0,0,mat);
541 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
544 TEUCHOS_ASSERT(mat->getLocalNumEntries() == rbmat->getLocalNumEntries());
550 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (rowSz, Teuchos::null);
551 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (rowSz, Teuchos::null);
552 for(
size_t i = 0; i < rowSz; i++) {
568 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (1, xpsubmap);
569 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (1, thysubmap);
576 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (colSz, Teuchos::null);
577 std::vector<Teuchos::RCP<const Map> > colTySubMaps (colSz, Teuchos::null);
578 for(
size_t j = 0; j < colSz; j++) {
594 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (1, xpsubmap);
595 std::vector<Teuchos::RCP<const Map> > colTySubMaps (1, tysubmap);
605 if (rowSz == 0 && colSz > 0) {
606 for(
size_t j = 0; j < colSz; j++) {
609 rbmat->setMatrix(0,j,Teuchos::rcp_const_cast<Matrix>(submat));
610 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
612 }
else if (rowSz > 0 && colSz == 0) {
613 for(
size_t i = 0; i < rowSz; i++) {
616 rbmat->setMatrix(i,0,Teuchos::rcp_const_cast<Matrix>(submat));
617 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
620 for(
size_t i = 0; i < rowSz; i++) {
622 for(
size_t j = 0; j < colSz; j++) {
625 rbmat->setMatrix(i,j,Teuchos::rcp_const_cast<Matrix>(submat));
626 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
633 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...