46 #ifndef XPETRA_REORDEREDBLOCKEDCRSMATRIX_HPP
47 #define XPETRA_REORDEREDBLOCKEDCRSMATRIX_HPP
49 #include <Tpetra_KokkosCompat_DefaultNode.hpp>
56 #include "Xpetra_BlockedMultiVector.hpp"
58 #include "Xpetra_CrsMatrixWrap.hpp"
69 template <
class Scalar,
72 class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
81 #undef XPETRA_REORDEREDBLOCKEDCRSMATRIX_SHORT
97 Teuchos::RCP<const MapExtractor>& domainMaps,
99 Teuchos::RCP<const Xpetra::BlockReorderManager> brm,
101 : Xpetra::
BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rangeMaps, domainMaps, npr) {
114 Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>>
mergeSubBlockMaps(Teuchos::RCP<const Xpetra::BlockReorderManager> brm) {
115 RCP<const MapExtractor> fullRangeMapExtractor =
fullOp_->getRangeMapExtractor();
118 size_t numBlocks = brm->GetNumBlocks();
120 Teuchos::RCP<const Map> map = Teuchos::null;
122 if (numBlocks == 0) {
127 map = fullRangeMapExtractor->getMap(Teuchos::as<size_t>(leaf->GetIndex()),
false);
130 std::vector<Teuchos::RCP<const Map>> subMaps(numBlocks, Teuchos::null);
132 for (
size_t i = 0; i < numBlocks; i++) {
133 Teuchos::RCP<const Xpetra::BlockReorderManager> blkMgr = brm->GetBlock(Teuchos::as<int>(i));
135 TEUCHOS_ASSERT(subMaps[i].is_null() ==
false);
140 TEUCHOS_ASSERT(map.is_null() ==
false);
151 const Teuchos::ArrayRCP<LocalOrdinal>& regionInterfaceLIDs)
const {}
157 Teuchos::ETransp mode = Teuchos::NO_TRANS,
158 Scalar alpha = ScalarTraits<Scalar>::one(),
159 Scalar beta = ScalarTraits<Scalar>::zero())
const {
169 RCP<const MultiVector> refX = rcpFromRef(X);
170 RCP<const BlockedMultiVector> refbX = Teuchos::rcp_dynamic_cast<
const BlockedMultiVector>(refX);
171 RCP<MultiVector> tmpY = rcpFromRef(Y);
174 bool bCopyResultX =
false;
175 bool bCopyResultY =
false;
207 RCP<const BlockedMap> blkRgMap = Teuchos::rcp_dynamic_cast<
const BlockedMap>(
fullOp_->getRangeMap());
208 TEUCHOS_ASSERT(blkRgMap.is_null() ==
false);
209 RCP<const BlockedMultiVector> bXtemp = Teuchos::rcp(
new BlockedMultiVector(blkRgMap, refX));
210 TEUCHOS_ASSERT(bXtemp.is_null() ==
false);
211 RCP<const BlockedMultiVector> bX =
213 TEUCHOS_ASSERT(bX.is_null() ==
false);
220 RCP<const BlockedMap> blkRgMap = Teuchos::rcp_dynamic_cast<
const BlockedMap>(
fullOp_->getRangeMap());
221 TEUCHOS_ASSERT(blkRgMap.is_null() ==
false);
222 RCP<BlockedMultiVector> tmpbYtemp = Teuchos::rcp(
new BlockedMultiVector(blkRgMap, tmpY));
223 TEUCHOS_ASSERT(tmpbYtemp.is_null() ==
false);
224 RCP<BlockedMultiVector> bY =
226 TEUCHOS_ASSERT(bY.is_null() ==
false);
231 TEUCHOS_ASSERT(refbX.is_null() ==
false);
232 TEUCHOS_ASSERT(tmpbY.is_null() ==
false);
236 if (bCopyResultX ==
true) {
237 RCP<const MultiVector> Xmerged = refbX->Merge();
238 RCP<MultiVector> nonconstX = Teuchos::rcp_const_cast<
MultiVector>(refX);
239 nonconstX->
update(Teuchos::ScalarTraits<Scalar>::one(), *Xmerged, Teuchos::ScalarTraits<Scalar>::zero());
241 if (bCopyResultY ==
true) {
242 RCP<MultiVector> Ymerged = tmpbY->Merge();
243 Y.
update(Teuchos::ScalarTraits<Scalar>::one(), *Ymerged, Teuchos::ScalarTraits<Scalar>::zero());
264 std::string
description()
const {
return "ReorderedBlockedCrsMatrix"; }
267 void describe(Teuchos::FancyOStream& out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
271 out <<
"ReorderedBlockMatrix is fillComplete" << std::endl;
273 out <<
"fullRowMap" << std::endl;
280 out <<
"Xpetra::ReorderedBlockedCrsMatrix is NOT fillComplete" << std::endl;
285 out <<
"Block(" << r <<
"," << c <<
")" << std::endl;
293 Teuchos::RCP<const Xpetra::BlockReorderManager>
brm_;
294 Teuchos::RCP<const Xpetra::BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
fullOp_;
297 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
302 RCP<const Xpetra::MapExtractor<Scalar, LocalOrdinal, GlobalOrdinal, Node>> fullRangeMapExtractor = bmat->getRangeMapExtractor();
305 size_t numBlocks = brm->GetNumBlocks();
307 Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> map = Teuchos::null;
309 if (numBlocks == 0) {
313 map = fullRangeMapExtractor->getMap(Teuchos::as<size_t>(leaf->GetIndex()), bThyraMode);
316 std::vector<Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>>> subMaps(numBlocks, Teuchos::null);
318 for (
size_t i = 0; i < numBlocks; i++) {
319 Teuchos::RCP<const Xpetra::BlockReorderManager> blkMgr = brm->GetBlock(Teuchos::as<int>(i));
321 TEUCHOS_ASSERT(subMaps[i].is_null() ==
false);
339 TEUCHOS_ASSERT(map.is_null() ==
false);
343 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
353 size_t rowSz = rowMgr->GetNumBlocks();
354 size_t colSz = colMgr->GetNumBlocks();
356 Teuchos::RCP<BlockedCrsMatrix> rbmat = Teuchos::null;
358 if (rowSz == 0 && colSz == 0) {
360 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
361 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
364 Teuchos::RCP<Matrix> mat = bmat->getMatrix(rowleaf->GetIndex(), colleaf->GetIndex());
366 if (mat == Teuchos::null)
return Teuchos::null;
370 if (matwrap != Teuchos::null) {
373 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
374 Teuchos::RCP<const Map> submap = fullRangeMapExtractor->
getMap(rowleaf->GetIndex(),
false);
375 std::vector<Teuchos::RCP<const Map>> rowSubMaps(1, submap);
376 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::rcp(
new MapExtractor(submap, rowSubMaps,
false));
378 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
379 Teuchos::RCP<const Map> submap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
380 std::vector<Teuchos::RCP<const Map>> colSubMaps(1, submap2);
381 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::rcp(
new MapExtractor(submap2, colSubMaps,
false));
383 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor, doMapExtractor, 33, rowMgr, bmat));
384 rbmat->setMatrix(0, 0, mat);
387 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
388 TEUCHOS_ASSERT(rbmat != Teuchos::null);
390 TEUCHOS_ASSERT(mat->getLocalNumEntries() == rbmat->getLocalNumEntries());
394 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::null;
396 std::vector<Teuchos::RCP<const Map>> rowSubMaps(rowSz, Teuchos::null);
397 for (
size_t i = 0; i < rowSz; i++) {
398 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
400 TEUCHOS_ASSERT(rowSubMaps[i].is_null() ==
false);
403 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rgMergedSubMaps, rowSubMaps,
false));
405 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
406 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
409 Teuchos::RCP<const Map> submap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
false);
410 std::vector<Teuchos::RCP<const Map>> rowSubMaps(1, submap);
411 rgMapExtractor = Teuchos::rcp(
new MapExtractor(submap, rowSubMaps,
false));
414 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::null;
416 std::vector<Teuchos::RCP<const Map>> colSubMaps(colSz, Teuchos::null);
417 for (
size_t j = 0; j < colSz; j++) {
418 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
420 TEUCHOS_ASSERT(colSubMaps[j].is_null() ==
false);
423 doMapExtractor = Teuchos::rcp(
new MapExtractor(doMergedSubMaps, colSubMaps,
false));
425 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
426 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
429 Teuchos::RCP<const Map> submap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
430 std::vector<Teuchos::RCP<const Map>> colSubMaps(1, submap);
431 doMapExtractor = Teuchos::rcp(
new MapExtractor(submap, colSubMaps,
false));
434 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor, doMapExtractor, 33, rowMgr, bmat));
438 if (rowSz == 0 && colSz > 0) {
439 for (
size_t j = 0; j < colSz; j++) {
440 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
441 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowMgr, colSubMgr, bmat);
442 rbmat->setMatrix(0, j, Teuchos::rcp_const_cast<Matrix>(submat));
443 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
445 }
else if (rowSz > 0 && colSz == 0) {
446 for (
size_t i = 0; i < rowSz; i++) {
447 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
448 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowSubMgr, colMgr, bmat);
449 rbmat->setMatrix(i, 0, Teuchos::rcp_const_cast<Matrix>(submat));
450 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
453 for (
size_t i = 0; i < rowSz; i++) {
454 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
455 for (
size_t j = 0; j < colSz; j++) {
456 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
457 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowSubMgr, colSubMgr, bmat);
458 rbmat->setMatrix(i, j, Teuchos::rcp_const_cast<Matrix>(submat));
459 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
463 TEUCHOS_ASSERT(rbmat->getLocalNumEntries() == cntNNZ);
465 rbmat->fillComplete();
471 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
479 TEUCHOS_ASSERT(bmat->getRangeMapExtractor()->getThyraMode() ==
true);
480 TEUCHOS_ASSERT(bmat->getDomainMapExtractor()->getThyraMode() ==
true);
483 size_t rowSz = rowMgr->GetNumBlocks();
484 size_t colSz = colMgr->GetNumBlocks();
486 Teuchos::RCP<BlockedCrsMatrix> rbmat = Teuchos::null;
488 if (rowSz == 0 && colSz == 0) {
490 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
491 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
494 Teuchos::RCP<Matrix> mat = bmat->getMatrix(rowleaf->GetIndex(), colleaf->GetIndex());
496 if (mat == Teuchos::null)
return Teuchos::null;
500 if (matwrap != Teuchos::null) {
503 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
505 Teuchos::RCP<const Map> xpsubmap = fullRangeMapExtractor->
getMap(rowleaf->GetIndex(),
false);
506 Teuchos::RCP<const Map> thysubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
true);
507 std::vector<Teuchos::RCP<const Map>> rowXpSubMaps(1, xpsubmap);
508 std::vector<Teuchos::RCP<const Map>> rowTySubMaps(1, thysubmap);
510 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
512 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
514 Teuchos::RCP<const Map> xpsubmap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
515 Teuchos::RCP<const Map> tysubmap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
true);
516 std::vector<Teuchos::RCP<const Map>> colXpSubMaps(1, xpsubmap2);
517 std::vector<Teuchos::RCP<const Map>> colTySubMaps(1, tysubmap2);
519 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
523 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor, doMapExtractor, 33, rowMgr, bmat));
524 rbmat->setMatrix(0, 0, mat);
527 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
528 TEUCHOS_ASSERT(rbmat != Teuchos::null);
530 TEUCHOS_ASSERT(mat->getLocalNumEntries() == rbmat->getLocalNumEntries());
534 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::null;
536 std::vector<Teuchos::RCP<const Map>> rowXpSubMaps(rowSz, Teuchos::null);
537 std::vector<Teuchos::RCP<const Map>> rowTySubMaps(rowSz, Teuchos::null);
538 for (
size_t i = 0; i < rowSz; i++) {
539 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
543 TEUCHOS_ASSERT(rowXpSubMaps[i].is_null() ==
false);
544 TEUCHOS_ASSERT(rowTySubMaps[i].is_null() ==
false);
547 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
549 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
550 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
552 Teuchos::RCP<const Map> xpsubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
false);
553 Teuchos::RCP<const Map> thysubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
true);
554 std::vector<Teuchos::RCP<const Map>> rowXpSubMaps(1, xpsubmap);
555 std::vector<Teuchos::RCP<const Map>> rowTySubMaps(1, thysubmap);
557 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
560 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::null;
562 std::vector<Teuchos::RCP<const Map>> colXpSubMaps(colSz, Teuchos::null);
563 std::vector<Teuchos::RCP<const Map>> colTySubMaps(colSz, Teuchos::null);
564 for (
size_t j = 0; j < colSz; j++) {
565 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
569 TEUCHOS_ASSERT(colXpSubMaps[j].is_null() ==
false);
570 TEUCHOS_ASSERT(colTySubMaps[j].is_null() ==
false);
573 doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
575 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
576 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
578 Teuchos::RCP<const Map> xpsubmap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
579 Teuchos::RCP<const Map> tysubmap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
true);
580 std::vector<Teuchos::RCP<const Map>> colXpSubMaps(1, xpsubmap);
581 std::vector<Teuchos::RCP<const Map>> colTySubMaps(1, tysubmap);
583 doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
587 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor, doMapExtractor, 33, rowMgr, bmat));
591 if (rowSz == 0 && colSz > 0) {
592 for (
size_t j = 0; j < colSz; j++) {
593 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
595 rbmat->setMatrix(0, j, Teuchos::rcp_const_cast<Matrix>(submat));
596 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
598 }
else if (rowSz > 0 && colSz == 0) {
599 for (
size_t i = 0; i < rowSz; i++) {
600 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
602 rbmat->setMatrix(i, 0, Teuchos::rcp_const_cast<Matrix>(submat));
603 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
606 for (
size_t i = 0; i < rowSz; i++) {
607 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
608 for (
size_t j = 0; j < colSz; j++) {
609 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
611 rbmat->setMatrix(i, j, Teuchos::rcp_const_cast<Matrix>(submat));
612 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
616 TEUCHOS_ASSERT(rbmat->getLocalNumEntries() == cntNNZ);
619 rbmat->fillComplete();
623 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
625 TEUCHOS_ASSERT(bmat->getRangeMapExtractor()->getThyraMode() == bmat->getDomainMapExtractor()->getThyraMode());
626 Teuchos::RCP<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>> rbmat = Teuchos::null;
627 if (bmat->getRangeMapExtractor()->getThyraMode() ==
false) {
639 #define XPETRA_REORDEREDBLOCKEDCRSMATRIX_SHORT
Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > fullOp_
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)
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
Teuchos::RCP< const Xpetra::BlockReorderManager > getBlockReorderManager()
Returns internal BlockReorderManager object.
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...
const RCP< const Map > getRangeMap() const
Returns the Map associated with the range of this operator.
bool isFillComplete() const
Returns true if fillComplete() has been called and the matrix is in compute mode. ...
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)
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::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > buildReorderedBlockedMultiVector(Teuchos::RCP< const Xpetra::BlockReorderManager > brm, Teuchos::RCP< const Xpetra::BlockedMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >> bvec)
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.
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
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::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getBlockedCrsMatrix()
Returns internal unmodified BlockedCrsMatrix object.
Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > mergeSubBlockMaps(Teuchos::RCP< const Xpetra::BlockReorderManager > brm)
Teuchos::RCP< Matrix > getMatrix(size_t r, size_t c) const
return block (r,c)
virtual size_t Cols() const
number of column blocks
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.
Teuchos::RCP< const Xpetra::BlockReorderManager > brm_
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.
virtual ~ReorderedBlockedCrsMatrix()
Destructor.
LocalOrdinal local_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 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.
Concrete implementation of Xpetra::Matrix.
virtual size_t Rows() const
number of row blocks
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...
Xpetra-specific matrix class.