Advanced Multi-Physics (AMP)
On-Line Documentation
Public Member Functions | Protected Attributes | List of all members
AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT > Class Template Reference

An AMP Vector that uses Tpetra for parallel data management, linear algebra, etc. More...

#include <TpetraVectorOperations.h>

Inheritance diagram for AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >:
Inheritance graph
[legend]

Public Member Functions

void abs (const VectorData &x, VectorData &z) override
 Set this to the component-wise absolute value of a vector. \(z_i = |x_i|\).
 
void add (const VectorData &x, const VectorData &y, VectorData &z) override
 Adds two vectors. For Vectors, \(\mathit{this}_i = x_i + y_i\).
 
void addScalar (const VectorData &, const Scalar &, VectorData &) override
 set vector to \(x + \alpha \bar{1}\).
 
void axpby (const Scalar &alpha, const Scalar &beta, const VectorData &x, VectorData &y) override
 Set this vector alpha * x + this. \(y_i = \alpha x_i + \beta y_i \).
 
void axpy (const Scalar &alpha, const VectorData &x, const VectorData &y, VectorData &z) override
 Set this vector to alpha * x + y. \(z_i = \alpha x_i + y_i\).
 
std::shared_ptr< VectorOperationscloneOperations () const override
 Clone the operations.
 
void copy (const VectorData &x, VectorData &z) override
 Set vector equal to x For Vectors, \(z_i = x_i\).
 
void copyCast (const VectorData &, VectorData &) override
 Set vector equal to x (with different precision) For Vectors, \(z_i = x_i\).
 
void divide (const VectorData &x, const VectorData &y, VectorData &z) override
 Component-wise divide one vector by another. For Vectors, \(z_i = x_i / y_i\).
 
Scalar dot (const VectorData &x, const VectorData &y) const override
 Return the dot product of this vector with the argument vector.
 
virtual bool equals (const VectorData &x, const VectorData &y, const Scalar &tol) const
 Check if two vectors are equal.
 
uint64_t getID () const
 Get a unique id hash for the vector.
 
Scalar L1Norm (const VectorData &x) const override
 Return discrete \( L_1 \) -norm of this vector.
 
Scalar L2Norm (const VectorData &x) const override
 Return discrete \( L_2 \) -norm of this vector.
 
void linearSum (const Scalar &alpha, const VectorData &x, const Scalar &beta, const VectorData &y, VectorData &z) override
 Set a vector to be a linear combination of two vectors. \(z_i = \alpha x_i + \beta y_i\).
 
Scalar localDot (const AMP::LinearAlgebra::VectorData &x, const VectorData &y) const override
 Return the local dot product of this vector with the argument vector.
 
bool localEquals (const AMP::LinearAlgebra::VectorData &, const AMP::LinearAlgebra::VectorData &, const AMP::Scalar &) const override
 Determine if the local portion of two vectors are equal using an absolute tolerance.
 
Scalar localL1Norm (const AMP::LinearAlgebra::VectorData &x) const override
 Return local discrete \( L_1 \) -norm of this vector.
 
Scalar localL2Norm (const AMP::LinearAlgebra::VectorData &x) const override
 Return local discrete \( L_2 \) -norm of this vector.
 
Scalar localMax (const AMP::LinearAlgebra::VectorData &) const override
 Return the local maximum value of the vector. \(\max_i x_i\).
 
Scalar localMaxNorm (const AMP::LinearAlgebra::VectorData &x) const override
 Return the local \( L_\infty \) -norm of this vector.
 
Scalar localMin (const AMP::LinearAlgebra::VectorData &) const override
 Return the local minimum value of the vector. \(\min_i x_i\).
 
Scalar localMinQuotient (const AMP::LinearAlgebra::VectorData &, const AMP::LinearAlgebra::VectorData &) const override
 Returns the local minimum of the quotient of two vectors:
 
Scalar localSum (const AMP::LinearAlgebra::VectorData &) const override
 Return the local sum of the vector.
 
Scalar localWrmsNorm (const AMP::LinearAlgebra::VectorData &, const AMP::LinearAlgebra::VectorData &) const override
 Return a weighted norm of a vector.
 
Scalar localWrmsNormMask (const AMP::LinearAlgebra::VectorData &, const AMP::LinearAlgebra::VectorData &, const AMP::LinearAlgebra::VectorData &) const override
 Return a weighted norm of a subset of a vector.
 
