10 #ifndef XPETRA_REORDEREDBLOCKEDCRSMATRIX_HPP
11 #define XPETRA_REORDEREDBLOCKEDCRSMATRIX_HPP
13 #include <Tpetra_KokkosCompat_DefaultNode.hpp>
20 #include "Xpetra_BlockedMultiVector.hpp"
22 #include "Xpetra_CrsMatrixWrap.hpp"
23 #include "Xpetra_BlockedCrsMatrix.hpp"
33 template <
class Scalar,
36 class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
45 #undef XPETRA_REORDEREDBLOCKEDCRSMATRIX_SHORT
61 Teuchos::RCP<const MapExtractor>& domainMaps,
63 Teuchos::RCP<const Xpetra::BlockReorderManager> brm,
65 : Xpetra::
BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rangeMaps, domainMaps, npr) {
78 Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>>
mergeSubBlockMaps(Teuchos::RCP<const Xpetra::BlockReorderManager> brm) {
79 RCP<const MapExtractor> fullRangeMapExtractor =
fullOp_->getRangeMapExtractor();
82 size_t numBlocks = brm->GetNumBlocks();
84 Teuchos::RCP<const Map> map = Teuchos::null;
91 map = fullRangeMapExtractor->getMap(Teuchos::as<size_t>(leaf->GetIndex()),
false);
94 std::vector<Teuchos::RCP<const Map>> subMaps(numBlocks, Teuchos::null);
96 for (
size_t i = 0; i < numBlocks; i++) {
97 Teuchos::RCP<const Xpetra::BlockReorderManager> blkMgr = brm->GetBlock(Teuchos::as<int>(i));
99 TEUCHOS_ASSERT(subMaps[i].is_null() ==
false);
104 TEUCHOS_ASSERT(map.is_null() ==
false);
115 const Teuchos::ArrayRCP<LocalOrdinal>& regionInterfaceLIDs)
const {}
121 Teuchos::ETransp mode = Teuchos::NO_TRANS,
122 Scalar alpha = ScalarTraits<Scalar>::one(),
123 Scalar beta = ScalarTraits<Scalar>::zero())
const {
133 RCP<const MultiVector> refX = rcpFromRef(X);
134 RCP<const BlockedMultiVector> refbX = Teuchos::rcp_dynamic_cast<
const BlockedMultiVector>(refX);
135 RCP<MultiVector> tmpY = rcpFromRef(Y);
138 bool bCopyResultX =
false;
139 bool bCopyResultY =
false;
171 RCP<const BlockedMap> blkRgMap = Teuchos::rcp_dynamic_cast<
const BlockedMap>(
fullOp_->getRangeMap());
172 TEUCHOS_ASSERT(blkRgMap.is_null() ==
false);
173 RCP<const BlockedMultiVector> bXtemp = Teuchos::rcp(
new BlockedMultiVector(blkRgMap, refX));
174 TEUCHOS_ASSERT(bXtemp.is_null() ==
false);
175 RCP<const BlockedMultiVector> bX =
177 TEUCHOS_ASSERT(bX.is_null() ==
false);
184 RCP<const BlockedMap> blkRgMap = Teuchos::rcp_dynamic_cast<
const BlockedMap>(
fullOp_->getRangeMap());
185 TEUCHOS_ASSERT(blkRgMap.is_null() ==
false);
186 RCP<BlockedMultiVector> tmpbYtemp = Teuchos::rcp(
new BlockedMultiVector(blkRgMap, tmpY));
187 TEUCHOS_ASSERT(tmpbYtemp.is_null() ==
false);
188 RCP<BlockedMultiVector> bY =
190 TEUCHOS_ASSERT(bY.is_null() ==
false);
195 TEUCHOS_ASSERT(refbX.is_null() ==
false);
196 TEUCHOS_ASSERT(tmpbY.is_null() ==
false);
200 if (bCopyResultX ==
true) {
201 RCP<const MultiVector> Xmerged = refbX->Merge();
202 RCP<MultiVector> nonconstX = Teuchos::rcp_const_cast<
MultiVector>(refX);
203 nonconstX->
update(Teuchos::ScalarTraits<Scalar>::one(), *Xmerged, Teuchos::ScalarTraits<Scalar>::zero());
205 if (bCopyResultY ==
true) {
206 RCP<MultiVector> Ymerged = tmpbY->Merge();
207 Y.
update(Teuchos::ScalarTraits<Scalar>::one(), *Ymerged, Teuchos::ScalarTraits<Scalar>::zero());
228 std::string
description()
const {
return "ReorderedBlockedCrsMatrix"; }
231 void describe(Teuchos::FancyOStream& out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
235 out <<
"ReorderedBlockMatrix is fillComplete" << std::endl;
237 out <<
"fullRowMap" << std::endl;
244 out <<
"Xpetra::ReorderedBlockedCrsMatrix is NOT fillComplete" << std::endl;
249 out <<
"Block(" << r <<
"," << c <<
")" << std::endl;
257 Teuchos::RCP<const Xpetra::BlockReorderManager>
brm_;
258 Teuchos::RCP<const Xpetra::BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
fullOp_;
261 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
266 RCP<const Xpetra::MapExtractor<Scalar, LocalOrdinal, GlobalOrdinal, Node>> fullRangeMapExtractor = bmat->getRangeMapExtractor();
269 size_t numBlocks = brm->GetNumBlocks();
271 Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>> map = Teuchos::null;
273 if (numBlocks == 0) {
277 map = fullRangeMapExtractor->getMap(Teuchos::as<size_t>(leaf->GetIndex()), bThyraMode);
280 std::vector<Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>>> subMaps(numBlocks, Teuchos::null);
282 for (
size_t i = 0; i < numBlocks; i++) {
283 Teuchos::RCP<const Xpetra::BlockReorderManager> blkMgr = brm->GetBlock(Teuchos::as<int>(i));
285 TEUCHOS_ASSERT(subMaps[i].is_null() ==
false);
303 TEUCHOS_ASSERT(map.is_null() ==
false);
307 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
317 size_t rowSz = rowMgr->GetNumBlocks();
318 size_t colSz = colMgr->GetNumBlocks();
320 Teuchos::RCP<BlockedCrsMatrix> rbmat = Teuchos::null;
322 if (rowSz == 0 && colSz == 0) {
324 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
325 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
328 Teuchos::RCP<Matrix> mat = bmat->getMatrix(rowleaf->GetIndex(), colleaf->GetIndex());
330 if (mat == Teuchos::null)
return Teuchos::null;
334 if (matwrap != Teuchos::null) {
337 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
338 Teuchos::RCP<const Map> submap = fullRangeMapExtractor->
getMap(rowleaf->GetIndex(),
false);
339 std::vector<Teuchos::RCP<const Map>> rowSubMaps(1, submap);
340 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::rcp(
new MapExtractor(submap, rowSubMaps,
false));
342 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
343 Teuchos::RCP<const Map> submap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
344 std::vector<Teuchos::RCP<const Map>> colSubMaps(1, submap2);
345 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::rcp(
new MapExtractor(submap2, colSubMaps,
false));
347 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor, doMapExtractor, 33, rowMgr, bmat));
348 rbmat->setMatrix(0, 0, mat);
351 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
352 TEUCHOS_ASSERT(rbmat != Teuchos::null);
354 TEUCHOS_ASSERT(mat->getLocalNumEntries() == rbmat->getLocalNumEntries());
358 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::null;
360 std::vector<Teuchos::RCP<const Map>> rowSubMaps(rowSz, Teuchos::null);
361 for (
size_t i = 0; i < rowSz; i++) {
362 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
364 TEUCHOS_ASSERT(rowSubMaps[i].is_null() ==
false);
367 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rgMergedSubMaps, rowSubMaps,
false));
369 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
370 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
373 Teuchos::RCP<const Map> submap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
false);
374 std::vector<Teuchos::RCP<const Map>> rowSubMaps(1, submap);
375 rgMapExtractor = Teuchos::rcp(
new MapExtractor(submap, rowSubMaps,
false));
378 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::null;
380 std::vector<Teuchos::RCP<const Map>> colSubMaps(colSz, Teuchos::null);
381 for (
size_t j = 0; j < colSz; j++) {
382 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
384 TEUCHOS_ASSERT(colSubMaps[j].is_null() ==
false);
387 doMapExtractor = Teuchos::rcp(
new MapExtractor(doMergedSubMaps, colSubMaps,
false));
389 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
390 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
393 Teuchos::RCP<const Map> submap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
394 std::vector<Teuchos::RCP<const Map>> colSubMaps(1, submap);
395 doMapExtractor = Teuchos::rcp(
new MapExtractor(submap, colSubMaps,
false));
398 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor, doMapExtractor, 33, rowMgr, bmat));
402 if (rowSz == 0 && colSz > 0) {
403 for (
size_t j = 0; j < colSz; j++) {
404 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
405 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowMgr, colSubMgr, bmat);
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++) {
411 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
412 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowSubMgr, colMgr, bmat);
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++) {
418 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
419 for (
size_t j = 0; j < colSz; j++) {
420 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
421 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowSubMgr, colSubMgr, bmat);
422 rbmat->setMatrix(i, j, Teuchos::rcp_const_cast<Matrix>(submat));
423 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
427 TEUCHOS_ASSERT(rbmat->getLocalNumEntries() == cntNNZ);
429 rbmat->fillComplete();
435 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
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();
450 Teuchos::RCP<BlockedCrsMatrix> rbmat = Teuchos::null;
452 if (rowSz == 0 && colSz == 0) {
454 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
455 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
458 Teuchos::RCP<Matrix> mat = bmat->getMatrix(rowleaf->GetIndex(), colleaf->GetIndex());
460 if (mat == Teuchos::null)
return Teuchos::null;
464 if (matwrap != Teuchos::null) {
467 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
469 Teuchos::RCP<const Map> xpsubmap = fullRangeMapExtractor->
getMap(rowleaf->GetIndex(),
false);
470 Teuchos::RCP<const Map> thysubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
true);
471 std::vector<Teuchos::RCP<const Map>> rowXpSubMaps(1, xpsubmap);
472 std::vector<Teuchos::RCP<const Map>> rowTySubMaps(1, thysubmap);
474 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
476 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
478 Teuchos::RCP<const Map> xpsubmap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
479 Teuchos::RCP<const Map> tysubmap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
true);
480 std::vector<Teuchos::RCP<const Map>> colXpSubMaps(1, xpsubmap2);
481 std::vector<Teuchos::RCP<const Map>> colTySubMaps(1, tysubmap2);
483 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
487 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor, doMapExtractor, 33, rowMgr, bmat));
488 rbmat->setMatrix(0, 0, mat);
491 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
492 TEUCHOS_ASSERT(rbmat != Teuchos::null);
494 TEUCHOS_ASSERT(mat->getLocalNumEntries() == rbmat->getLocalNumEntries());
498 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::null;
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++) {
503 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
507 TEUCHOS_ASSERT(rowXpSubMaps[i].is_null() ==
false);
508 TEUCHOS_ASSERT(rowTySubMaps[i].is_null() ==
false);
511 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
513 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
514 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
516 Teuchos::RCP<const Map> xpsubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
false);
517 Teuchos::RCP<const Map> thysubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
true);
518 std::vector<Teuchos::RCP<const Map>> rowXpSubMaps(1, xpsubmap);
519 std::vector<Teuchos::RCP<const Map>> rowTySubMaps(1, thysubmap);
521 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
524 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::null;
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++) {
529 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
533 TEUCHOS_ASSERT(colXpSubMaps[j].is_null() ==
false);
534 TEUCHOS_ASSERT(colTySubMaps[j].is_null() ==
false);
537 doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
539 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
540 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
542 Teuchos::RCP<const Map> xpsubmap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
543 Teuchos::RCP<const Map> tysubmap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
true);
544 std::vector<Teuchos::RCP<const Map>> colXpSubMaps(1, xpsubmap);
545 std::vector<Teuchos::RCP<const Map>> colTySubMaps(1, tysubmap);
547 doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
551 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor, doMapExtractor, 33, rowMgr, bmat));
555 if (rowSz == 0 && colSz > 0) {
556 for (
size_t j = 0; j < colSz; j++) {
557 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(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++) {
564 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(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++) {
571 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
572 for (
size_t j = 0; j < colSz; j++) {
573 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
575 rbmat->setMatrix(i, j, Teuchos::rcp_const_cast<Matrix>(submat));
576 if (submat != Teuchos::null) cntNNZ += submat->getLocalNumEntries();
580 TEUCHOS_ASSERT(rbmat->getLocalNumEntries() == cntNNZ);
583 rbmat->fillComplete();
587 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
589 TEUCHOS_ASSERT(bmat->getRangeMapExtractor()->getThyraMode() == bmat->getDomainMapExtractor()->getThyraMode());
590 Teuchos::RCP<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>> rbmat = Teuchos::null;
591 if (bmat->getRangeMapExtractor()->getThyraMode() ==
false) {
603 #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...
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.
virtual size_t Cols() const
number of column blocks
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< 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)
virtual size_t Rows() const
number of row blocks
const RCP< const Map > getRangeMap() const
Returns the Map associated with the range of this operator.
std::string description() const
Return a simple one-line description of this object.
Teuchos::RCP< Matrix > getMatrix(size_t r, size_t c) const
return block (r,c)
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 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.