Advanced Multi-Physics (AMP)
On-Line Documentation
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
AMP::LinearAlgebra::ThyraVectorWrapper Class Reference

Wrapper for an AMP vector in Thyra. More...

#include <ThyraVectorWrapper.h>

Inherits Thyra::VectorDefaultBase< double >.

Public Member Functions

virtual Teuchos::RCP< Thyra::MultiVectorBase< double > > clone_mv () const override
 
virtual Teuchos::RCP< Thyra::VectorBase< double > > clone_v () const override
 
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< double > > domain () const override
 
std::shared_ptr< const AMP::Discretization::DOFManagergetDOFManager () const
 Get the DOF Manager for the vector (all vectors must share compatible DOFManagers)
 
Vector::shared_ptr getVec (int i)
 Get the underlying AMP vector.
 
Vector::const_shared_ptr getVec (int i) const
 Get the underlying AMP vector.
 
size_t numColumns () const
 Get the number of columns.
 
size_t numRows () const
 Get the number of rows.
 
size_t numVecs () const
 Get the number of duplicate vectors stored.
 
ThyraVectorWrapperoperator= (const ThyraVectorWrapper &)=delete
 Assignment operator.
 
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< double > > range () const override
 
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< double > > space () const override
 
 ThyraVectorWrapper (const std::vector< AMP::LinearAlgebra::Vector::shared_ptr > &vecs)
 
 ThyraVectorWrapper (const ThyraVectorWrapper &)=delete
 Copy constructor.
 
virtual ~ThyraVectorWrapper ()
 Destructor.
 

Protected Member Functions

virtual void acquireDetachedMultiVectorViewImpl (const Teuchos::Range1D &rowRng, const Teuchos::Range1D &colRng, RTOpPack::ConstSubMultiVectorView< double > *sub_mv) const override
 
virtual void acquireDetachedVectorViewImpl (const Teuchos::Range1D &rng, RTOpPack::ConstSubVectorView< double > *sub_vec) const override
 
virtual void acquireNonconstDetachedMultiVectorViewImpl (const Teuchos::Range1D &rowRng, const Teuchos::Range1D &colRng, RTOpPack::SubMultiVectorView< double > *sub_mv) override
 
virtual void acquireNonconstDetachedVectorViewImpl (const Teuchos::Range1D &rng, RTOpPack::SubVectorView< double > *sub_vec) override
 
virtual void applyImpl (const Thyra::EOpTransp M_trans, const Thyra::MultiVectorBase< double > &X, const Teuchos::Ptr< Thyra::MultiVectorBase< double > > &Y, const double alpha, const double beta) const override
 
virtual void applyOpImpl (const RTOpPack::RTOpT< double > &op, const Teuchos::ArrayView< const Teuchos::Ptr< const Thyra::VectorBase< double > > > &vecs, const Teuchos::ArrayView< const Teuchos::Ptr< Thyra::VectorBase< double > > > &targ_vecs, const Teuchos::Ptr< RTOpPack::ReductTarget > &reduct_obj, const Teuchos::Ordinal global_offset) const override
 
void assignImpl (double alpha) override
 
virtual void commitNonconstDetachedMultiVectorViewImpl (RTOpPack::SubMultiVectorView< double > *sub_mv) override
 
virtual void commitNonconstDetachedVectorViewImpl (RTOpPack::SubVectorView< double > *sub_vec) override
 
virtual Teuchos::RCP< const Thyra::MultiVectorBase< double > > contigSubViewImpl (const Teuchos::Range1D &colRng) const override
 
void initialize (const std::vector< AMP::LinearAlgebra::Vector::shared_ptr > &vecs, const std::vector< size_t > &cols, size_t N_cols)
 
virtual void mvMultiReductApplyOpImpl (const RTOpPack::RTOpT< double > &primary_op, const Teuchos::ArrayView< const Teuchos::Ptr< const Thyra::MultiVectorBase< double > > > &multi_vecs, const Teuchos::ArrayView< const Teuchos::Ptr< Thyra::MultiVectorBase< double > > > &targ_multi_vecs, const Teuchos::ArrayView< const Teuchos::Ptr< RTOpPack::ReductTarget > > &reduct_objs, const Teuchos::Ordinal primary_global_offset) const override
 
virtual void mvSingleReductApplyOpImpl (const RTOpPack::RTOpT< double > &primary_op, const RTOpPack::RTOpT< double > &secondary_op, const Teuchos::ArrayView< const Teuchos::Ptr< const Thyra::MultiVectorBase< double > > > &multi_vecs, const Teuchos::ArrayView< const Teuchos::Ptr< Thyra::MultiVectorBase< double > > > &targ_multi_vecs, const Teuchos::Ptr< RTOpPack::ReductTarget > &reduct_obj, const Teuchos::Ordinal primary_global_offset) const override
 
