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

Vector capable of returning an Epetra_Vector from a ManagedVector. More...

#include <ManagedThyraVector.h>

Inheritance diagram for AMP::LinearAlgebra::ManagedThyraVector:
Inheritance graph
[legend]

Public Types

typedef std::shared_ptr< const Vectorconst_shared_ptr
 
typedef std::shared_ptr< Vectorshared_ptr
 Shorthand for shared pointer to Vector.
 

Public Member Functions

void abs (const Vector &x)
 Set this to the component-wise absolute value of a vector. \(\mathit{this}_i = |x_i|\).
 
void add (const Vector &x, const Vector &y)
 Adds two vectors. For Vectors, \(\mathit{this}_i = x_i + y_i\).
 
template<typename TYPE >
void addGhostValuesByGlobalID (int num, const size_t *indices, const TYPE *vals)
 
void addScalar (const Vector &x, const Scalar &alpha)
 set vector to \(x + \alpha \bar{1}\).
 
template<typename TYPE >
void addValuesByGlobalID (int num, const size_t *indices, const TYPE *vals)
 
template<class TYPE >
void addValuesByLocalID (int num, size_t *indices, const TYPE *vals)
 
void axpby (const Scalar &alpha, const Scalar &beta, const Vector &x)
 Set this vector alpha * x + this. \(\mathit{this}_i = \alpha x_i + \beta \mathit{this}_i \).
 
void axpy (const Scalar &alpha, const Vector &x, const Vector &y)
 Set this vector to alpha * x + y. \(\mathit{this}_i = \alpha x_i + y_i\).
 
template<class TYPE = double>
VectorDataIterator< TYPEbegin ()
 Return an iterator to the beginning of the data.
 
template<class TYPE = double>
VectorDataIterator< const TYPEbegin () const
 Return an iterator to the beginning of the data.
 
std::shared_ptr< Vectorclone () const
 Allocate space in the same fashion as this
 
std::shared_ptr< Vectorclone (const std::shared_ptr< Variable > name) const
 Allocate space in the same fashion as this
 
std::shared_ptr< Vectorclone (const std::string &name) const
 Allocate space in the same fashion as this
 
std::shared_ptr< VectorDatacloneData () const
 
template<class TYPE = double>
VectorDataIterator< const TYPEconstBegin () const
 Return an iterator to the beginning of the data.
 
template<class TYPE = double>
VectorDataIterator< const TYPEconstEnd () const
 Return an iterator to the end of the data.
 
bool containsGlobalElement (size_t id)
 
void copy (const Vector &x)
 Set vector equal to x For Vectors, \(\mathit{this}_i = x_i\).
 
void copyCast (std::shared_ptr< const Vector > x)
 Copy up/down-casting this
 
virtual void copyVector (std::shared_ptr< const Vector > x)
 
void copyVector (Vector::const_shared_ptr vec) override
 
void dataChanged ()
 
void divide (const Vector &x, const Vector &y)
 Component-wise divide one vector by another. For Vectors, \(\mathit{this}_i = x_i / y_i\).
 
Scalar dot (const Vector &x) const
 Return the dot product of this vector with the argument vector.
 
void dumpGhostedData (std::ostream &out, size_t offset=0) const
 
void dumpOwnedData (std::ostream &out, size_t GIDoffset=0, size_t LIDoffset=0) const
 
template<class TYPE = double>
VectorDataIterator< TYPEend ()
 Return an iterator to the end of the data.
 
template<class TYPE = double>
VectorDataIterator< const TYPEend () const
 Return an iterator to the end of the data.
 
bool equals (const Vector &x, const Scalar &tol=1e-6) const
 Check if two vectors are equal.
 
const AMP_MPIgetComm () const
 
std::shared_ptr< CommunicationListgetCommunicationList () const
 Get the CommunicationList for this Vector.
 
uint64_t getDataID () const
 
std::shared_ptr< AMP::Discretization::DOFManagergetDOFManager () const
 Get the DOFManager for this Vector.
 
size_t getGhostSize () const
 
template<typename TYPE = double>
TYPE getGhostValueByGlobalID (size_t i) const
 Return a ghost value from the vector.
 
template<typename TYPE >
void getGhostValuesByGlobalID (int num, const size_t *indices, TYPE *vals) const
 
size_t getGlobalSize () const
 
uint64_t getID () const
 Get a unique id hash for the vector.
 
size_t getLocalSize () const
 
size_t getLocalStartID () const
 
template<typename TYPE = double>
TYPE getLocalValueByGlobalID (size_t i) const
 Return a local value from the vector.
 
std::shared_ptr< const VectorgetManagedVec () const override
 
std::shared_ptr< VectorgetManagedVec () override
 
AMP::Utilities::MemoryType getMemoryLocation () const
 returns the memory location for data
 
std::string getName () const
 Return the vector name.
 
auto getNativeVec ()
 
auto getNativeVec () const
 
size_t getNumberOfComponents () const
 Return integer number of patch data components in vector.
 
template<class TYPE >
void getRawData (TYPE *buf) const
 
template<typename RETURN_TYPE >
RETURN_TYPEgetRawDataBlock (size_t i=0)
 Obtain a particular contiguous block of data cast to RETURN_TYPE.
 
template<typename RETURN_TYPE >
const RETURN_TYPEgetRawDataBlock (size_t i=0) const
 Obtain a particular contiguous block of data cast to RETURN_TYPE.
 
voidgetRawDataBlockAsVoid (size_t i)
 
const voidgetRawDataBlockAsVoid (size_t i) const
 
autogetUnits () const
 Get the units for this Vector.
 
AMP::LinearAlgebra::UpdateState getUpdateStatus () const
 
template<typename TYPE = double>
TYPE getValueByGlobalID (size_t i) const
 Return a value from the vector.
 
template<typename TYPE = double>
TYPE getValueByLocalID (size_t i) const
 Return a local value from the vector.
 
template<typename TYPE >
void getValuesByGlobalID (int num, const size_t *indices, TYPE *vals) const
 
template<typename TYPE >
void getValuesByLocalID (int num, const size_t *indices, TYPE *vals) const
 
std::shared_ptr< VariablegetVariable ()
 Get the variable associated with this vector.
 
const std::shared_ptr< VariablegetVariable () const
 Get the variable associated with this vector.
 
virtual Teuchos::RCP< Thyra::VectorBase< double > > getVec ()
 Obtain Thyra Vector for use in Thyra routines.
 
virtual Teuchos::RCP< const Thyra::VectorBase< double > > getVec () const
 Obtain Thyra Vector for use in Thyra routines.
 
std::shared_ptr< VectorDatagetVectorData ()
 Return the pointer to the VectorData.
 
std::shared_ptr< const VectorDatagetVectorData () const
 Return the pointer to the VectorData.
 
std::shared_ptr< VectorOperationsgetVectorOperations ()
 Return the pointer to the VectorOperation.
 
std::shared_ptr< const VectorOperationsgetVectorOperations () const
 Return the pointer to the VectorOperation.
 
template<typename VIEW_TYPE >
std::shared_ptr< VIEW_TYPEgetView () const
 If a particular type of view of this Vector has been created, return it.
 