Scalar max (const VectorData &x) const override
 Return the maximum value of the vector. \(\max_i x_i\).
 
Scalar maxNorm (const VectorData &x) const override
 Return the \( L_\infty \) -norm of this vector.
 
Scalar mean (const VectorData &x) const
 Return the mean of the values of the vector.
 
Scalar min (const VectorData &x) const override
 Return the minimum value of the vector. \(\min_i x_i\).
 
virtual Scalar minQuotient (const VectorData &x, const VectorData &y) const
 Returns the minimum of the quotient of two vectors:
 
void multiply (const VectorData &x, const VectorData &y, VectorData &z) override
 Component-wise multiply one vector with another. For Vectors, \(z_i = x_i y_i\).
 
void reciprocal (const VectorData &x, VectorData &y) override
 Set this to the component-wise reciprocal of a vector. \(y_i = 1/x_i\).
 
virtual void registerChildObjects (AMP::IO::RestartManager *manager) const
 Register any child objects.
 
void scale (const Scalar &alpha, const VectorData &x, VectorData &y) override
 Set vector equal to scaled input. For Vectors, \(y_i = \alpha x_i\).
 
void scale (const Scalar &alpha, VectorData &x) override
 Scale a vector. For Vectors, \(x_i = \alpha x_i\).
 
void setMax (const Scalar &alpha, VectorData &z) override
 modify vector to set \(x_i = max(x_i, val)\).
 
void setMin (const Scalar &alpha, VectorData &z) override
 modify vector to set \(x_i = min(x_i, val)\).
 
void setRandomValues (VectorData &x) override
 Set data in this vector to random values.
 
void setToScalar (const Scalar &alpha, VectorData &z) override
 Set all compenents of a vector to a scalar. For Vectors, the components of z are set to \(\alpha\).
 
void subtract (const VectorData &x, const VectorData &y, VectorData &z) override
 Subtracts one vector from another. For Vectors, \(z_i = x_i - y_i\).
 
virtual Scalar sum (const VectorData &x) const
 Return the sum of the values of the vector.
 
 TpetraVectorOperations ()=default
 
std::string VectorOpName () const override
 Get the type name.
 
virtual void writeRestart (int64_t fid) const
 Write restart data to file.
 
virtual Scalar wrmsNorm (const VectorData &x, const VectorData &y) const
 Return a weighted norm of a vector.
 
virtual Scalar wrmsNormMask (const VectorData &x, const VectorData &mask, const VectorData &y) const
 Return a weighted norm of a subset of a vector.
 
void zero (VectorData &x) override
 Set vector entries (including ghosts) to zero.
 
virtual ~TpetraVectorOperations ()=default
 

Protected Attributes

uint64_t d_hash = 0
 

Detailed Description

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
class AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >

An AMP Vector that uses Tpetra for parallel data management, linear algebra, etc.

This is an AMP wrapper to Tpetra. This class is used when Tpetra is chosen as the default linear algebra engine. This class is not to be used directly, just through base class interfaces.

See also
TpetraVector

Definition at line 23 of file TpetraVectorOperations.h.

Constructor & Destructor Documentation

◆ TpetraVectorOperations()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::TpetraVectorOperations ( )
default

◆ ~TpetraVectorOperations()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
virtual AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::~TpetraVectorOperations ( )
virtualdefault

Member Function Documentation

◆ abs()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::abs ( const VectorData x,
VectorData z 
)
overridevirtual

Set this to the component-wise absolute value of a vector. \(z_i = |x_i|\).

Parameters
[in]xa vector
[out]zOutput vector z

Implements AMP::LinearAlgebra::VectorOperations.

◆ add()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::add ( const VectorData x,
const VectorData y,
VectorData z 
)
overridevirtual

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

Parameters
[in]xInput vector x
[in]yInput vector y
[out]zOutput vector z

Implements AMP::LinearAlgebra::VectorOperations.

◆ addScalar()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::addScalar ( const VectorData x,
const Scalar alpha,
VectorData y 
)
overridevirtual

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

for vectors, \(y_i = x_i + \alpha\).

Parameters
[in]xa vector
[in]alphaa scalar
[out]yOutput vector y