virtual Teuchos::RCP< Thyra::VectorBase< double > > nonconstColImpl (Teuchos::Ordinal j) override
 
virtual Teuchos::RCP< Thyra::MultiVectorBase< double > > nonconstContigSubViewImpl (const Teuchos::Range1D &colRng) override
 
virtual Teuchos::RCP< Thyra::MultiVectorBase< double > > nonconstNonContigSubViewImpl (const Teuchos::ArrayView< const int > &cols) override
 
virtual Teuchos::RCP< const Thyra::MultiVectorBase< double > > nonContigSubViewImpl (const Teuchos::ArrayView< const int > &cols) const override
 
virtual bool opSupportedImpl (Thyra::EOpTransp M_trans) const override
 
virtual void releaseDetachedMultiVectorViewImpl (RTOpPack::ConstSubMultiVectorView< double > *sub_mv) const override
 
virtual void releaseDetachedVectorViewImpl (RTOpPack::ConstSubVectorView< double > *sub_vec) const override
 
virtual void setSubVectorImpl (const RTOpPack::SparseSubVectorT< double > &sub_vec) override
 
 ThyraVectorWrapper (const std::vector< AMP::LinearAlgebra::Vector::shared_ptr > &vecs, const std::vector< size_t > &cols, size_t N_cols)
 

Protected Attributes

std::vector< size_t > d_cols
 
size_t d_N_cols = 0
 
std::vector< AMP::LinearAlgebra::Vector::shared_ptrd_vecs
 

Private Member Functions

std::shared_ptr< const ThyraVectorWrappershared_from_this () const
 
 ThyraVectorWrapper ()=default
 

Private Attributes

Teuchos::Comm< RTOpPack::index_type > * d_comm = nullptr
 

Friends

class ThyraVector
 

Detailed Description

Wrapper for an AMP vector in Thyra.

This allows us to safely wrap an AMP vector in a thyra vector for use within Trilinos.

Definition at line 24 of file ThyraVectorWrapper.h.

Constructor & Destructor Documentation

◆ ThyraVectorWrapper() [1/4]

AMP::LinearAlgebra::ThyraVectorWrapper::ThyraVectorWrapper ( const std::vector< AMP::LinearAlgebra::Vector::shared_ptr > &  vecs)
explicit

◆ ~ThyraVectorWrapper()

virtual AMP::LinearAlgebra::ThyraVectorWrapper::~ThyraVectorWrapper ( )
virtual

Destructor.

◆ ThyraVectorWrapper() [2/4]

AMP::LinearAlgebra::ThyraVectorWrapper::ThyraVectorWrapper ( const ThyraVectorWrapper )
delete

Copy constructor.

◆ ThyraVectorWrapper() [3/4]

AMP::LinearAlgebra::ThyraVectorWrapper::ThyraVectorWrapper ( const std::vector< AMP::LinearAlgebra::Vector::shared_ptr > &  vecs,
const std::vector< size_t > &  cols,
size_t  N_cols 
)
explicitprotected

◆ ThyraVectorWrapper() [4/4]

AMP::LinearAlgebra::ThyraVectorWrapper::ThyraVectorWrapper ( )
privatedefault

Member Function Documentation

◆ acquireDetachedMultiVectorViewImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::acquireDetachedMultiVectorViewImpl ( const Teuchos::Range1D &  rowRng,
const Teuchos::Range1D &  colRng,
RTOpPack::ConstSubMultiVectorView< double > *  sub_mv 
) const
overrideprotectedvirtual

◆ acquireDetachedVectorViewImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::acquireDetachedVectorViewImpl ( const Teuchos::Range1D &  rng,
RTOpPack::ConstSubVectorView< double > *  sub_vec 
) const
overrideprotectedvirtual

◆ acquireNonconstDetachedMultiVectorViewImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::acquireNonconstDetachedMultiVectorViewImpl ( const Teuchos::Range1D &  rowRng,
const Teuchos::Range1D &  colRng,
RTOpPack::SubMultiVectorView< double > *  sub_mv 
)
overrideprotectedvirtual

◆ acquireNonconstDetachedVectorViewImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::acquireNonconstDetachedVectorViewImpl ( const Teuchos::Range1D &  rng,
RTOpPack::SubVectorView< double > *  sub_vec 
)
overrideprotectedvirtual