bool hasComm () const
 
template<typename VIEW_TYPE >
bool hasView () const
 If a particular type of view of this Vector has been created, return true.
 
template<typename TYPE >
bool isType (size_t block) const
 
Scalar L1Norm () const
 Return discrete \( L_1 \) -norm of this vector.
 
Scalar L2Norm () const
 Return discrete \( L_2 \) -norm of this vector.
 
std::pair< Scalar, ScalarL2NormAndDot (const Vector &x) const
 Return the L2 norm of this vector and the dot product with the argument vector.
 
void linearSum (const Scalar &alpha, const Vector &x, const Scalar &beta, const Vector &y)
 Set a vector to be a linear combination of two vectors. \(\mathit{this}_i = \alpha x_i + \beta y_i\).
 
void makeConsistent ()
 
void makeConsistent (AMP::LinearAlgebra::ScatterType t)
 
 ManagedThyraVector (Vector::shared_ptr alias)
 Create a view of a vector.
 
Scalar max () const
 Return the maximum value of the vector. \(\max_i \mathit{this}_i\).
 
Scalar maxNorm () const
 Return the \( L_\infty \) -norm of this vector.
 
Scalar mean () const
 Return the maximum value of the vector. \(\max_i \mathit{this}_i\).
 
Scalar min () const
 Return the minimum value of the vector. \(\min_i \mathit{this}_i\).
 
Scalar minQuotient (const Vector &x) const
 Returns the minimum of the quotient of two vectors:
 
void multiply (const Vector &x, const Vector &y)
 Component-wise multiply one vector with another. For Vectors, \(\mathit{this}_i = x_i y_i\).
 
size_t numberOfDataBlocks () const
 
template<class TYPE >
void putRawData (const TYPE *buf)
 
std::unique_ptr< VectorrawClone () const override
 Allocate space in the same fashion as this
 
void reciprocal (const Vector &x)
 Set this to the component-wise reciprocal of a vector. \(\mathit{this}_i = 1/x_i\).
 
virtual void registerChildObjects (AMP::IO::RestartManager *manager) const
 Register any child objects.
 
template<typename VIEW_TYPE >
void registerView (std::shared_ptr< VIEW_TYPE > v) const
 Add a view of this vector to an internal queue.
 
virtual void rename (const std::string &src, const std::string &dst)
 Renames.
 
virtual void reset ()
 Reset.
 
void scale (const Scalar &alpha)
 Scale a vector. For Vectors, \(\mathit{this}_i = \alpha\mathit{this}_i\).
 
void scale (const Scalar &alpha, const Vector &x)
 Set vector equal to scaled input. For Vectors, \(\mathit{this}_i = \alpha x_i\).
 
shared_ptr select (const VectorSelector &criterion)
 Selects a portion of this vector and creates a view.
 
const_shared_ptr select (const VectorSelector &criterion) const
 Selects a portion of this vector and creates a view.
 
virtual Vector::shared_ptr selectInto (const VectorSelector &criterion)
 Selects a portion of this vector and puts a view into a vector.
 
virtual Vector::const_shared_ptr selectInto (const VectorSelector &criterion) const
 
void setCommunicationList (std::shared_ptr< CommunicationList > comm)
 
template<typename TYPE >
void setGhostValuesByGlobalID (int num, const size_t *indices, const TYPE *vals)
 
void setMax (const Scalar &val)
 modify vector to have max value 'val' specified
 
void setMin (const Scalar &val)
 modify vector to have min value 'val' specified
 
void setName (const std::string &name)
 Set the vector name.
 
void setNoGhosts ()
 Ensure this vector has no ghosts.
 
void setRandomValues ()
 Set data in this vector to random values on [0,1).
 
void setToScalar (const Scalar &alpha)
 Set all compenents of a vector to a scalar. For Vectors, the components of this are set to \(\alpha\).
 
virtual void setUnits (AMP::Units)
 Get the units for this Vector.
 
void setUpdateStatus (AMP::LinearAlgebra::UpdateState state)
 
template<typename TYPE >
void setValueByGlobalID (size_t i, TYPE v)
 Set a value in the vector.
 
template<typename TYPE >
void setValuesByGlobalID (int num, const size_t *indices, const TYPE *vals)
 
template<class TYPE >
void setValuesByLocalID (int num, size_t *indices, const TYPE *vals)
 
void setVariable (const std::shared_ptr< Variable > name)
 Change the variable associated with this vector.
 
std::shared_ptr< Vectorshared_from_this ()
 
std::shared_ptr< const Vectorshared_from_this () const
 
size_t sizeOfDataBlock (size_t i=0) const
 
size_t sizeofDataBlockType (size_t i) const
 
Vector::shared_ptr subsetVectorForComponent (size_t index)
 Retrieve ith subvector.
 
Vector::const_shared_ptr subsetVectorForComponent (size_t index) const
 Retrieve ith subvector.
 
Vector::shared_ptr subsetVectorForVariable (const std::string &name)
 Retrieve a sub-vector associated with a particular Variable.
 
Vector::const_shared_ptr subsetVectorForVariable (const std::string &name) const
 Retrieve a sub-vector associated with a particular Variable.
 
Vector::shared_ptr subsetVectorForVariable (std::shared_ptr< const Variable > var)
 Retrieve a sub-vector associated with a particular Variable.
 
Vector::const_shared_ptr subsetVectorForVariable (std::shared_ptr< const Variable > var) const
 Retrieve a sub-vector associated with a particular Variable.
 
void subtract (const Vector &x, const Vector &y)
 Subtracts one vector from another. For Vectors, \(\mathit{this}_i = x_i - y_i\).
 
Scalar sum () const
 Return the maximum value of the vector. \(\max_i \mathit{this}_i\).
 
void swapData (VectorData &rhs)
 
void swapVectors (Vector &other) override
 Swap the data in this Vector for another.
 
void swapVectors (Vector::shared_ptr other)
 Swap the data in this Vector for another.
 
std::string type () const override
 Return the name of the vector.
 
std::string VectorDataName () const
 
virtual void writeRestart (int64_t fid) const
 Write restart data to file.
 
Scalar wrmsNorm (const Vector &x, const Vector &y) const
 Return a weighted norm of a vector.
 
Scalar wrmsNormMask (const Vector &x, const Vector &mask, const Vector &y) const
 Return a weighted norm of a subset of a vector.
 
void zero ()
 Set vector entries (including ghosts) to zero.
 
virtual ~ManagedThyraVector ()
 Destructor.
 

Static Public Member Functions

static AMP::LinearAlgebra::Vector::const_shared_ptr constView (const Thyra::VectorBase< double > *vec)
 Return an AMP Vector from the Thyra::VectorBase.
 
static std::shared_ptr< const ThyraVectorconstView (Vector::const_shared_ptr AmpVector)
 If needed, create a Thyra wrapper for AmpVector. Otherwise, return AmpVector.
 
static AMP::LinearAlgebra::Vector::shared_ptr view (Thyra::VectorBase< double > *vec)
 Return an AMP Vector from the Thyra::VectorBase.
 
