54 ,
Teuchos::RCP<
const Thyra::VectorBase<value_type> > *thyra_vec
68 _thyra_vec = ::Thyra::createMember(thyra_vec_spc.
thyra_vec_spc());
72 RTOpPack::SubVectorView<value_type> _thyra_vec_sv;
73 _thyra_vec->acquireDetachedView(
convert(
Range1D()), &_thyra_vec_sv );
78 for(
int i = 0; i < vec_sv.subDim(); ++i )
79 _thyra_vec_sv[i] = vec_sv[i];
82 _thyra_vec->commitDetachedView( &_thyra_vec_sv );
84 *thyra_vec = _thyra_vec;
88 true, std::logic_error
89 ,
"AbstractLinAlgPack::get_thyra_vector(...): Error, the vector of concrete type \'"
90 <<
typeName(vec) <<
"\' is not an incore vector."
98 ,
Teuchos::RCP<
const Thyra::VectorBase<value_type> > *thyra_vec
110 ,
Teuchos::RCP<Thyra::VectorBase<value_type> > *thyra_vec
124 _thyra_vec = ::Thyra::createMember(thyra_vec_spc.
thyra_vec_spc());
128 RTOpPack::SubVectorView<value_type> _thyra_vec_sv;
129 _thyra_vec->acquireDetachedView(
convert(
Range1D()), &_thyra_vec_sv );
134 for(
int i = 0; i < vec_sv.subDim(); ++i )
135 _thyra_vec_sv[i] = vec_sv[i];
138 _thyra_vec->commitDetachedView( &_thyra_vec_sv );
140 *thyra_vec = _thyra_vec;
144 true, std::logic_error
145 ,
"AbstractLinAlgPack::get_thyra_vector(...): Error, the vector of concrete type \'"
146 <<
typeName(vec) <<
"\' is not an incore vector."
154 ,
Teuchos::RCP<Thyra::VectorBase<value_type> > *thyra_vec_in
169 RTOpPack::ConstSubVectorView<value_type> thyra_vec_sv;
170 thyra_vec->acquireDetachedView(
convert(
Range1D()), &thyra_vec_sv );
177 for(
int i = 0; i < vec_sv.
subDim(); ++i )
178 vec_sv[i] = thyra_vec_sv[i];
180 thyra_vec->releaseDetachedView( &thyra_vec_sv );
virtual const VectorSpace & space() const =0
Return the vector space that this vector belongs to.
std::string typeName(const T &t)
virtual void get_sub_vector(const Range1D &rng, RTOpPack::SubVector *sub_vec) const
Get a non-mutable explicit view of a sub-vector.
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
VectorSpace adapter subclass for Thyra::VectorSpaceBase<value_type> .
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual void commit_sub_vector(RTOpPack::MutableSubVector *sub_vec)
Free a mutable explicit view of a sub-vector.
virtual bool is_in_core() const
Returns true if the vectors are in core.
void get_thyra_vector(const VectorSpaceThyra &thyra_vec_spc, const Vector &vec, Teuchos::RCP< const Thyra::VectorBase< value_type > > *thyra_vec)
void commit_thyra_vector(const VectorSpaceThyra &thyra_vec_spc, VectorMutable *vec, Teuchos::RCP< Thyra::VectorBase< value_type > > *thyra_vec)
Teuchos_Ordinal subDim() const
const Teuchos::RCP< const Thyra::VectorSpaceBase< value_type > > & thyra_vec_spc() const
Return a (converted) smart pointer to the internal smart pointer to the Thyra::VectorSpaceBase<value_...
VectorMutable adapter subclass for Thyra::VectorBase.
virtual void free_sub_vector(RTOpPack::SubVector *sub_vec) const
Free an explicit view of a sub-vector.
Range1D convert(const Teuchos::Range1D &rng)
Convert from a 0-based Teuchos::Range1D object to a 1-based RangePack::Range1D object.
virtual void get_sub_vector(const Range1D &rng, RTOpPack::MutableSubVector *sub_vec)
Get a mutable explicit view of a sub-vector.
Teuchos::RCP< Thyra::VectorBase< value_type > > set_uninitialized()
Set to uninitialized and return smart pointer to the internal Thyra::VectorBase object.
Abstract interface for mutable coordinate vectors {abstract}.
void free_thyra_vector(const VectorSpaceThyra &thyra_vec_spc, const Vector &vec, Teuchos::RCP< const Thyra::VectorBase< value_type > > *thyra_vec)
Class for a mutable sub-vector.
Teuchos::RCP< const Thyra::VectorBase< value_type > > thyra_vec() const
Return a (converted) smart pointer to the internal smart pointer to the Thyra::VectorBase object...
void initialize(const Teuchos::RCP< Thyra::VectorBase< value_type > > &thyra_vec)
Initalize given a smart pointer to a Thyra::Vetor object.
RangePack::Range1D Range1D
Class for a non-mutable sub-vector.