◆ applyImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::applyImpl ( const Thyra::EOpTransp  M_trans,
const Thyra::MultiVectorBase< double > &  X,
const Teuchos::Ptr< Thyra::MultiVectorBase< double > > &  Y,
const double  alpha,
const double  beta 
) const
overrideprotectedvirtual

◆ applyOpImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::applyOpImpl ( const RTOpPack::RTOpT< double > &  op,
const Teuchos::ArrayView< const Teuchos::Ptr< const Thyra::VectorBase< double > > > &  vecs,
const Teuchos::ArrayView< const Teuchos::Ptr< Thyra::VectorBase< double > > > &  targ_vecs,
const Teuchos::Ptr< RTOpPack::ReductTarget > &  reduct_obj,
const Teuchos::Ordinal  global_offset 
) const
overrideprotectedvirtual

◆ assignImpl()

void AMP::LinearAlgebra::ThyraVectorWrapper::assignImpl ( double  alpha)
overrideprotected

◆ clone_mv()

virtual Teuchos::RCP< Thyra::MultiVectorBase< double > > AMP::LinearAlgebra::ThyraVectorWrapper::clone_mv ( ) const
overridevirtual

◆ clone_v()

virtual Teuchos::RCP< Thyra::VectorBase< double > > AMP::LinearAlgebra::ThyraVectorWrapper::clone_v ( ) const
overridevirtual

◆ commitNonconstDetachedMultiVectorViewImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::commitNonconstDetachedMultiVectorViewImpl ( RTOpPack::SubMultiVectorView< double > *  sub_mv)
overrideprotectedvirtual

◆ commitNonconstDetachedVectorViewImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::commitNonconstDetachedVectorViewImpl ( RTOpPack::SubVectorView< double > *  sub_vec)
overrideprotectedvirtual

◆ contigSubViewImpl()

virtual Teuchos::RCP< const Thyra::MultiVectorBase< double > > AMP::LinearAlgebra::ThyraVectorWrapper::contigSubViewImpl ( const Teuchos::Range1D &  colRng) const
overrideprotectedvirtual

◆ domain()

virtual Teuchos::RCP< const Thyra::VectorSpaceBase< double > > AMP::LinearAlgebra::ThyraVectorWrapper::domain ( ) const
overridevirtual

◆ getDOFManager()

std::shared_ptr< const AMP::Discretization::DOFManager > AMP::LinearAlgebra::ThyraVectorWrapper::getDOFManager ( ) const
inline

Get the DOF Manager for the vector (all vectors must share compatible DOFManagers)

Definition at line 55 of file ThyraVectorWrapper.h.

References d_vecs.

◆ getVec() [1/2]

Vector::shared_ptr AMP::LinearAlgebra::ThyraVectorWrapper::getVec ( int  i)
inline

Get the underlying AMP vector.

Definition at line 40 of file ThyraVectorWrapper.h.

References d_vecs.

◆ getVec() [2/2]

Vector::const_shared_ptr AMP::LinearAlgebra::ThyraVectorWrapper::getVec ( int  i) const
inline

Get the underlying AMP vector.

Definition at line 43 of file ThyraVectorWrapper.h.

References d_vecs.

◆ initialize()

void AMP::LinearAlgebra::ThyraVectorWrapper::initialize ( const std::vector< AMP::LinearAlgebra::Vector::shared_ptr > &  vecs,
const std::vector< size_t > &  cols,
size_t  N_cols 
)
protected

◆ mvMultiReductApplyOpImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::mvMultiReductApplyOpImpl ( const RTOpPack::RTOpT< double > &  primary_op,
const Teuchos::ArrayView< const Teuchos::Ptr< const Thyra::MultiVectorBase< double > > > &  multi_vecs,
const Teuchos::ArrayView< const Teuchos::Ptr< Thyra::MultiVectorBase< double > > > &  targ_multi_vecs,
const Teuchos::ArrayView< const Teuchos::Ptr< RTOpPack::ReductTarget > > &  reduct_objs,
const Teuchos::Ordinal  primary_global_offset 
) const
overrideprotectedvirtual

◆ mvSingleReductApplyOpImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::mvSingleReductApplyOpImpl ( const RTOpPack::RTOpT< double > &  primary_op,
const RTOpPack::RTOpT< double > &  secondary_op,
const Teuchos::ArrayView< const Teuchos::Ptr< const Thyra::MultiVectorBase< double > > > &  multi_vecs,
const Teuchos::ArrayView< const Teuchos::Ptr< Thyra::MultiVectorBase< double > > > &  targ_multi_vecs,
const Teuchos::Ptr< RTOpPack::ReductTarget > &  reduct_obj,
const Teuchos::Ordinal  primary_global_offset 
) const
overrideprotectedvirtual