static std::shared_ptr< ThyraVectorview (Vector::shared_ptr AmpVector)
 If needed, create a Thyra wrapper for AmpVector. Otherwise, return AmpVector.
 

Protected Member Functions

void swapThyraVec (ThyraVector &rhs)
 Swap the underlying PETSc Vec with another AMP::LinearAlgebra::Vector.
 

Protected Attributes

std::shared_ptr< AMP::Discretization::DOFManagerd_DOFManager
 
Teuchos::RCP< Thyra::VectorBase< double > > d_thyraVec
 Thyra Vector holding data in the vector.
 
AMP::Units d_units
 
std::shared_ptr< Variabled_Variable
 
std::shared_ptr< VectorDatad_VectorData
 
std::shared_ptr< VectorOperationsd_VectorOps
 
std::shared_ptr< std::vector< std::any > > d_Views
 
std::weak_ptr< Vectorweak_ptr_
 

Detailed Description

Vector capable of returning an Epetra_Vector from a ManagedVector.

One popular package of numerical algorithms is Trilinos. Many of the pieces of Trilinos rely on a basic vector called an Epetra vector. This class will provide an Epetra_Vector view on a vector. This should not be used explicitly. Rather, the EpetraVector interface provides the getEpetra_Vector interface. In this case, the class will populate an Epetra_Vector with a view of an array that the ManagedVector has.

This class is the class returned by EpetraVector::view() and EpetraVector::constView().

See also
EpetraVector

Definition at line 25 of file ManagedThyraVector.h.

Member Typedef Documentation

◆ const_shared_ptr

Definition at line 65 of file Vector.h.

◆ shared_ptr

Shorthand for shared pointer to Vector.

Definition at line 60 of file Vector.h.

Constructor & Destructor Documentation

◆ ManagedThyraVector()

AMP::LinearAlgebra::ManagedThyraVector::ManagedThyraVector ( Vector::shared_ptr  alias)
explicit

Create a view of a vector.

Parameters
[in]aliasVector to view

◆ ~ManagedThyraVector()

virtual AMP::LinearAlgebra::ManagedThyraVector::~ManagedThyraVector ( )
virtual

Destructor.

Member Function Documentation

◆ abs()

void AMP::LinearAlgebra::Vector::abs ( const Vector x)
inherited

Set this to the component-wise absolute value of a vector. \(\mathit{this}_i = |x_i|\).

Parameters
[in]xa vector

◆ add()

void AMP::LinearAlgebra::Vector::add ( const Vector x,
const Vector y 
)
inherited

Adds two vectors. For Vectors, \(\mathit{this}_i = x_i + y_i\).

Parameters
[in]xInput vector x
[in]yInput vector y

◆ addGhostValuesByGlobalID()

template<typename TYPE >
void AMP::LinearAlgebra::Vector::addGhostValuesByGlobalID ( int  num,
const size_t indices,
const TYPE vals 
)
inlineinherited

Definition at line 728 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ addScalar()

void AMP::LinearAlgebra::Vector::addScalar ( const Vector x,
const Scalar alpha 
)
inherited

set vector to \(x + \alpha \bar{1}\).

Parameters
[in]xa vector
[in]alphaa scalar

for vectors, \(\mathit{this}_i = x_i + \alpha\).

◆ addValuesByGlobalID()

template<typename TYPE >
void AMP::LinearAlgebra::Vector::addValuesByGlobalID ( int  num,
const size_t indices,
const TYPE vals 
)
inlineinherited

Definition at line 738 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ addValuesByLocalID()

template<class TYPE >
void AMP::LinearAlgebra::Vector::addValuesByLocalID ( int  num,
size_t indices,
const TYPE vals 
)
inlineinherited

Definition at line 672 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ axpby()

void AMP::LinearAlgebra::Vector::axpby ( const Scalar alpha,
const Scalar beta,
const Vector x 
)
inherited

Set this vector alpha * x + this. \(\mathit{this}_i = \alpha x_i + \beta \mathit{this}_i \).

Parameters
[in]alphaa scalar
[in]betaa scalar
[in]xa vector

◆ axpy()

void AMP::LinearAlgebra::Vector::axpy ( const Scalar alpha,
const Vector x,
const Vector y 
)
inherited

Set this vector to alpha * x + y. \(\mathit{this}_i = \alpha x_i + y_i\).

Parameters
[in]alphaa scalar
[in]xa vector
[in]ya vector

◆ begin() [1/2]

template<class TYPE = double>
VectorDataIterator< TYPE > AMP::LinearAlgebra::Vector::begin ( )
inlineinherited

Return an iterator to the beginning of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

Definition at line 572 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ begin() [2/2]

template<class TYPE = double>
VectorDataIterator< const TYPE > AMP::LinearAlgebra::Vector::begin ( ) const
inlineinherited

Return an iterator to the beginning of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

Definition at line 579 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ clone() [1/3]

std::shared_ptr< Vector > AMP::LinearAlgebra::Vector::clone ( ) const
inherited

Allocate space in the same fashion as this

This will allocate new space with identical layout as this. It will have the same number of blocks, each with the same engines and same number of entries. The vector will be associated with the same Variable.

Returns
A Vector shared pointer

◆ clone() [2/3]

std::shared_ptr< Vector > AMP::LinearAlgebra::Vector::clone ( const std::shared_ptr< Variable name) const
inherited

Allocate space in the same fashion as this

This will allocate new space with identical layout as this. It will have the same number of blocks, each with the same engines and same number of entries.

Parameters
[in]nameThe variable to associate with the new vector
Returns
A Vector shared pointer

◆ clone() [3/3]

std::shared_ptr< Vector > AMP::LinearAlgebra::Vector::clone ( const std::string &  name) const
inherited

Allocate space in the same fashion as this

This will allocate new space with identical layout as this. It will have the same number of blocks, each with the same engines and same number of entries. The vector will be associated with a clone of the same Variable with the given name.

Parameters
[in]nameName to give the variable associated with this vector
Returns
A Vector shared pointer

◆ cloneData()

std::shared_ptr< VectorData > AMP::LinearAlgebra::Vector::cloneData ( ) const
inlineinherited

Definition at line 696 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ constBegin()

template<class TYPE = double>
VectorDataIterator< const TYPE > AMP::LinearAlgebra::Vector::constBegin ( ) const
inlineinherited

Return an iterator to the beginning of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

Definition at line 586 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ constEnd()

template<class TYPE = double>
VectorDataIterator< const TYPE > AMP::LinearAlgebra::Vector::constEnd ( ) const
inlineinherited

Return an iterator to the end of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

Definition at line 616 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ constView() [1/2]

static AMP::LinearAlgebra::Vector::const_shared_ptr AMP::LinearAlgebra::ThyraVector::constView ( const Thyra::VectorBase< double > *  vec)
staticinherited

Return an AMP Vector from the Thyra::VectorBase.

◆ constView() [2/2]

static std::shared_ptr< const ThyraVector > AMP::LinearAlgebra::ThyraVector::constView ( Vector::const_shared_ptr  AmpVector)
staticinherited

