46 #ifndef XPETRA_REORDEREDBLOCKEDMULTIVECTOR_HPP
47 #define XPETRA_REORDEREDBLOCKEDMULTIVECTOR_HPP
69 template <
class Scalar,
82 #undef XPETRA_REORDEREDBLOCKEDMULTIVECTOR_SHORT
112 brm_ = Teuchos::null;
132 map = bmap->getMap(Teuchos::as<size_t>(leaf->
GetIndex()),
false);
135 std::vector<Teuchos::RCP<const Map> > subMaps (numBlocks, Teuchos::null);
137 for(
size_t i = 0; i < numBlocks; i++) {
154 std::string
description()
const {
return "ReorderedBlockedMultiVector"; }
172 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
188 map = bmap->getMap(Teuchos::as<size_t>(leaf->
GetIndex()), bThyraMode);
191 std::vector<Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > > subMaps (numBlocks, Teuchos::null);
193 for(
size_t i = 0; i < numBlocks; i++) {
217 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
244 if(subBVec == Teuchos::null) {
260 std::vector<Teuchos::RCP<const Map> > rowSubMaps (1, submap);
263 rbvec =
Teuchos::rcp(
new ReorderedBlockedMultiVector(bbmap, rowMgr, bvec));
264 rbvec->
setMultiVector(0,Teuchos::rcp_const_cast<MultiVector>(vec),
false);
275 std::vector<Teuchos::RCP<const Map> > rowSubMaps (rowSz, Teuchos::null);
276 for(
size_t i = 0; i < rowSz; i++) {
282 rgBlockedMap =
Teuchos::rcp(
new BlockedMap(rgMergedSubMaps, rowSubMaps,
false));
283 rbvec =
Teuchos::rcp(
new ReorderedBlockedMultiVector(rgBlockedMap, rowMgr,bvec));
285 for(
size_t i = 0; i < rowSz; i++) {
288 rbvec->
setMultiVector(i,Teuchos::rcp_const_cast<MultiVector>(subvec),
false);
295 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
321 if(bbvec == Teuchos::null) {
328 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (1, xpsubmap);
329 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (1, thysubmap);
335 rbvec =
Teuchos::rcp(
new ReorderedBlockedMultiVector(rgBlockedMap, rowMgr, bvec));
339 rbvec = Teuchos::rcp_dynamic_cast<BlockedMultiVector>(vec);
345 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (rowSz, Teuchos::null);
346 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (rowSz, Teuchos::null);
347 for(
size_t i = 0; i < rowSz; i++) {
358 rbvec =
Teuchos::rcp(
new ReorderedBlockedMultiVector(rgBlockedMap, rowMgr,bvec));
360 for(
size_t i = 0; i < rowSz; i++) {
363 rbvec->
setMultiVector(i,Teuchos::rcp_const_cast<MultiVector>(subvec),
true);
370 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
374 if(bvec->getBlockedMap()->getThyraMode() ==
false) {
383 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
389 if(bvec->getBlockedMap()->getThyraMode() ==
false) {
390 rbvec =
mergeSubBlocks(brm,Teuchos::rcp_const_cast<const BlockedMultiVector>(bvec));
395 return Teuchos::rcp_const_cast<MultiVector>(rbvec);
401 #define XPETRA_REORDEREDBLOCKEDMULTIVECTOR_SHORT
virtual ~ReorderedBlockedMultiVector()
Destructor.
bool is_null(const boost::shared_ptr< T > &p)
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)
Xpetra utility class for common map-related routines.
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.
int GetIndex() const
Get the index that is stored in this block/leaf.
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 size_t GetNumBlocks() const
Returns number of subblocks.
Teuchos::RCP< const Xpetra::BlockedMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > fullVec_
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::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)
Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > mergeSubBlockMaps(Teuchos::RCP< const Xpetra::BlockReorderManager > brm)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual const Teuchos::RCP< BlockReorderManager > GetBlock(int blockIndex)
Get a particular block. If there is no block at this index location return a new one.
ReorderedBlockedMultiVector(Teuchos::RCP< const BlockedMap > &rangeMap, Teuchos::RCP< const Xpetra::BlockReorderManager > brm, Teuchos::RCP< const Xpetra::BlockedMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bvec)
Constructor.
void setMultiVector(size_t r, Teuchos::RCP< const MultiVector > v, bool bThyraMode)
set partial multivector associated with block row r
GlobalOrdinal global_ordinal_type
LocalOrdinal local_ordinal_type
static const EVerbosityLevel verbLevel_default
virtual RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
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)
#define TEUCHOS_ASSERT(assertion_test)
std::string description() const
Return a simple one-line description of this object.
Teuchos::RCP< const Xpetra::BlockReorderManager > brm_