Advanced Multi-Physics (AMP)
On-Line Documentation
ThyraVector.h
Go to the documentation of this file.
1#ifndef included_AMP_ThyraVector
2#define included_AMP_ThyraVector
3
4// AMP includes
5#include "AMP/vectors/Vector.h"
6
7// Thyra includes
9#include "Thyra_VectorDefaultBase_decl.hpp"
11
12
13namespace AMP::LinearAlgebra {
14
15
29{
30public:
32 virtual ~ThyraVector();
33
42
51
58 static std::shared_ptr<ThyraVector> view( Vector::shared_ptr AmpVector );
59
66 static std::shared_ptr<const ThyraVector> constView( Vector::const_shared_ptr AmpVector );
67
68
70 static AMP::LinearAlgebra::Vector::shared_ptr view( Thyra::VectorBase<double> *vec );
71
74 constView( const Thyra::VectorBase<double> *vec );
75
76public:
77 inline auto getNativeVec() { return getVec(); }
78 inline auto getNativeVec() const { return getVec(); }
79 virtual std::shared_ptr<Vector> getManagedVec() = 0;
80 virtual std::shared_ptr<const Vector> getManagedVec() const = 0;
81
82protected:
91
96 void swapThyraVec( ThyraVector &rhs ) { std::swap( d_thyraVec, rhs.d_thyraVec ); }
97
105};
106} // namespace AMP::LinearAlgebra
107
108
109#endif
ThyraVector is a bridge between AMP::LinearAlgebra::Vector and the Thyra::VectorDefaultBase data stru...
Definition ThyraVector.h:29
virtual std::shared_ptr< Vector > getManagedVec()=0
virtual Teuchos::RCP< const Thyra::VectorBase< double > > getVec() const
Obtain Thyra Vector for use in Thyra routines.
virtual Teuchos::RCP< Thyra::VectorBase< double > > getVec()
Obtain Thyra Vector for use in Thyra routines.
virtual std::shared_ptr< const Vector > getManagedVec() const =0
ThyraVector()
Construct a ThyraVector.
static std::shared_ptr< const ThyraVector > constView(Vector::const_shared_ptr AmpVector)
If needed, create a Thyra wrapper for AmpVector. Otherwise, return AmpVector.
virtual ~ThyraVector()
Destructor.
static std::shared_ptr< ThyraVector > view(Vector::shared_ptr AmpVector)
If needed, create a Thyra wrapper for AmpVector. Otherwise, return AmpVector.
Teuchos::RCP< Thyra::VectorBase< double > > d_thyraVec
Thyra Vector holding data in the vector.
Definition ThyraVector.h:90
static AMP::LinearAlgebra::Vector::shared_ptr view(Thyra::VectorBase< double > *vec)
Return an AMP Vector from the Thyra::VectorBase.
static AMP::LinearAlgebra::Vector::const_shared_ptr constView(const Thyra::VectorBase< double > *vec)
Return an AMP Vector from the Thyra::VectorBase.
void swapThyraVec(ThyraVector &rhs)
Swap the underlying PETSc Vec with another AMP::LinearAlgebra::Vector.
Definition ThyraVector.h:96
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60
std::shared_ptr< const Vector > const_shared_ptr
Definition Vector.h:65
#define DISABLE_WARNINGS
Re-enable warnings.
#define ENABLE_WARNINGS
Suppress all warnings.



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:41.
Comments on this page