If needed, create a Thyra wrapper for AmpVector. Otherwise, return AmpVector.

The function attempts to return a view with the least amount of work. It will never copy data. If the vector cannot be wrapped it wll return an error.

Parameters
AmpVectora shared pointer to a Vector

◆ containsGlobalElement()

bool AMP::LinearAlgebra::Vector::containsGlobalElement ( size_t  id)
inlineinherited

Definition at line 758 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ copy()

void AMP::LinearAlgebra::Vector::copy ( const Vector x)
inherited

Set vector equal to x For Vectors, \(\mathit{this}_i = x_i\).

Parameters
[in]xa vector

◆ copyCast()

void AMP::LinearAlgebra::Vector::copyCast ( std::shared_ptr< const Vector x)
inherited

Copy up/down-casting this

The vector will be associated with the same Variable, and will contain a copy of the data in x after up/down-casting it.

Parameters
[in]xa vector

◆ copyVector() [1/2]

virtual void AMP::LinearAlgebra::Vector::copyVector ( std::shared_ptr< const Vector x)
inlinevirtualinherited

◆ copyVector() [2/2]

void AMP::LinearAlgebra::ManagedThyraVector::copyVector ( Vector::const_shared_ptr  vec)
override

◆ dataChanged()

void AMP::LinearAlgebra::Vector::dataChanged ( )
inlineinherited

Definition at line 719 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ divide()

void AMP::LinearAlgebra::Vector::divide ( const Vector x,
const Vector y 
)
inherited

Component-wise divide one vector by another. For Vectors, \(\mathit{this}_i = x_i / y_i\).

Parameters
[in]xInput vector x
[in]yInput vector y

◆ dot()

Scalar AMP::LinearAlgebra::Vector::dot ( const Vector x) const
inherited

Return the dot product of this vector with the argument vector.

Returns

\[\sum_i x_i\mathit{this}_i\]

Parameters
[in]xa vector

◆ dumpGhostedData()

void AMP::LinearAlgebra::Vector::dumpGhostedData ( std::ostream &  out,
size_t  offset = 0 
) const
inlineinherited

Definition at line 767 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ dumpOwnedData()

void AMP::LinearAlgebra::Vector::dumpOwnedData ( std::ostream &  out,
size_t  GIDoffset = 0,
size_t  LIDoffset = 0 
) const
inlineinherited

Definition at line 763 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ end() [1/2]

template<class TYPE = double>
VectorDataIterator< TYPE > AMP::LinearAlgebra::Vector::end ( )
inlineinherited

Return an iterator to the end of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

Definition at line 602 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ end() [2/2]

template<class TYPE = double>
VectorDataIterator< const TYPE > AMP::LinearAlgebra::Vector::end ( ) const
inlineinherited

Return an iterator to the end of the data.

Returns
A VectorDataIterator

Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.

Warning
The non-const version of the iterators will automatically leave the vector in a non-consistent state. The user may be required to call makeConsistent.

Definition at line 609 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ equals()

bool AMP::LinearAlgebra::Vector::equals ( const Vector x,
const Scalar tol = 1e-6 
) const
inherited

Check if two vectors are equal.

Returns true if each vaue is within tol of the corresponding vaue in the other vector

Parameters
[in]xa vector
[in]toltolerance to use

◆ getComm()

const AMP_MPI & AMP::LinearAlgebra::Vector::getComm ( ) const
inlineinherited

Definition at line 646 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getCommunicationList()

std::shared_ptr< CommunicationList > AMP::LinearAlgebra::Vector::getCommunicationList ( ) const
inlineinherited

Get the CommunicationList for this Vector.

Definition at line 711 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getDataID()

uint64_t AMP::LinearAlgebra::Vector::getDataID ( ) const
inlineinherited

Definition at line 676 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getDOFManager()

std::shared_ptr< AMP::Discretization::DOFManager > AMP::LinearAlgebra::Vector::getDOFManager ( ) const
inlineinherited

Get the DOFManager for this Vector.

◆ getGhostSize()

size_t AMP::LinearAlgebra::Vector::getGhostSize ( ) const
inlineinherited

Definition at line 721 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getGhostValueByGlobalID()

template<typename TYPE = double>
TYPE AMP::LinearAlgebra::Vector::getGhostValueByGlobalID ( size_t  i) const
inherited

Return a ghost value from the vector.

Parameters
[in]iThe global index into the vector
Returns
The value stored at the index

This uses getGhostValuesByGlobalID to get the value

◆ getGhostValuesByGlobalID()

template<typename TYPE >
void AMP::LinearAlgebra::Vector::getGhostValuesByGlobalID ( int  num,
const size_t indices,
TYPE vals 
) const
inlineinherited

◆ getGlobalSize()

size_t AMP::LinearAlgebra::Vector::getGlobalSize ( ) const
inlineinherited

Definition at line 664 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getID()

uint64_t AMP::LinearAlgebra::Vector::getID ( ) const
inherited

Get a unique id hash for the vector.

◆ getLocalSize()

size_t AMP::LinearAlgebra::Vector::getLocalSize ( ) const
inlineinherited

Definition at line 663 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getLocalStartID()

size_t AMP::LinearAlgebra::Vector::getLocalStartID ( ) const
inlineinherited

Definition at line 665 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getLocalValueByGlobalID()

template<typename TYPE = double>
TYPE AMP::LinearAlgebra::Vector::getLocalValueByGlobalID ( size_t  i) const
inherited

Return a local value from the vector.

Parameters
[in]iThe global index into the vector
Returns
The value stored at the index

This uses getValuesByGlobalID to get the value

◆ getManagedVec() [1/2]

std::shared_ptr< const Vector > AMP::LinearAlgebra::ManagedThyraVector::getManagedVec ( ) const
inlineoverridevirtual

◆ getManagedVec() [2/2]

std::shared_ptr< Vector > AMP::LinearAlgebra::ManagedThyraVector::getManagedVec ( )
inlineoverridevirtual

◆ getMemoryLocation()

AMP::Utilities::MemoryType AMP::LinearAlgebra::Vector::getMemoryLocation ( ) const
inlineinherited

returns the memory location for data

Definition at line 779 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getName()

std::string AMP::LinearAlgebra::Vector::getName ( ) const
inherited

Return the vector name.

◆ getNativeVec() [1/2]

auto AMP::LinearAlgebra::ThyraVector::getNativeVec ( )
inlineinherited

Definition at line 77 of file ThyraVector.h.

References AMP::LinearAlgebra::ThyraVector::getVec().

◆ getNativeVec() [2/2]

auto AMP::LinearAlgebra::ThyraVector::getNativeVec ( ) const
inlineinherited

Definition at line 78 of file ThyraVector.h.

References AMP::LinearAlgebra::ThyraVector::getVec().

◆ getNumberOfComponents()

size_t AMP::LinearAlgebra::Vector::getNumberOfComponents ( ) const
inherited

Return integer number of patch data components in vector.

◆ getRawData()

template<class TYPE >
void AMP::LinearAlgebra::Vector::getRawData ( TYPE buf) const
inlineinherited