Implements AMP::LinearAlgebra::VectorOperations.

◆ axpby()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::axpby ( const Scalar alpha,
const Scalar beta,
const VectorData x,
VectorData y 
)
overridevirtual

Set this vector alpha * x + this. \(y_i = \alpha x_i + \beta y_i \).

Parameters
[in]alphaa scalar
[in]betaa scalar
[in]xa vector
[in,out]yOutput vector z

Implements AMP::LinearAlgebra::VectorOperations.

◆ axpy()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::axpy ( const Scalar alpha,
const VectorData x,
const VectorData y,
VectorData z 
)
overridevirtual

Set this vector to alpha * x + y. \(z_i = \alpha x_i + y_i\).

Parameters
[in]alphaa scalar
[in]xa vector
[in]ya vector
[out]zOutput vector z

Implements AMP::LinearAlgebra::VectorOperations.

◆ cloneOperations()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
std::shared_ptr< VectorOperations > AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::cloneOperations ( ) const
inlineoverridevirtual

Clone the operations.

Implements AMP::LinearAlgebra::VectorOperations.

Definition at line 30 of file TpetraVectorOperations.h.

◆ copy()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::copy ( const VectorData x,
VectorData z 
)
overridevirtual

Set vector equal to x For Vectors, \(z_i = x_i\).

Parameters
[in]xa vector
[out]za vector

Implements AMP::LinearAlgebra::VectorOperations.

◆ copyCast()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::copyCast ( const VectorData x,
VectorData z 
)
inlineoverridevirtual

Set vector equal to x (with different precision) For Vectors, \(z_i = x_i\).

Parameters
[in]xa vector
[out]za vector

Implements AMP::LinearAlgebra::VectorOperations.

Definition at line 42 of file TpetraVectorOperations.h.

References AMP_ERROR.

◆ divide()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::divide ( const VectorData x,
const VectorData y,
VectorData z 
)
overridevirtual

Component-wise divide one vector by another. For Vectors, \(z_i = x_i / y_i\).

Parameters
[in]xInput vector x
[in]yInput vector y
[out]zOutput vector z

Implements AMP::LinearAlgebra::VectorOperations.

◆ dot()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::dot ( const VectorData x,
const VectorData y 
) const
overridevirtual

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

Returns

\[\sum_i x_i y_i\]

Parameters
[in]xa vector
[in,out]ya vector

Reimplemented from AMP::LinearAlgebra::VectorOperations.

◆ equals()

virtual bool AMP::LinearAlgebra::VectorOperations::equals ( const VectorData x,
const VectorData y,
const Scalar tol 
) const
virtualinherited

◆ getID()

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

Get a unique id hash for the vector.

◆ L1Norm()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::L1Norm ( const VectorData x) const
overridevirtual

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

Returns

\[\sum_i |x_i|\]

Parameters
[in]xa vector

Reimplemented from AMP::LinearAlgebra::VectorOperations.

◆ L2Norm()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::L2Norm ( const VectorData x) const
overridevirtual

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

Returns

\[\sqrt{\sum_i x_i^2}\]

Parameters
[in]xa vector

Reimplemented from AMP::LinearAlgebra::VectorOperations.

◆ linearSum()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::linearSum ( const Scalar alpha,
const VectorData x,
const Scalar beta,
const VectorData y,
VectorData z 
)
overridevirtual

Set a vector to be a linear combination of two vectors. \(z_i = \alpha x_i + \beta y_i\).

Parameters
[in]alphaa scalar
[in]xa vector
[in]betaa scalar
[in]ya vector
[out]zOutput vector z

Implements AMP::LinearAlgebra::VectorOperations.

◆ localDot()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::localDot ( const AMP::LinearAlgebra::VectorData x,
const VectorData y 
) const
overridevirtual

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

Returns

\[\sum_i x_i y_i\]

Parameters
[in]xa vector
[in]ya vector

Implements AMP::LinearAlgebra::VectorOperations.

◆ localEquals()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
bool AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::localEquals ( const AMP::LinearAlgebra::VectorData x,
const AMP::LinearAlgebra::VectorData y,
const AMP::Scalar tol 
) const
overridevirtual

Determine if the local portion of two vectors are equal using an absolute tolerance.

Parameters
[in]xa vector
[in]ya vector
[in]tolTolerance of comparison
Returns
True iff \(||y - x||_\infty < \mathit{tol}\)

