369 size_t rowSz = rowMgr->GetNumBlocks();
370 size_t colSz = colMgr->GetNumBlocks();
374 if(rowSz == 0 && colSz == 0) {
382 if (mat == Teuchos::null)
return Teuchos::null;
386 if(matwrap != Teuchos::null) {
391 std::vector<Teuchos::RCP<const Map> > rowSubMaps (1, submap);
396 std::vector<Teuchos::RCP<const Map> > colSubMaps (1, submap2);
400 rbmat->setMatrix(0,0,mat);
403 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
406 TEUCHOS_ASSERT(mat->getLocalNumEntries() == rbmat->getLocalNumEntries());
412 std::vector<Teuchos::RCP<const Map> > rowSubMaps (rowSz, Teuchos::null);
413 for(
size_t i = 0; i < rowSz; i++) {
426 std::vector<Teuchos::RCP<const Map> > rowSubMaps (1, submap);
432 std::vector<Teuchos::RCP<const Map> > colSubMaps (colSz, Teuchos::null);
433 for(
size_t j = 0; j < colSz; j++) {
446 std::vector<Teuchos::RCP<const Map> > colSubMaps (1, submap);
454 if (rowSz == 0 && colSz > 0) {
455 for(
size_t j = 0; j < colSz; j++) {
458 rbmat->setMatrix(0,j,Teuchos::rcp_const_cast<Matrix>(submat));
459 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
461 }
else if (rowSz > 0 && colSz == 0) {
462 for(
size_t i = 0; i < rowSz; i++) {
465 rbmat->setMatrix(i,0,Teuchos::rcp_const_cast<Matrix>(submat));
466 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
469 for(
size_t i = 0; i < rowSz; i++) {
471 for(
size_t j = 0; j < colSz; j++) {
474 rbmat->setMatrix(i,j,Teuchos::rcp_const_cast<Matrix>(submat));
475 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
481 rbmat->fillComplete();
496 TEUCHOS_ASSERT(bmat->getRangeMapExtractor()->getThyraMode() ==
true);
497 TEUCHOS_ASSERT(bmat->getDomainMapExtractor()->getThyraMode() ==
true);
500 size_t rowSz = rowMgr->GetNumBlocks();
501 size_t colSz = colMgr->GetNumBlocks();
505 if(rowSz == 0 && colSz == 0) {
513 if(mat == Teuchos::null)
return Teuchos::null;
517 if(matwrap != Teuchos::null) {
524 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (1, xpsubmap);
525 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (1, thysubmap);
533 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (1, xpsubmap2);
534 std::vector<Teuchos::RCP<const Map> > colTySubMaps (1, tysubmap2);
541 rbmat->setMatrix(0,0,mat);
544 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
547 TEUCHOS_ASSERT(mat->getLocalNumEntries() == rbmat->getLocalNumEntries());
553 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (rowSz, Teuchos::null);
554 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (rowSz, Teuchos::null);
555 for(
size_t i = 0; i < rowSz; i++) {
571 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (1, xpsubmap);
572 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (1, thysubmap);
579 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (colSz, Teuchos::null);
580 std::vector<Teuchos::RCP<const Map> > colTySubMaps (colSz, Teuchos::null);
581 for(
size_t j = 0; j < colSz; j++) {
597 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (1, xpsubmap);
598 std::vector<Teuchos::RCP<const Map> > colTySubMaps (1, tysubmap);
608 if (rowSz == 0 && colSz > 0) {
609 for(
size_t j = 0; j < colSz; j++) {
612 rbmat->setMatrix(0,j,Teuchos::rcp_const_cast<Matrix>(submat));
613 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
615 }
else if (rowSz > 0 && colSz == 0) {
616 for(
size_t i = 0; i < rowSz; i++) {
619 rbmat->setMatrix(i,0,Teuchos::rcp_const_cast<Matrix>(submat));
620 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
623 for(
size_t i = 0; i < rowSz; i++) {
625 for(
size_t j = 0; j < colSz; j++) {
628 rbmat->setMatrix(i,j,Teuchos::rcp_const_cast<Matrix>(submat));
629 if(submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
636 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...