Definition at line 659 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getRawDataBlock() [1/2]

template<typename RETURN_TYPE >
RETURN_TYPE * AMP::LinearAlgebra::Vector::getRawDataBlock ( size_t  i = 0)
inlineinherited

Obtain a particular contiguous block of data cast to RETURN_TYPE.

Template Parameters
RETURN_TYPEThe pointer type of the return
Parameters
[in]iWhich block
Returns
A contiguous array of type RETURN_TYPE

Definition at line 627 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getRawDataBlock() [2/2]

template<typename RETURN_TYPE >
const RETURN_TYPE * AMP::LinearAlgebra::Vector::getRawDataBlock ( size_t  i = 0) const
inlineinherited

Obtain a particular contiguous block of data cast to RETURN_TYPE.

Template Parameters
RETURN_TYPEThe pointer type of the return
Parameters
[in]iWhich block
Returns
A const contiguous array of type RETURN_TYPE

Definition at line 638 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getRawDataBlockAsVoid() [1/2]

void * AMP::LinearAlgebra::Vector::getRawDataBlockAsVoid ( size_t  i)
inlineinherited

Definition at line 677 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getRawDataBlockAsVoid() [2/2]

const void * AMP::LinearAlgebra::Vector::getRawDataBlockAsVoid ( size_t  i) const
inlineinherited

Definition at line 681 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getUnits()

auto & AMP::LinearAlgebra::Vector::getUnits ( ) const
inlineinherited

Get the units for this Vector.

Definition at line 403 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_units.

◆ getUpdateStatus()

AMP::LinearAlgebra::UpdateState AMP::LinearAlgebra::Vector::getUpdateStatus ( ) const
inlineinherited

Definition at line 697 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getValueByGlobalID()

template<typename TYPE = double>
TYPE AMP::LinearAlgebra::Vector::getValueByGlobalID ( size_t  i) const
inherited

Return a value from the vector.

Parameters
[in]iThe global index into the vector
Returns
The value stored at the index

This uses getValuesByGlobalID to get the value

◆ getValueByLocalID()

template<typename TYPE = double>
TYPE AMP::LinearAlgebra::Vector::getValueByLocalID ( size_t  i) const
inherited

Return a local value from the vector.

Parameters
[in]iThe global index into the vector
Returns
The value stored at the index

This uses getValuesByGlobalID to get the value

◆ getValuesByGlobalID()

template<typename TYPE >
void AMP::LinearAlgebra::Vector::getValuesByGlobalID ( int  num,
const size_t indices,
TYPE vals 
) const
inlineinherited

Definition at line 743 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getValuesByLocalID()

template<typename TYPE >
void AMP::LinearAlgebra::Vector::getValuesByLocalID ( int  num,
const size_t indices,
TYPE vals 
) const
inlineinherited

Definition at line 753 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getVariable() [1/2]

std::shared_ptr< Variable > AMP::LinearAlgebra::Vector::getVariable ( )
inherited

Get the variable associated with this vector.

Returns
A shared point to the Variable associated with this Vector

◆ getVariable() [2/2]

const std::shared_ptr< Variable > AMP::LinearAlgebra::Vector::getVariable ( ) const
inherited

Get the variable associated with this vector.

Returns
A shared point to the Variable associated with this Vector

◆ getVec() [1/2]

virtual Teuchos::RCP< Thyra::VectorBase< double > > AMP::LinearAlgebra::ThyraVector::getVec ( )
virtualinherited

Obtain Thyra Vector for use in Thyra routines.

This function is used to get a Thyra vector. The following idiom should be used since it fails gracefully. In this function, a view may be created before the Vec is extracted

Referenced by AMP::LinearAlgebra::ThyraVector::getNativeVec(), and AMP::LinearAlgebra::ThyraVector::getNativeVec().

◆ getVec() [2/2]

virtual Teuchos::RCP< const Thyra::VectorBase< double > > AMP::LinearAlgebra::ThyraVector::getVec ( ) const
virtualinherited

Obtain Thyra Vector for use in Thyra routines.

This function is used to get a Thyra vector. The following idiom should be used since it fails gracefully. In this function, a view may be created before the Vec is extracted

◆ getVectorData() [1/2]

std::shared_ptr< VectorData > AMP::LinearAlgebra::Vector::getVectorData ( )
inlineinherited

Return the pointer to the VectorData.

Definition at line 412 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getVectorData() [2/2]

std::shared_ptr< const VectorData > AMP::LinearAlgebra::Vector::getVectorData ( ) const
inlineinherited

Return the pointer to the VectorData.

Definition at line 415 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ getVectorOperations() [1/2]

std::shared_ptr< VectorOperations > AMP::LinearAlgebra::Vector::getVectorOperations ( )
inlineinherited

Return the pointer to the VectorOperation.

Definition at line 418 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorOps.

◆ getVectorOperations() [2/2]

std::shared_ptr< const VectorOperations > AMP::LinearAlgebra::Vector::getVectorOperations ( ) const
inlineinherited

Return the pointer to the VectorOperation.

Definition at line 421 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorOps.

◆ getView()

template<typename VIEW_TYPE >
std::shared_ptr< VIEW_TYPE > AMP::LinearAlgebra::Vector::getView ( ) const
inherited

If a particular type of view of this Vector has been created, return it.

Template Parameters
VIEW_TYPEThe type of view to look for
Returns
A view of this vector

◆ hasComm()

bool AMP::LinearAlgebra::Vector::hasComm ( ) const
inlineinherited

Definition at line 645 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ hasView()

template<typename VIEW_TYPE >
bool AMP::LinearAlgebra::Vector::hasView ( ) const
inherited

If a particular type of view of this Vector has been created, return true.

Template Parameters
VIEW_TYPEThe type of view to look for
Returns
True if a view of this type has been created. False, otherwise.

◆ isType()

template<typename TYPE >
bool AMP::LinearAlgebra::Vector::isType ( size_t  block) const
inlineinherited

◆ L1Norm()

Scalar AMP::LinearAlgebra::Vector::L1Norm ( ) const
inherited

Return discrete \( L_1 \) -norm of this vector.

Returns

\[\sum_i |\mathit{this}_i|\]

◆ L2Norm()

Scalar AMP::LinearAlgebra::Vector::L2Norm ( ) const
inherited

Return discrete \( L_2 \) -norm of this vector.

Returns

\[\sqrt{\sum_i \mathit{this}_i^2}\]

◆ L2NormAndDot()

std::pair< Scalar, Scalar > AMP::LinearAlgebra::Vector::L2NormAndDot ( const Vector x) const
inherited

Return the L2 norm of this vector and the dot product with the argument vector.

Returns

\[\sum_i this_i^2 \]

and

\[\sum_i x_i\mathit{this}_i\]

. Note that this is an unoptimized version purely meant to provide functionality

Parameters
[in]xa vector
Returns
std::pair of L2Norm of vector and dot in that order

◆ linearSum()

void AMP::LinearAlgebra::Vector::linearSum ( const Scalar alpha,
const Vector x,
const Scalar beta,
const Vector y 
)
inherited