Implements AMP::LinearAlgebra::VectorOperations.

◆ localL1Norm()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::localL1Norm ( const AMP::LinearAlgebra::VectorData x) const
overridevirtual

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

Returns

\[\sum_i |x_i|\]

Parameters
[in]xa vector

Implements AMP::LinearAlgebra::VectorOperations.

◆ localL2Norm()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::localL2Norm ( const AMP::LinearAlgebra::VectorData x) const
overridevirtual

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

Returns

\[\sqrt{\sum_i x_i^2}\]

Parameters
[in]xa vector

Implements AMP::LinearAlgebra::VectorOperations.

◆ localMax()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::localMax ( const AMP::LinearAlgebra::VectorData x) const
overridevirtual

Return the local maximum value of the vector. \(\max_i x_i\).

Parameters
[in]xa vector

Implements AMP::LinearAlgebra::VectorOperations.

◆ localMaxNorm()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::localMaxNorm ( const AMP::LinearAlgebra::VectorData x) const
overridevirtual

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

Returns

\[\max_i |x_i|\]

Parameters
[in]xa vector

Implements AMP::LinearAlgebra::VectorOperations.

◆ localMin()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::localMin ( const AMP::LinearAlgebra::VectorData x) const
overridevirtual

Return the local minimum value of the vector. \(\min_i x_i\).

Parameters
[in]xa vector

Implements AMP::LinearAlgebra::VectorOperations.

◆ localMinQuotient()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::localMinQuotient ( const AMP::LinearAlgebra::VectorData x,
const AMP::LinearAlgebra::VectorData y 
) const
overridevirtual

Returns the local minimum of the quotient of two vectors:

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

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

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

Implements AMP::LinearAlgebra::VectorOperations.

◆ localSum()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::localSum ( const AMP::LinearAlgebra::VectorData x) const
overridevirtual

Return the local sum of the vector.

Implements AMP::LinearAlgebra::VectorOperations.

◆ localWrmsNorm()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::localWrmsNorm ( const AMP::LinearAlgebra::VectorData x,
const AMP::LinearAlgebra::VectorData y 
) const
overridevirtual

Return a weighted norm of a vector.

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

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

Implements AMP::LinearAlgebra::VectorOperations.

◆ localWrmsNormMask()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::localWrmsNormMask ( const AMP::LinearAlgebra::VectorData x,
const AMP::LinearAlgebra::VectorData mask,
const AMP::LinearAlgebra::VectorData y 
) const
overridevirtual

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} y^2_iy^2_i}{n}}\]

Implements AMP::LinearAlgebra::VectorOperations.

◆ max()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::max ( const VectorData x) const
overridevirtual

Return the maximum value of the vector. \(\max_i x_i\).

Parameters
[in]xa vector

Reimplemented from AMP::LinearAlgebra::VectorOperations.

◆ maxNorm()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::maxNorm ( const VectorData x) const
overridevirtual

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

Returns

\[\max_i |x_i|\]

Parameters
[in]xa vector

Reimplemented from AMP::LinearAlgebra::VectorOperations.

◆ mean()

Scalar AMP::LinearAlgebra::VectorOperations::mean ( const VectorData x) const
inherited

Return the mean of the values of the vector.

Parameters
[in]xa vector

◆ min()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
Scalar AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::min ( const VectorData x) const
overridevirtual

Return the minimum value of the vector. \(\min_i x_i\).

Parameters
[in]xa vector

Reimplemented from AMP::LinearAlgebra::VectorOperations.

◆ minQuotient()

virtual Scalar AMP::LinearAlgebra::VectorOperations::minQuotient ( const VectorData x,
const VectorData y 
) const
virtualinherited

◆ multiply()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::multiply ( const VectorData x,
const VectorData y,
VectorData z 
)
overridevirtual

Component-wise multiply one vector with another. For Vectors, \(z_i = x_i y_i\).

Parameters
[in]xInput vector x
[in]yInput vector y
[out]zOutput vector z

Implements AMP::LinearAlgebra::VectorOperations.

◆ reciprocal()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::reciprocal ( const VectorData x,
VectorData y 
)
overridevirtual

Set this to the component-wise reciprocal of a vector. \(y_i = 1/x_i\).

