42 #ifndef THYRA_SPMD_LOCAL_DATA_ACCESS_DEF_HPP
43 #define THYRA_SPMD_LOCAL_DATA_ACCESS_DEF_HPP
46 #include "Thyra_SpmdLocalDataAccess_decl.hpp"
47 #include "Thyra_ProductVectorBase.hpp"
48 #include "Thyra_ProductVectorSpaceBase.hpp"
49 #include "Thyra_SpmdVectorBase.hpp"
50 #include "Thyra_SpmdMultiVectorBase.hpp"
53 template<
class Scalar>
61 return spmd_v->getNonconstLocalSubVector();
66 !(p_v->productSpace()->numBlocks() == 1),
68 "Error, the function getNonconstLocalSubVectorView() can only return"
69 " a contiguous view of local SPMD data from a product vector with a single"
70 " block (which also must be able to give up a product view.");
71 return getNonconstLocalSubVectorView<Scalar>(p_v->getNonconstVectorBlock(0));
75 template<
class Scalar>
83 return spmd_v->getLocalSubVector();
88 !(p_v->productSpace()->numBlocks() == 1),
90 "Error, the function getLocalSubVectorView() can only return"
91 " a contiguous view of local SPMD data from a product vector with a single"
92 " block (which also must be able to give up a product view.");
93 return getLocalSubVectorView<Scalar>(p_v->getVectorBlock(0));
97 template<
class Scalar>
105 return spmd_mv->getNonconstLocalSubMultiVector();
110 !(p_mv->productSpace()->numBlocks() == 1),
112 "Error, the function getNonconstLocalSubVectorView() can only return"
113 " a contiguous view of local SPMD data from a product vector with a single"
114 " block (which also must be able to give up a product view.");
115 return getNonconstLocalSubMultiVectorView<Scalar>(p_mv->getNonconstMultiVectorBlock(0));
119 template<
class Scalar>
127 return spmd_mv->getLocalSubMultiVector();
132 !(p_mv->productSpace()->numBlocks() == 1),
134 "Error, the function getLocalSubVectorView() can only return"
135 " a contiguous view of local SPMD data from a product vector with a single"
136 " block (which also must be able to give up a product view.");
137 return getLocalSubMultiVectorView<Scalar>(p_mv->getMultiVectorBlock(0));
146 #define THYRA_SPMD_LOCAL_DATA_ACCESS_INSTANT(SCALAR) \
148 template RTOpPack::SubVectorView<SCALAR> \
149 getNonconstLocalSubVectorView(const RCP<VectorBase<SCALAR> > &vec); \
151 template RTOpPack::ConstSubVectorView<SCALAR> \
152 getLocalSubVectorView(const RCP<const VectorBase<SCALAR> > &vec); \
154 template RTOpPack::SubMultiVectorView<SCALAR> \
155 getNonconstLocalSubMultiVectorView(const RCP<MultiVectorBase<SCALAR> > &vec); \
157 template RTOpPack::ConstSubMultiVectorView<SCALAR> \
158 getLocalSubMultiVectorView(const RCP<const MultiVectorBase<SCALAR> > &vec); \
161 #endif // THYRA_SPMD_LOCAL_DATA_ACCESS_DEF_HPP
Base interface for product multi-vectors.
Base interface for product vectors.
Base interface class for SPMD multi-vectors.
Base class for SPMD vectors that can provide views of contiguous elements in a process.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Interface for a collection of column vectors called a multi-vector.
Abstract interface for finite-dimensional dense vectors.
bool nonnull(const boost::shared_ptr< T > &p)
RTOpPack::ConstSubVectorView< Scalar > getLocalSubVectorView(const RCP< const VectorBase< Scalar > > &vec)
Return a contiguous const semi-persisting view of the local process data of a VectorBase object...
RTOpPack::SubMultiVectorView< Scalar > getNonconstLocalSubMultiVectorView(const RCP< MultiVectorBase< Scalar > > &multivec)
Return a contiguous non-const semi-persisting view of the local process data of a MultiVectorBase obj...
RTOpPack::ConstSubMultiVectorView< Scalar > getLocalSubMultiVectorView(const RCP< const MultiVectorBase< Scalar > > &multivec)
Return a contiguous const semi-persisting view of the local process data of a MultiVectorBase object...
RTOpPack::SubVectorView< Scalar > getNonconstLocalSubVectorView(const RCP< VectorBase< Scalar > > &vec)
Return a contiguous non-const semi-persisting view of the local process data of a VectorBase object...