Set a vector to be a linear combination of two vectors. \(\mathit{this}_i = \alpha x_i + \beta y_i\).

Parameters
[in]alphaa scalar
[in]xa vector
[in]betaa scalar
[in]ya vector

◆ makeConsistent() [1/2]

void AMP::LinearAlgebra::Vector::makeConsistent ( )
inlineinherited

Definition at line 705 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ makeConsistent() [2/2]

void AMP::LinearAlgebra::Vector::makeConsistent ( AMP::LinearAlgebra::ScatterType  t)
inlineinherited

Definition at line 706 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ max()

Scalar AMP::LinearAlgebra::Vector::max ( ) const
inherited

Return the maximum value of the vector. \(\max_i \mathit{this}_i\).

◆ maxNorm()

Scalar AMP::LinearAlgebra::Vector::maxNorm ( ) const
inherited

Return the \( L_\infty \) -norm of this vector.

Returns

\[\max_i |\mathit{this}_i|\]

◆ mean()

Scalar AMP::LinearAlgebra::Vector::mean ( ) const
inherited

Return the maximum value of the vector. \(\max_i \mathit{this}_i\).

◆ min()

Scalar AMP::LinearAlgebra::Vector::min ( ) const
inherited

Return the minimum value of the vector. \(\min_i \mathit{this}_i\).

◆ minQuotient()

Scalar AMP::LinearAlgebra::Vector::minQuotient ( const Vector x) const
inherited

Returns the minimum of the quotient of two vectors:

\[\min_{i,y_i\neq0} x_i/\mathit{this}_i\]

Parameters
[in]xa vector
Returns

\[\min_{i,y_i\neq0} x_i/\mathit{this}_i\]

◆ multiply()

void AMP::LinearAlgebra::Vector::multiply ( const Vector x,
const Vector y 
)
inherited

Component-wise multiply one vector with another. For Vectors, \(\mathit{this}_i = x_i y_i\).

Parameters
[in]xInput vector x
[in]yInput vector y

◆ numberOfDataBlocks()

size_t AMP::LinearAlgebra::Vector::numberOfDataBlocks ( ) const
inlineinherited

Definition at line 648 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ putRawData()

template<class TYPE >
void AMP::LinearAlgebra::Vector::putRawData ( const TYPE buf)
inlineinherited

Definition at line 654 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ rawClone()

std::unique_ptr< Vector > AMP::LinearAlgebra::ManagedThyraVector::rawClone ( ) const
overridevirtual

Allocate space in the same fashion as this

This will allocate new space with identical layout as this.

Returns
A Vector shared pointer It will have the same number of blocks, each with the same engines and same number of entries.

Reimplemented from AMP::LinearAlgebra::Vector.

◆ reciprocal()

void AMP::LinearAlgebra::Vector::reciprocal ( const Vector x)
inherited

Set this to the component-wise reciprocal of a vector. \(\mathit{this}_i = 1/x_i\).

Parameters
xa vector

◆ registerChildObjects()

virtual void AMP::LinearAlgebra::Vector::registerChildObjects ( AMP::IO::RestartManager manager) const
virtualinherited

Register any child objects.

This function will register child objects with the manager

Parameters
managerRestart manager

Reimplemented in AMP::LinearAlgebra::MultiVector.

◆ registerView()

template<typename VIEW_TYPE >
void AMP::LinearAlgebra::Vector::registerView ( std::shared_ptr< VIEW_TYPE v) const
inherited

Add a view of this vector to an internal queue.

Parameters
[in]vThe view to add

◆ rename()

virtual void AMP::LinearAlgebra::Vector::rename ( const std::string &  src,
const std::string &  dst 
)
virtualinherited

Renames.

Renames the vector and any components matching src to dst.

Parameters
[in]srcThe original variable name
[in]dstThe new variable name

◆ reset()

virtual void AMP::LinearAlgebra::Vector::reset ( )
virtualinherited

Reset.

Reimplemented in AMP::LinearAlgebra::MultiVector.

◆ scale() [1/2]

void AMP::LinearAlgebra::Vector::scale ( const Scalar alpha)
inherited

Scale a vector. For Vectors, \(\mathit{this}_i = \alpha\mathit{this}_i\).

Parameters
[in]alphaa scalar

◆ scale() [2/2]

void AMP::LinearAlgebra::Vector::scale ( const Scalar alpha,
const Vector x 
)
inherited

Set vector equal to scaled input. For Vectors, \(\mathit{this}_i = \alpha x_i\).

Parameters
[in]alphaa scalar
[in]xa vector

◆ select() [1/2]

shared_ptr AMP::LinearAlgebra::Vector::select ( const VectorSelector criterion)
inherited

Selects a portion of this vector and creates a view.

Selects a portion of this vector and creates a view. This function does NOT always return a multivector. To use: auto disp = data->select( VS_ByVariableName( "displacement" ), "displacement view" );

Parameters
[in]criterionThe method for deciding inclusion in the view

◆ select() [2/2]

const_shared_ptr AMP::LinearAlgebra::Vector::select ( const VectorSelector criterion) const
inherited

Selects a portion of this vector and creates a view.

Selects a portion of this vector and creates a view. This function does NOT always return a multivector. To use: auto disp = data->select( VS_ByVariableName( "displacement" ), "displacement view" );

Parameters
[in]criterionThe method for deciding inclusion in the view

◆ selectInto() [1/2]

virtual Vector::shared_ptr AMP::LinearAlgebra::Vector::selectInto ( const VectorSelector criterion)
virtualinherited

Selects a portion of this vector and puts a view into a vector.

Parameters
[in]criterionThe method for deciding inclusion in the view

Reimplemented in AMP::LinearAlgebra::MultiVector.

◆ selectInto() [2/2]

virtual Vector::const_shared_ptr AMP::LinearAlgebra::Vector::selectInto ( const VectorSelector criterion) const
virtualinherited

◆ setCommunicationList()

void AMP::LinearAlgebra::Vector::setCommunicationList ( std::shared_ptr< CommunicationList comm)
inlineinherited

Definition at line 715 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ setGhostValuesByGlobalID()

template<typename TYPE >
void AMP::LinearAlgebra::Vector::setGhostValuesByGlobalID ( int  num,
const size_t indices,
const TYPE vals 
)
inlineinherited

Definition at line 723 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ setMax()

void AMP::LinearAlgebra::Vector::setMax ( const Scalar val)
inherited

modify vector to have max value 'val' specified

◆ setMin()

void AMP::LinearAlgebra::Vector::setMin ( const Scalar val)
inherited

modify vector to have min value 'val' specified

◆ setName()

void AMP::LinearAlgebra::Vector::setName ( const std::string &  name)
inherited

Set the vector name.

◆ setNoGhosts()

void AMP::LinearAlgebra::Vector::setNoGhosts ( )
inlineinherited

Ensure this vector has no ghosts.

Calls clearBuffer for the communication list and removes any storage for ghosts

Definition at line 775 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ setRandomValues()

void AMP::LinearAlgebra::Vector::setRandomValues ( )
inherited

