46 #ifndef XPETRA_REORDEREDBLOCKEDCRSMATRIX_HPP 47 #define XPETRA_REORDEREDBLOCKEDCRSMATRIX_HPP 56 #include "Xpetra_BlockedMultiVector.hpp" 58 #include "Xpetra_CrsMatrixWrap.hpp" 70 template <
class Scalar,
83 #undef XPETRA_REORDEREDBLOCKEDCRSMATRIX_SHORT 100 (Teuchos::RCP<const MapExtractor>& rangeMaps,
101 Teuchos::RCP<const MapExtractor>& domainMaps,
103 Teuchos::RCP<const Xpetra::BlockReorderManager> brm,
118 Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >
mergeSubBlockMaps(Teuchos::RCP<const Xpetra::BlockReorderManager> brm) {
119 RCP<const MapExtractor> fullRangeMapExtractor =
fullOp_->getRangeMapExtractor();
122 size_t numBlocks = brm->GetNumBlocks();
124 Teuchos::RCP<const Map> map = Teuchos::null;
131 map = fullRangeMapExtractor->getMap(Teuchos::as<size_t>(leaf->GetIndex()),
false);
134 std::vector<Teuchos::RCP<const Map> > subMaps (numBlocks, Teuchos::null);
136 for(
size_t i = 0; i < numBlocks; i++) {
137 Teuchos::RCP<const Xpetra::BlockReorderManager> blkMgr = brm->GetBlock(Teuchos::as<int>(i));
139 TEUCHOS_ASSERT(subMaps[i].is_null()==
false);
144 TEUCHOS_ASSERT(map.is_null()==
false);
155 const Teuchos::ArrayRCP<LocalOrdinal>& regionInterfaceLIDs)
const 162 Teuchos::ETransp mode = Teuchos::NO_TRANS,
163 Scalar alpha = ScalarTraits<Scalar>::one(),
164 Scalar beta = ScalarTraits<Scalar>::zero())
const 176 RCP<const MultiVector> refX = rcpFromRef(X);
177 RCP<const BlockedMultiVector> refbX = Teuchos::rcp_dynamic_cast<
const BlockedMultiVector>(refX);
178 RCP<MultiVector> tmpY = rcpFromRef(Y);
182 bool bCopyResultX =
false;
183 bool bCopyResultY =
false;
216 RCP<const BlockedMap> blkRgMap = Teuchos::rcp_dynamic_cast<
const BlockedMap>(
fullOp_->getRangeMap());
217 TEUCHOS_ASSERT(blkRgMap.is_null()==
false);
218 RCP<const BlockedMultiVector> bXtemp = Teuchos::rcp(
new BlockedMultiVector(blkRgMap, refX));
219 TEUCHOS_ASSERT(bXtemp.is_null()==
false);
220 RCP<const BlockedMultiVector> bX =
222 TEUCHOS_ASSERT(bX.is_null()==
false);
229 RCP<const BlockedMap> blkRgMap = Teuchos::rcp_dynamic_cast<
const BlockedMap>(
fullOp_->getRangeMap());
230 TEUCHOS_ASSERT(blkRgMap.is_null()==
false);
231 RCP<BlockedMultiVector> tmpbYtemp = Teuchos::rcp(
new BlockedMultiVector(blkRgMap, tmpY));
232 TEUCHOS_ASSERT(tmpbYtemp.is_null()==
false);
233 RCP<BlockedMultiVector> bY =
235 TEUCHOS_ASSERT(bY.is_null()==
false);
240 TEUCHOS_ASSERT(refbX.is_null()==
false);
241 TEUCHOS_ASSERT(tmpbY.is_null()==
false);
245 if (bCopyResultX ==
true) {
246 RCP<const MultiVector> Xmerged = refbX->Merge();
247 RCP<MultiVector> nonconstX = Teuchos::rcp_const_cast<
MultiVector>(refX);
248 nonconstX->
update(Teuchos::ScalarTraits<Scalar>::one(), *Xmerged, Teuchos::ScalarTraits<Scalar>::zero());
250 if (bCopyResultY ==
true) {
251 RCP< MultiVector> Ymerged = tmpbY->Merge();
252 Y.
update(Teuchos::ScalarTraits<Scalar>::one(), *Ymerged, Teuchos::ScalarTraits<Scalar>::zero());
273 std::string
description()
const {
return "ReorderedBlockedCrsMatrix"; }
276 void describe(Teuchos::FancyOStream& out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
281 out <<
"ReorderedBlockMatrix is fillComplete" << std::endl;
283 out <<
"fullRowMap" << std::endl;
290 out <<
"Xpetra::ReorderedBlockedCrsMatrix is NOT fillComplete" << std::endl;
295 out <<
"Block(" << r <<
"," << c <<
")" << std::endl;
303 Teuchos::RCP<const Xpetra::BlockReorderManager >
brm_;
304 Teuchos::RCP<const Xpetra::BlockedCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
fullOp_;
309 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
314 RCP<const Xpetra::MapExtractor<Scalar,LocalOrdinal,GlobalOrdinal,Node> > fullRangeMapExtractor = bmat->getRangeMapExtractor();
317 size_t numBlocks = brm->GetNumBlocks();
319 Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node>> map = Teuchos::null;
325 map = fullRangeMapExtractor->getMap(Teuchos::as<size_t>(leaf->GetIndex()), bThyraMode);
328 std::vector<Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > > subMaps (numBlocks, Teuchos::null);
330 for(
size_t i = 0; i < numBlocks; i++) {
331 Teuchos::RCP<const Xpetra::BlockReorderManager> blkMgr = brm->GetBlock(Teuchos::as<int>(i));
333 TEUCHOS_ASSERT(subMaps[i].is_null()==
false);
351 TEUCHOS_ASSERT(map.is_null()==
false);
355 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
366 size_t rowSz = rowMgr->GetNumBlocks();
367 size_t colSz = colMgr->GetNumBlocks();
369 Teuchos::RCP<BlockedCrsMatrix> rbmat = Teuchos::null;
371 if(rowSz == 0 && colSz == 0) {
373 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
374 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
377 Teuchos::RCP<Matrix> mat = bmat->getMatrix(rowleaf->GetIndex(), colleaf->GetIndex());
379 if (mat == Teuchos::null)
return Teuchos::null;
383 if(matwrap != Teuchos::null) {
386 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
387 Teuchos::RCP<const Map> submap = fullRangeMapExtractor->
getMap(rowleaf->GetIndex(),
false);
388 std::vector<Teuchos::RCP<const Map> > rowSubMaps (1, submap);
389 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::rcp(
new MapExtractor(submap, rowSubMaps,
false));
391 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
392 Teuchos::RCP<const Map> submap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
393 std::vector<Teuchos::RCP<const Map> > colSubMaps (1, submap2);
394 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::rcp(
new MapExtractor(submap2, colSubMaps,
false));
397 rbmat->setMatrix(0,0,mat);
401 TEUCHOS_ASSERT(rbmat != Teuchos::null);
403 TEUCHOS_ASSERT(mat->getNodeNumEntries() == rbmat->getNodeNumEntries());
407 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::null;
409 std::vector<Teuchos::RCP<const Map> > rowSubMaps (rowSz, Teuchos::null);
410 for(
size_t i = 0; i < rowSz; i++) {
411 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
413 TEUCHOS_ASSERT(rowSubMaps[i].is_null()==
false);
416 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rgMergedSubMaps, rowSubMaps,
false));
418 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
419 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
422 Teuchos::RCP<const Map> submap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
false);
423 std::vector<Teuchos::RCP<const Map> > rowSubMaps (1, submap);
424 rgMapExtractor = Teuchos::rcp(
new MapExtractor(submap, rowSubMaps,
false));
427 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::null;
429 std::vector<Teuchos::RCP<const Map> > colSubMaps (colSz, Teuchos::null);
430 for(
size_t j = 0; j < colSz; j++) {
431 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
433 TEUCHOS_ASSERT(colSubMaps[j].is_null()==
false);
436 doMapExtractor = Teuchos::rcp(
new MapExtractor(doMergedSubMaps, colSubMaps,
false));
438 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
439 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
442 Teuchos::RCP<const Map> submap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
443 std::vector<Teuchos::RCP<const Map> > colSubMaps (1, submap);
444 doMapExtractor = Teuchos::rcp(
new MapExtractor(submap, colSubMaps,
false));
451 if (rowSz == 0 && colSz > 0) {
452 for(
size_t j = 0; j < colSz; j++) {
453 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
454 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowMgr, colSubMgr, bmat);
455 rbmat->setMatrix(0,j,Teuchos::rcp_const_cast<Matrix>(submat));
456 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
458 }
else if (rowSz > 0 && colSz == 0) {
459 for(
size_t i = 0; i < rowSz; i++) {
460 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
461 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowSubMgr, colMgr, bmat);
462 rbmat->setMatrix(i,0,Teuchos::rcp_const_cast<Matrix>(submat));
463 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
466 for(
size_t i = 0; i < rowSz; i++) {
467 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
468 for(
size_t j = 0; j < colSz; j++) {
469 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
470 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowSubMgr, colSubMgr, bmat);
471 rbmat->setMatrix(i,j,Teuchos::rcp_const_cast<Matrix>(submat));
472 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
476 TEUCHOS_ASSERT(rbmat->getNodeNumEntries() == cntNNZ);
478 rbmat->fillComplete();
484 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
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();
500 Teuchos::RCP<BlockedCrsMatrix> rbmat = Teuchos::null;
502 if(rowSz == 0 && colSz == 0) {
504 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
505 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
508 Teuchos::RCP<Matrix> mat = bmat->getMatrix(rowleaf->GetIndex(), colleaf->GetIndex());
510 if(mat == Teuchos::null)
return Teuchos::null;
514 if(matwrap != Teuchos::null) {
517 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
519 Teuchos::RCP<const Map> xpsubmap = fullRangeMapExtractor->
getMap(rowleaf->GetIndex(),
false);
520 Teuchos::RCP<const Map> thysubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
true);
521 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (1, xpsubmap);
522 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (1, thysubmap);
524 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
526 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
528 Teuchos::RCP<const Map> xpsubmap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
529 Teuchos::RCP<const Map> tysubmap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
true);
530 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (1, xpsubmap2);
531 std::vector<Teuchos::RCP<const Map> > colTySubMaps (1, tysubmap2);
533 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
538 rbmat->setMatrix(0,0,mat);
542 TEUCHOS_ASSERT(rbmat != Teuchos::null);
544 TEUCHOS_ASSERT(mat->getNodeNumEntries() == rbmat->getNodeNumEntries());
548 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::null;
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++) {
553 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
557 TEUCHOS_ASSERT(rowXpSubMaps[i].is_null()==
false);
558 TEUCHOS_ASSERT(rowTySubMaps[i].is_null()==
false);
561 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
563 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
564 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
566 Teuchos::RCP<const Map> xpsubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
false);
567 Teuchos::RCP<const Map> thysubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
true);
568 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (1, xpsubmap);
569 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (1, thysubmap);
571 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
574 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::null;
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++) {
579 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
583 TEUCHOS_ASSERT(colXpSubMaps[j].is_null()==
false);
584 TEUCHOS_ASSERT(colTySubMaps[j].is_null()==
false);
587 doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps,colTySubMaps));
589 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
590 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
592 Teuchos::RCP<const Map> xpsubmap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
593 Teuchos::RCP<const Map> tysubmap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
true);
594 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (1, xpsubmap);
595 std::vector<Teuchos::RCP<const Map> > colTySubMaps (1, tysubmap);
597 doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
605 if (rowSz == 0 && colSz > 0) {
606 for(
size_t j = 0; j < colSz; j++) {
607 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
609 rbmat->setMatrix(0,j,Teuchos::rcp_const_cast<Matrix>(submat));
610 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
612 }
else if (rowSz > 0 && colSz == 0) {
613 for(
size_t i = 0; i < rowSz; i++) {
614 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
616 rbmat->setMatrix(i,0,Teuchos::rcp_const_cast<Matrix>(submat));
617 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
620 for(
size_t i = 0; i < rowSz; i++) {
621 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
622 for(
size_t j = 0; j < colSz; j++) {
623 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
625 rbmat->setMatrix(i,j,Teuchos::rcp_const_cast<Matrix>(submat));
626 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
630 TEUCHOS_ASSERT(rbmat->getNodeNumEntries() == cntNNZ);
633 rbmat->fillComplete();
637 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
639 TEUCHOS_ASSERT(bmat->getRangeMapExtractor()->getThyraMode() == bmat->getDomainMapExtractor()->getThyraMode());
640 Teuchos::RCP<const Xpetra::Matrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > rbmat = Teuchos::null;
641 if(bmat->getRangeMapExtractor()->getThyraMode() ==
false) {
653 #define XPETRA_REORDEREDBLOCKEDCRSMATRIX_SHORT
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > mergeSubBlockMaps(Teuchos::RCP< const Xpetra::BlockReorderManager > brm, Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bmat, bool bThyraMode)
bool isFillComplete() const
Returns true if fillComplete() has been called and the matrix is in compute mode. ...
Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > fullOp_
const Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
Xpetra utility class for common map-related routines.
Teuchos::RCP< const Xpetra::BlockReorderManager > getBlockReorderManager()
Returns internal BlockReorderManager object.
static Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > concatenateMaps(const std::vector< Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > > &subMaps)
Helper function to concatenate several maps.
GlobalOrdinal global_ordinal_type
Teuchos::RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > mergeSubBlocksThyra(Teuchos::RCP< const Xpetra::BlockReorderManager > rowMgr, Teuchos::RCP< const Xpetra::BlockReorderManager > colMgr, Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bmat)
virtual void update(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta)=0
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
Teuchos::RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > mergeSubBlocks(Teuchos::RCP< const Xpetra::BlockReorderManager > rowMgr, Teuchos::RCP< const Xpetra::BlockReorderManager > colMgr, Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bmat)
std::string description() const
Return a simple one-line description of this object.
size_t getNodeNumRows() const
Returns the number of matrix rows owned on the calling node.
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...
Teuchos::RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > buildReorderedBlockedCrsMatrix(Teuchos::RCP< const Xpetra::BlockReorderManager > brm, Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bmat)
virtual ~ReorderedBlockedCrsMatrix()
Destructor.
Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > mergeSubBlockMaps(Teuchos::RCP< const Xpetra::BlockReorderManager > brm)
LocalOrdinal local_ordinal_type
RCP< const Map > getRangeMap() const
Returns the Map associated with the range of this operator.
Concrete implementation of Xpetra::Matrix.
Teuchos::RCP< Matrix > getMatrix(size_t r, size_t c) const
return block (r,c)
virtual void apply(const MultiVector &X, MultiVector &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
Computes the sparse matrix-multivector multiplication.
Teuchos::RCP< const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > buildReorderedBlockedMultiVector(Teuchos::RCP< const Xpetra::BlockReorderManager > brm, Teuchos::RCP< const Xpetra::BlockedMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bvec)
virtual size_t Rows() const
number of row blocks
virtual size_t Cols() const
number of column blocks
ReorderedBlockedCrsMatrix(Teuchos::RCP< const MapExtractor > &rangeMaps, Teuchos::RCP< const MapExtractor > &domainMaps, size_t npr, Teuchos::RCP< const Xpetra::BlockReorderManager > brm, Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bmat)
Constructor.
Xpetra-specific matrix class.
Teuchos::RCP< const Xpetra::BlockReorderManager > brm_