Parameters
xa vector
ya vector

Implements AMP::LinearAlgebra::VectorOperations.

◆ registerChildObjects()

virtual void AMP::LinearAlgebra::VectorOperations::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::VectorOperationsDefault< TYPE >, AMP::LinearAlgebra::VectorOperationsDefault< double >, AMP::LinearAlgebra::VectorOperationsDefault< PetscScalar >, and AMP::LinearAlgebra::MultiVectorOperations.

◆ scale() [1/2]

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::scale ( const Scalar alpha,
const VectorData x,
VectorData y 
)
overridevirtual

Set vector equal to scaled input. For Vectors, \(y_i = \alpha x_i\).

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

Implements AMP::LinearAlgebra::VectorOperations.

◆ scale() [2/2]

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::scale ( const Scalar alpha,
VectorData x 
)
overridevirtual

Scale a vector. For Vectors, \(x_i = \alpha x_i\).

Parameters
[in]alphaa scalar
[in,out]xa vector

Implements AMP::LinearAlgebra::VectorOperations.

◆ setMax()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::setMax ( const Scalar val,
VectorData x 
)
overridevirtual

modify vector to set \(x_i = max(x_i, val)\).

Parameters
[in]xa vector
[in]vala scalar

Implements AMP::LinearAlgebra::VectorOperations.

◆ setMin()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::setMin ( const Scalar val,
VectorData x 
)
overridevirtual

modify vector to set \(x_i = min(x_i, val)\).

Parameters
[in]xa vector
[in]vala scalar

Implements AMP::LinearAlgebra::VectorOperations.

◆ setRandomValues()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::setRandomValues ( VectorData x)
overridevirtual

Set data in this vector to random values.

Parameters
[out]xa vector

Implements AMP::LinearAlgebra::VectorOperations.

◆ setToScalar()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::setToScalar ( const Scalar alpha,
VectorData z 
)
overridevirtual

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

Parameters
[in]alphascalar value
[out]za vector

Implements AMP::LinearAlgebra::VectorOperations.

Referenced by AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::zero().

◆ subtract()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::subtract ( const VectorData x,
const VectorData y,
VectorData z 
)
overridevirtual

Subtracts one vector from another. For Vectors, \(z_i = x_i - y_i\).

Parameters
[in]xInput vector x
[in]yInput vector y
[out]zOutput vector z

Implements AMP::LinearAlgebra::VectorOperations.

◆ sum()

virtual Scalar AMP::LinearAlgebra::VectorOperations::sum ( const VectorData x) const
virtualinherited

Return the sum of the values of the vector.

Parameters
[in]xa vector

◆ VectorOpName()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
std::string AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::VectorOpName ( ) const
inlineoverridevirtual

Get the type name.

Implements AMP::LinearAlgebra::VectorOperations.

Definition at line 29 of file TpetraVectorOperations.h.

◆ writeRestart()

virtual void AMP::LinearAlgebra::VectorOperations::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::VectorOperationsDefault< TYPE >, AMP::LinearAlgebra::VectorOperationsDefault< double >, AMP::LinearAlgebra::VectorOperationsDefault< PetscScalar >, and AMP::LinearAlgebra::MultiVectorOperations.

◆ wrmsNorm()

virtual Scalar AMP::LinearAlgebra::VectorOperations::wrmsNorm ( const VectorData x,
const VectorData y 
) const
virtualinherited

◆ wrmsNormMask()

virtual Scalar AMP::LinearAlgebra::VectorOperations::wrmsNormMask ( const VectorData x,
const VectorData mask,
const VectorData y 
) const
virtualinherited

◆ zero()

template<typename ST = double, typename LO = int32_t, typename GO = int64_t, typename NT = Tpetra::Vector<>::node_type>
void AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::zero ( VectorData x)
inlineoverridevirtual

Set vector entries (including ghosts) to zero.

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

Implements AMP::LinearAlgebra::VectorOperations.

Definition at line 39 of file TpetraVectorOperations.h.

References AMP::LinearAlgebra::TpetraVectorOperations< ST, LO, GO, NT >::setToScalar().

Member Data Documentation

◆ d_hash

uint64_t AMP::LinearAlgebra::VectorOperations::d_hash = 0
protectedinherited

Definition at line 399 of file VectorOperations.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:43.
Comments on this page