Set data in this vector to random values on [0,1).

◆ setToScalar()

void AMP::LinearAlgebra::Vector::setToScalar ( const Scalar alpha)
inherited

Set all compenents of a vector to a scalar. For Vectors, the components of this are set to \(\alpha\).

Parameters
[in]alphascalar value

◆ setUnits()

virtual void AMP::LinearAlgebra::Vector::setUnits ( AMP::Units  )
virtualinherited

Get the units for this Vector.

◆ setUpdateStatus()

void AMP::LinearAlgebra::Vector::setUpdateStatus ( AMP::LinearAlgebra::UpdateState  state)
inlineinherited

Definition at line 701 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ setValueByGlobalID()

template<typename TYPE >
void AMP::LinearAlgebra::Vector::setValueByGlobalID ( size_t  i,
TYPE  v 
)
inherited

Set a value in the vector.

Parameters
[in]iThe global index into the vector
[in]vThe value to set

This uses setValuesByGlobalID to set the value

◆ setValuesByGlobalID()

template<typename TYPE >
void AMP::LinearAlgebra::Vector::setValuesByGlobalID ( int  num,
const size_t indices,
const TYPE vals 
)
inlineinherited

Definition at line 733 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ setValuesByLocalID()

template<class TYPE >
void AMP::LinearAlgebra::Vector::setValuesByLocalID ( int  num,
size_t indices,
const TYPE vals 
)
inlineinherited

Definition at line 667 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ setVariable()

void AMP::LinearAlgebra::Vector::setVariable ( const std::shared_ptr< Variable name)
inherited

Change the variable associated with this vector.

Parameters
[in]nameThe new variable

◆ shared_from_this() [1/2]

std::shared_ptr< Vector > AMP::enable_shared_from_this< Vector >::shared_from_this ( )
inlineinherited

Definition at line 28 of file enable_shared_from_this.h.

◆ shared_from_this() [2/2]

std::shared_ptr< const Vector > AMP::enable_shared_from_this< Vector >::shared_from_this ( ) const
inlineinherited

Definition at line 46 of file enable_shared_from_this.h.

◆ sizeOfDataBlock()

size_t AMP::LinearAlgebra::Vector::sizeOfDataBlock ( size_t  i = 0) const
inlineinherited

Definition at line 649 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ sizeofDataBlockType()

size_t AMP::LinearAlgebra::Vector::sizeofDataBlockType ( size_t  i) const
inlineinherited

Definition at line 685 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ subsetVectorForComponent() [1/2]

Vector::shared_ptr AMP::LinearAlgebra::Vector::subsetVectorForComponent ( size_t  index)
inherited

Retrieve ith subvector.

Returns the ith subvector based on teh number of components.

Parameters
[in]indexIndex to retrieve
Returns
A Vector shared pointer

◆ subsetVectorForComponent() [2/2]

Vector::const_shared_ptr AMP::LinearAlgebra::Vector::subsetVectorForComponent ( size_t  index) const
inherited

Retrieve ith subvector.

Returns the ith subvector based on teh number of components.

Parameters
[in]indexIndex to retrieve
Returns
A Vector shared pointer

◆ subsetVectorForVariable() [1/4]

Vector::shared_ptr AMP::LinearAlgebra::Vector::subsetVectorForVariable ( const std::string &  name)
inherited

Retrieve a sub-vector associated with a particular Variable.

Parameters
[in]nameVariable by which to retrieve a subvector
Returns
A Vector shared pointer
See also
MultiVector

◆ subsetVectorForVariable() [2/4]

Vector::const_shared_ptr AMP::LinearAlgebra::Vector::subsetVectorForVariable ( const std::string &  name) const
inherited

Retrieve a sub-vector associated with a particular Variable.

Parameters
[in]nameVariable by which to retrieve a subvector
Returns
A Vector shared pointer

A null pointer will be returned if the vector does not contain a sub-vector associated with the Variable

See also
MultiVector

◆ subsetVectorForVariable() [3/4]

Vector::shared_ptr AMP::LinearAlgebra::Vector::subsetVectorForVariable ( std::shared_ptr< const Variable var)
inherited

Retrieve a sub-vector associated with a particular Variable.

Parameters
[in]varVariable by which to retrieve a subvector
Returns
A Vector shared pointer

A null pointer will be returned if the vector does not contain a sub-vector associated with the Variable

See also
MultiVector

◆ subsetVectorForVariable() [4/4]

Vector::const_shared_ptr AMP::LinearAlgebra::Vector::subsetVectorForVariable ( std::shared_ptr< const Variable var) const
inherited

Retrieve a sub-vector associated with a particular Variable.

Parameters
[in]varVariable by which to retrieve a subvector
Returns
A Vector shared pointer

A null pointer will be returned if the vector does not contain a sub-vector associated with the Variable

See also
MultiVector

◆ subtract()

void AMP::LinearAlgebra::Vector::subtract ( const Vector x,
const Vector y 
)
inherited

Subtracts one vector from another. For Vectors, \(\mathit{this}_i = x_i - y_i\).

Parameters
[in]xInput vector x
[in]yInput vector y

◆ sum()

Scalar AMP::LinearAlgebra::Vector::sum ( ) const
inherited

Return the maximum value of the vector. \(\max_i \mathit{this}_i\).

◆ swapData()

void AMP::LinearAlgebra::Vector::swapData ( VectorData rhs)
inlineinherited

Definition at line 695 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ swapThyraVec()

void AMP::LinearAlgebra::ThyraVector::swapThyraVec ( ThyraVector rhs)
inlineprotectedinherited

Swap the underlying PETSc Vec with another AMP::LinearAlgebra::Vector.

Definition at line 96 of file ThyraVector.h.

References AMP::LinearAlgebra::ThyraVector::d_thyraVec.

◆ swapVectors() [1/2]

void AMP::LinearAlgebra::ManagedThyraVector::swapVectors ( Vector other)
overridevirtual

Swap the data in this Vector for another.

Parameters
[in]otherVector to swap data with

Effectively, this is

Vector *b;
std::swap ( a, b );
Abstraction of a discrete Vector in a linear simulation.
Definition Vector.h:54
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60

without a and b exchanging pointers.

Reimplemented from AMP::LinearAlgebra::Vector.

◆ swapVectors() [2/2]

void AMP::LinearAlgebra::Vector::swapVectors ( Vector::shared_ptr  other)
inherited

Swap the data in this Vector for another.

Parameters
[in]otherVector to swap data with

A null pointer will be returned if the vector does not contain a sub-vector associated with the Variable. Effectively, this is

Vector *b;
std::swap ( a, b );

without a and b exchanging pointers.

◆ type()

std::string AMP::LinearAlgebra::ManagedThyraVector::type ( ) const
overridevirtual

Return the name of the vector.

Reimplemented from AMP::LinearAlgebra::Vector.

◆ VectorDataName()

std::string AMP::LinearAlgebra::Vector::VectorDataName ( ) const
inlineinherited

Definition at line 647 of file Vector.h.

References AMP::LinearAlgebra::Vector::d_VectorData.

◆ view() [1/2]

