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>
58 const RCP<SpmdVectorBase<Scalar> > spmd_v =
60 if (nonnull(spmd_v)) {
63 const RCP<ProductVectorBase<Scalar> > p_v =
65 TEUCHOS_TEST_FOR_EXCEPTION(
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>
80 const RCP<const SpmdVectorBase<Scalar> > spmd_v =
82 if (nonnull(spmd_v)) {
85 const RCP<const ProductVectorBase<Scalar> > p_v =
87 TEUCHOS_TEST_FOR_EXCEPTION(
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>
102 const RCP<SpmdMultiVectorBase<Scalar> > spmd_mv =
104 if (nonnull(spmd_mv)) {
107 const RCP<ProductMultiVectorBase<Scalar> > p_mv =
109 TEUCHOS_TEST_FOR_EXCEPTION(
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>
124 const RCP<const SpmdMultiVectorBase<Scalar> > spmd_mv =
126 if (nonnull(spmd_mv)) {
129 const RCP<const ProductMultiVectorBase<Scalar> > p_mv =
131 TEUCHOS_TEST_FOR_EXCEPTION(
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.
RTOpPack::SubVectorView< Scalar > getNonconstLocalSubVector()
Get a non-const generalized view of local vector data.
Interface for a collection of column vectors called a multi-vector.
RTOpPack::SubMultiVectorView< Scalar > getNonconstLocalSubMultiVector()
Get a non-const generalized view of local multi-vector data.
Abstract interface for finite-dimensional dense vectors.
RTOpPack::ConstSubVectorView< Scalar > getLocalSubVector() const
Get a const generalized view of local vector data.
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::ConstSubMultiVectorView< Scalar > getLocalSubMultiVector() const
Get a const generalized view of local multi-vector data.
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...