◆ nonconstColImpl()

virtual Teuchos::RCP< Thyra::VectorBase< double > > AMP::LinearAlgebra::ThyraVectorWrapper::nonconstColImpl ( Teuchos::Ordinal  j)
overrideprotectedvirtual

◆ nonconstContigSubViewImpl()

virtual Teuchos::RCP< Thyra::MultiVectorBase< double > > AMP::LinearAlgebra::ThyraVectorWrapper::nonconstContigSubViewImpl ( const Teuchos::Range1D &  colRng)
overrideprotectedvirtual

◆ nonconstNonContigSubViewImpl()

virtual Teuchos::RCP< Thyra::MultiVectorBase< double > > AMP::LinearAlgebra::ThyraVectorWrapper::nonconstNonContigSubViewImpl ( const Teuchos::ArrayView< const int > &  cols)
overrideprotectedvirtual

◆ nonContigSubViewImpl()

virtual Teuchos::RCP< const Thyra::MultiVectorBase< double > > AMP::LinearAlgebra::ThyraVectorWrapper::nonContigSubViewImpl ( const Teuchos::ArrayView< const int > &  cols) const
overrideprotectedvirtual

◆ numColumns()

size_t AMP::LinearAlgebra::ThyraVectorWrapper::numColumns ( ) const

Get the number of columns.

◆ numRows()

size_t AMP::LinearAlgebra::ThyraVectorWrapper::numRows ( ) const

Get the number of rows.

◆ numVecs()

size_t AMP::LinearAlgebra::ThyraVectorWrapper::numVecs ( ) const
inline

Get the number of duplicate vectors stored.

Definition at line 46 of file ThyraVectorWrapper.h.

References d_vecs.

◆ operator=()

ThyraVectorWrapper & AMP::LinearAlgebra::ThyraVectorWrapper::operator= ( const ThyraVectorWrapper )
delete

Assignment operator.

◆ opSupportedImpl()

virtual bool AMP::LinearAlgebra::ThyraVectorWrapper::opSupportedImpl ( Thyra::EOpTransp  M_trans) const
overrideprotectedvirtual

◆ range()

virtual Teuchos::RCP< const Thyra::VectorSpaceBase< double > > AMP::LinearAlgebra::ThyraVectorWrapper::range ( ) const
overridevirtual

◆ releaseDetachedMultiVectorViewImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::releaseDetachedMultiVectorViewImpl ( RTOpPack::ConstSubMultiVectorView< double > *  sub_mv) const
overrideprotectedvirtual

◆ releaseDetachedVectorViewImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::releaseDetachedVectorViewImpl ( RTOpPack::ConstSubVectorView< double > *  sub_vec) const
overrideprotectedvirtual

◆ setSubVectorImpl()

virtual void AMP::LinearAlgebra::ThyraVectorWrapper::setSubVectorImpl ( const RTOpPack::SparseSubVectorT< double > &  sub_vec)
overrideprotectedvirtual

◆ shared_from_this()

std::shared_ptr< const ThyraVectorWrapper > AMP::LinearAlgebra::ThyraVectorWrapper::shared_from_this ( ) const
private

◆ space()

virtual Teuchos::RCP< const Thyra::VectorSpaceBase< double > > AMP::LinearAlgebra::ThyraVectorWrapper::space ( ) const
overridevirtual

Friends And Related Symbol Documentation

◆ ThyraVector

friend class ThyraVector
friend

Definition at line 164 of file ThyraVectorWrapper.h.

Member Data Documentation

◆ d_cols

std::vector<size_t> AMP::LinearAlgebra::ThyraVectorWrapper::d_cols
protected

Definition at line 151 of file ThyraVectorWrapper.h.

◆ d_comm

Teuchos::Comm<RTOpPack::index_type>* AMP::LinearAlgebra::ThyraVectorWrapper::d_comm = nullptr
private

Definition at line 159 of file ThyraVectorWrapper.h.

◆ d_N_cols

size_t AMP::LinearAlgebra::ThyraVectorWrapper::d_N_cols = 0
protected

Definition at line 152 of file ThyraVectorWrapper.h.

◆ d_vecs

std::vector<AMP::LinearAlgebra::Vector::shared_ptr> AMP::LinearAlgebra::ThyraVectorWrapper::d_vecs
protected

Definition at line 150 of file ThyraVectorWrapper.h.

Referenced by getDOFManager(), getVec(), getVec(), and numVecs().


The documentation for this class was generated from the following file:



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:43.
Comments on this page