static AMP::LinearAlgebra::Vector::shared_ptr AMP::LinearAlgebra::ThyraVector::view ( Thyra::VectorBase< double > *  vec)
staticinherited

Return an AMP Vector from the Thyra::VectorBase.

◆ view() [2/2]

static std::shared_ptr< ThyraVector > AMP::LinearAlgebra::ThyraVector::view ( Vector::shared_ptr  AmpVector)
staticinherited

If needed, create a Thyra wrapper for AmpVector. Otherwise, return AmpVector.

The function attempts to return a view with the least amount of work. It will never copy data. If the vector cannot be wrapped it wll return an error.

Parameters
AmpVectora shared pointer to a Vector

◆ writeRestart()

virtual void AMP::LinearAlgebra::Vector::writeRestart ( int64_t  fid) const
virtualinherited

Write restart data to file.

This function will write the mesh to an HDF5 file

Parameters
fidFile identifier to write

Reimplemented in AMP::LinearAlgebra::MultiVector.

◆ wrmsNorm()

Scalar AMP::LinearAlgebra::Vector::wrmsNorm ( const Vector x,
const Vector y 
) const
inherited

Return a weighted norm of a vector.

Parameters
[in]xa vector
[in]ya vector
Returns

\[\sqrt{\frac{\displaystyle \sum_i x^2_iy^2_i}{n}}\]

◆ wrmsNormMask()

Scalar AMP::LinearAlgebra::Vector::wrmsNormMask ( const Vector x,
const Vector mask,
const Vector y 
) const
inherited

Return a weighted norm of a subset of a vector.

Parameters
[in]xa vector
[in]ya vector
[in]maska vector
Returns

\[\sqrt{\frac{\displaystyle \sum_{i,\mathit{mask}_i>0} x^2_iy^2_i}{n}}\]

◆ zero()

void AMP::LinearAlgebra::Vector::zero ( )
inherited

Set vector entries (including ghosts) to zero.

This is equivalent (but more efficient) to calling setToScalar ( 0.0 ) followed by a makeConsistent(SET)

Member Data Documentation

◆ d_DOFManager

std::shared_ptr<AMP::Discretization::DOFManager> AMP::LinearAlgebra::Vector::d_DOFManager
protectedinherited

Definition at line 865 of file Vector.h.

◆ d_thyraVec

Teuchos::RCP<Thyra::VectorBase<double> > AMP::LinearAlgebra::ThyraVector::d_thyraVec
protectedinherited

Thyra Vector holding data in the vector.

Whether created with VecCreate (called Native) or a view of an AMP:Vector (called Managed), this pointer is what is used when calling the Thyra Vector interface

Definition at line 90 of file ThyraVector.h.

Referenced by AMP::LinearAlgebra::ThyraVector::swapThyraVec().

◆ d_units

AMP::Units AMP::LinearAlgebra::Vector::d_units
protectedinherited

Definition at line 863 of file Vector.h.

Referenced by AMP::LinearAlgebra::Vector::getUnits().

◆ d_Variable

std::shared_ptr<Variable> AMP::LinearAlgebra::Vector::d_Variable
protectedinherited

Definition at line 864 of file Vector.h.

◆ d_VectorData

std::shared_ptr<VectorData> AMP::LinearAlgebra::Vector::d_VectorData
protectedinherited

Definition at line 866 of file Vector.h.

Referenced by AMP::LinearAlgebra::Vector::addGhostValuesByGlobalID(), AMP::LinearAlgebra::Vector::addValuesByGlobalID(), AMP::LinearAlgebra::Vector::addValuesByLocalID(), AMP::LinearAlgebra::Vector::begin(), AMP::LinearAlgebra::Vector::begin(), AMP::LinearAlgebra::Vector::cloneData(), AMP::LinearAlgebra::Vector::constBegin(), AMP::LinearAlgebra::Vector::constEnd(), AMP::LinearAlgebra::Vector::containsGlobalElement(), AMP::LinearAlgebra::Vector::copyVector(), AMP::LinearAlgebra::Vector::dataChanged(), AMP::LinearAlgebra::Vector::dumpGhostedData(), AMP::LinearAlgebra::Vector::dumpOwnedData(), AMP::LinearAlgebra::Vector::end(), AMP::LinearAlgebra::Vector::end(), AMP::LinearAlgebra::Vector::getComm(), AMP::LinearAlgebra::Vector::getCommunicationList(), AMP::LinearAlgebra::Vector::getDataID(), AMP::LinearAlgebra::Vector::getGhostSize(), AMP::LinearAlgebra::Vector::getGhostValuesByGlobalID(), AMP::LinearAlgebra::Vector::getGlobalSize(), AMP::LinearAlgebra::Vector::getLocalSize(), AMP::LinearAlgebra::Vector::getLocalStartID(), AMP::LinearAlgebra::Vector::getMemoryLocation(), AMP::LinearAlgebra::Vector::getRawData(), AMP::LinearAlgebra::Vector::getRawDataBlock(), AMP::LinearAlgebra::Vector::getRawDataBlock(), AMP::LinearAlgebra::Vector::getRawDataBlockAsVoid(), AMP::LinearAlgebra::Vector::getRawDataBlockAsVoid(), AMP::LinearAlgebra::Vector::getUpdateStatus(), AMP::LinearAlgebra::Vector::getValuesByGlobalID(), AMP::LinearAlgebra::Vector::getValuesByLocalID(), AMP::LinearAlgebra::Vector::getVectorData(), AMP::LinearAlgebra::Vector::getVectorData(), AMP::LinearAlgebra::Vector::hasComm(), AMP::LinearAlgebra::Vector::isType(), AMP::LinearAlgebra::Vector::makeConsistent(), AMP::LinearAlgebra::Vector::makeConsistent(), AMP::LinearAlgebra::Vector::numberOfDataBlocks(), AMP::LinearAlgebra::Vector::putRawData(), AMP::LinearAlgebra::Vector::setCommunicationList(), AMP::LinearAlgebra::Vector::setGhostValuesByGlobalID(), AMP::LinearAlgebra::Vector::setNoGhosts(), AMP::LinearAlgebra::Vector::setUpdateStatus(), AMP::LinearAlgebra::Vector::setValuesByGlobalID(), AMP::LinearAlgebra::Vector::setValuesByLocalID(), AMP::LinearAlgebra::Vector::sizeOfDataBlock(), AMP::LinearAlgebra::Vector::sizeofDataBlockType(), AMP::LinearAlgebra::Vector::swapData(), and AMP::LinearAlgebra::Vector::VectorDataName().

◆ d_VectorOps

std::shared_ptr<VectorOperations> AMP::LinearAlgebra::Vector::d_VectorOps
protectedinherited

◆ d_Views

std::shared_ptr<std::vector<std::any> > AMP::LinearAlgebra::Vector::d_Views
protectedinherited

Definition at line 868 of file Vector.h.

◆ weak_ptr_

std::weak_ptr<Vector > AMP::enable_shared_from_this< Vector >::weak_ptr_
mutableprotectedinherited

Definition at line 69 of file enable_shared_from_this.h.


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