A class that can provide a Sundials N_Vector view of an AMP Vector. More...
#include <ManagedSundialsVector.h>

Public Types | |
| typedef std::shared_ptr< const Vector > | const_shared_ptr |
| typedef std::shared_ptr< Vector > | shared_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< TYPE > | begin () |
| Return an iterator to the beginning of the data. | |
| template<class TYPE = double> | |
| VectorDataIterator< const TYPE > | begin () const |
| Return an iterator to the beginning of the data. | |
| std::shared_ptr< Vector > | clone () const |
| Allocate space in the same fashion as this | |
| std::shared_ptr< Vector > | clone (const std::shared_ptr< Variable > name) const |
| Allocate space in the same fashion as this | |
| std::shared_ptr< Vector > | clone (const std::string &name) const |
| Allocate space in the same fashion as this | |
| std::shared_ptr< VectorData > | cloneData () const |
| template<class TYPE = double> | |
| VectorDataIterator< const TYPE > | constBegin () const |
| Return an iterator to the beginning of the data. | |
| template<class TYPE = double> | |
| VectorDataIterator< const TYPE > | constEnd () 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 | 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< TYPE > | end () |
| Return an iterator to the end of the data. | |
| template<class TYPE = double> | |
| VectorDataIterator< const TYPE > | end () 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_MPI & | getComm () const |
| std::shared_ptr< CommunicationList > | getCommunicationList () const |
| Get the CommunicationList for this Vector. | |
| uint64_t | getDataID () const |
| std::shared_ptr< AMP::Discretization::DOFManager > | getDOFManager () 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 Vector > | getManagedVec () const override |
| std::shared_ptr< Vector > | getManagedVec () override |
| AMP::Utilities::MemoryType | getMemoryLocation () const |
| returns the memory location for data | |
| std::string | getName () const |
| Return the vector name. | |
| N_Vector & | getNativeVec () |
| const N_Vector & | getNativeVec () const |
| size_t | getNumberOfComponents () const |
| Return integer number of patch data components in vector. | |
| N_Vector & | getNVector () |
| Obtain a Sundials N_Vector for use in Sundials routines. | |
| const N_Vector & | getNVector () const |
| Obtain a Sundials N_Vector for use in Sundials routines. | |
| template<class TYPE > | |
| void | getRawData (TYPE *buf) const |
| template<typename RETURN_TYPE > | |
| RETURN_TYPE * | getRawDataBlock (size_t i=0) |
| Obtain a particular contiguous block of data cast to RETURN_TYPE. | |
| template<typename RETURN_TYPE > | |
| const RETURN_TYPE * | getRawDataBlock (size_t i=0) const |
| Obtain a particular contiguous block of data cast to RETURN_TYPE. | |
| void * | getRawDataBlockAsVoid (size_t i) |
| const void * | getRawDataBlockAsVoid (size_t i) const |
| auto & | getUnits () 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< Variable > | getVariable () |
| Get the variable associated with this vector. | |
| const std::shared_ptr< Variable > | getVariable () const |
| Get the variable associated with this vector. | |
| std::shared_ptr< VectorData > | getVectorData () |
| Return the pointer to the VectorData. | |
| std::shared_ptr< const VectorData > | getVectorData () const |
| Return the pointer to the VectorData. | |
| std::shared_ptr< VectorOperations > | getVectorOperations () |
| Return the pointer to the VectorOperation. | |
| std::shared_ptr< const VectorOperations > | getVectorOperations () const |
| Return the pointer to the VectorOperation. | |
| template<typename VIEW_TYPE > | |
| std::shared_ptr< VIEW_TYPE > | getView () 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, Scalar > | L2NormAndDot (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) |
| ManagedSundialsVector (shared_ptr alias) | |
| Create a view to an AMP 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< Vector > | rawClone () 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< Vector > | shared_from_this () |
| std::shared_ptr< const Vector > | shared_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 | ~ManagedSundialsVector () |
| Destructor. | |
Static Public Member Functions | |
| static std::shared_ptr< const SundialsVector > | constView (Vector::const_shared_ptr AmpVector) |
| If needed, create a Sundials wrapper for AmpVector. Otherwise, return AmpVector. | |
| static std::shared_ptr< SundialsVector > | view (Vector::shared_ptr AmpVector) |
| If needed, create a Sundials wrapper for AmpVector. Otherwise, return AmpVector. | |
Protected Attributes | |
| std::shared_ptr< AMP::Discretization::DOFManager > | d_DOFManager |
| N_Vector | d_n_vector |
| Sundials NVector wrapping the data in the Vector. | |
| AMP::Units | d_units |
| std::shared_ptr< Variable > | d_Variable |
| std::shared_ptr< VectorData > | d_VectorData |
| std::shared_ptr< VectorOperations > | d_VectorOps |
| std::shared_ptr< std::vector< std::any > > | d_Views |
| std::weak_ptr< Vector > | weak_ptr_ |
Private Member Functions | |
| ManagedSundialsVector (const ManagedSundialsVector &) | |
| void | operator= (const ManagedSundialsVector &) |
A class that can provide a Sundials N_Vector view of an AMP Vector.
This class should not be used explicitly. It is the return type of SundialsVector::view() and SundialsVector::constView().
Definition at line 24 of file ManagedSundialsVector.h.
|
inherited |
|
inherited |
|
explicit |
|
virtual |
Destructor.
|
explicitprivate |
Set this to the component-wise absolute value of a vector. \(\mathit{this}_i = |x_i|\).
| [in] | x | a vector |
|
staticprivate |
Adds two vectors. For Vectors, \(\mathit{this}_i = x_i + y_i\).
| [in] | x | Input vector x |
| [in] | y | Input vector y |
|
inlineinherited |
Definition at line 728 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
set vector to \(x + \alpha \bar{1}\).
| [in] | x | a vector |
| [in] | alpha | a scalar |
for vectors, \(\mathit{this}_i = x_i + \alpha\).
|
staticprivate |
|
inlineinherited |
Definition at line 738 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Definition at line 672 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inherited |
Set this vector alpha * x + this. \(\mathit{this}_i = \alpha x_i + \beta \mathit{this}_i \).
| [in] | alpha | a scalar |
| [in] | beta | a scalar |
| [in] | x | a vector |
|
inherited |
Set this vector to alpha * x + y. \(\mathit{this}_i = \alpha x_i + y_i\).
| [in] | alpha | a scalar |
| [in] | x | a vector |
| [in] | y | a vector |
|
inlineinherited |
Return an iterator to the beginning of the data.
Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.
Definition at line 572 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Return an iterator to the beginning of the data.
Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.
Definition at line 579 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inherited |
|
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.
| [in] | name | The variable to associate with the new vector |
|
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.
| [in] | name | Name to give the variable associated with this vector |
|
inlineinherited |
Definition at line 696 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
staticprivate |
|
staticprivate |
|
inlineinherited |
Return an iterator to the beginning of the data.
Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.
Definition at line 586 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Return an iterator to the end of the data.
Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.
Definition at line 616 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
staticprivate |
|
staticinherited |
If needed, create a Sundials 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.
| AmpVector | a shared pointer to a Vector |
Definition at line 758 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Set vector equal to x For Vectors, \(\mathit{this}_i = x_i\).
| [in] | x | a vector |
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.
| [in] | x | a vector |
|
inlinevirtualinherited |
Definition at line 134 of file Vector.h.
References AMP_ASSERT, AMP::LinearAlgebra::Vector::d_VectorData, and AMP::LinearAlgebra::Vector::d_VectorOps.
|
staticprivate |
|
inlineinherited |
Definition at line 719 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Component-wise divide one vector by another. For Vectors, \(\mathit{this}_i = x_i / y_i\).
| [in] | x | Input vector x |
| [in] | y | Input vector y |
|
staticprivate |
Return the dot product of this vector with the argument vector.
Returns
\[\sum_i x_i\mathit{this}_i\]
| [in] | x | a vector |
|
staticprivate |
|
inlineinherited |
Definition at line 767 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Definition at line 763 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Return an iterator to the end of the data.
Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.
Definition at line 602 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Return an iterator to the end of the data.
Since the Vector presents an interface to a contiguous block of data, it is natural for it to provide a random access iterator.
Definition at line 609 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inherited |
Check if two vectors are equal.
Returns true if each vaue is within tol of the corresponding vaue in the other vector
| [in] | x | a vector |
| [in] | tol | tolerance to use |
|
staticprivate |
|
staticprivate |
Definition at line 646 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Get the CommunicationList for this Vector.
Definition at line 711 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Definition at line 676 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Get the DOFManager for this Vector.
|
inlineinherited |
Definition at line 721 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Return a ghost value from the vector.
| [in] | i | The global index into the vector |
This uses getGhostValuesByGlobalID to get the value
|
inlineinherited |
Definition at line 748 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Referenced by AMP::Solver::AMG::csr_view< LinearAlgebra::CSRMatrix< Config > >::getGhostValues().
|
inlineinherited |
Definition at line 664 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inherited |
Get a unique id hash for the vector.
|
inlineinherited |
Definition at line 663 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Definition at line 665 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Return a local value from the vector.
| [in] | i | The global index into the vector |
This uses getValuesByGlobalID to get the value
|
inlineoverridevirtual |
Implements AMP::LinearAlgebra::SundialsVector.
Definition at line 43 of file ManagedSundialsVector.h.
References AMP::enable_shared_from_this< Vector >::shared_from_this().
|
inlineoverridevirtual |
Implements AMP::LinearAlgebra::SundialsVector.
Definition at line 42 of file ManagedSundialsVector.h.
References AMP::enable_shared_from_this< Vector >::shared_from_this().
|
inlineinherited |
returns the memory location for data
Definition at line 779 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inherited |
Return the vector name.
|
inlineinherited |
Definition at line 113 of file SundialsVector.h.
References AMP::LinearAlgebra::SundialsVector::getNVector().
Definition at line 114 of file SundialsVector.h.
References AMP::LinearAlgebra::SundialsVector::getNVector().
|
inherited |
Return integer number of patch data components in vector.
|
inherited |
Obtain a Sundials N_Vector for use in Sundials routines.
This function is used to get a Sundials vector. The following idiom should be used since it fails gracefully. In this function, a view may be created before the NVector is extracted.
Referenced by AMP::LinearAlgebra::SundialsVector::getNativeVec(), and AMP::LinearAlgebra::SundialsVector::getNativeVec().
Obtain a Sundials N_Vector for use in Sundials routines.
This function is used to get a Sundials vector. The following idiom should be used since it fails gracefully. In this function, a view may be created before the NVector is extracted.
Definition at line 659 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Obtain a particular contiguous block of data cast to RETURN_TYPE.
| RETURN_TYPE | The pointer type of the return |
| [in] | i | Which block |
Definition at line 627 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Obtain a particular contiguous block of data cast to RETURN_TYPE.
| RETURN_TYPE | The pointer type of the return |
| [in] | i | Which block |
Definition at line 638 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Definition at line 677 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Definition at line 681 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Get the units for this Vector.
Definition at line 403 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_units.
|
inlineinherited |
Definition at line 697 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Return a value from the vector.
| [in] | i | The global index into the vector |
This uses getValuesByGlobalID to get the value
Return a local value from the vector.
| [in] | i | The global index into the vector |
This uses getValuesByGlobalID to get the value
|
inlineinherited |
Definition at line 743 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Definition at line 753 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inherited |
|
inlineinherited |
Return the pointer to the VectorData.
Definition at line 412 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Return the pointer to the VectorData.
Definition at line 415 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Return the pointer to the VectorOperation.
Definition at line 418 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorOps.
|
inlineinherited |
Return the pointer to the VectorOperation.
Definition at line 421 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorOps.
|
inherited |
If a particular type of view of this Vector has been created, return it.
| VIEW_TYPE | The type of view to look for |
|
inlineinherited |
Definition at line 645 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
If a particular type of view of this Vector has been created, return true.
| VIEW_TYPE | The type of view to look for |
|
staticprivate |
Definition at line 690 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData, and AMP::LinearAlgebra::Vector::type().
|
inherited |
Return discrete \( L_1 \) -norm of this vector.
Returns
\[\sum_i |\mathit{this}_i|\]
|
inherited |
Return discrete \( L_2 \) -norm of this vector.
Returns
\[\sqrt{\sum_i \mathit{this}_i^2}\]
|
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
| [in] | x | a vector |
|
inherited |
Set a vector to be a linear combination of two vectors. \(\mathit{this}_i = \alpha x_i + \beta y_i\).
| [in] | alpha | a scalar |
| [in] | x | a vector |
| [in] | beta | a scalar |
| [in] | y | a vector |
|
staticprivate |
|
inlineinherited |
Definition at line 705 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Definition at line 706 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inherited |
Return the maximum value of the vector. \(\max_i \mathit{this}_i\).
|
inherited |
Return the \( L_\infty \) -norm of this vector.
Returns
\[\max_i |\mathit{this}_i|\]
|
inherited |
Return the maximum value of the vector. \(\max_i \mathit{this}_i\).
|
inherited |
Return the minimum value of the vector. \(\min_i \mathit{this}_i\).
Returns the minimum of the quotient of two vectors:
\[\min_{i,y_i\neq0} x_i/\mathit{this}_i\]
| [in] | x | a vector |
\[\min_{i,y_i\neq0} x_i/\mathit{this}_i\]
|
staticprivate |
Component-wise multiply one vector with another. For Vectors, \(\mathit{this}_i = x_i y_i\).
| [in] | x | Input vector x |
| [in] | y | Input vector y |
|
staticprivate |
|
inlineinherited |
Definition at line 648 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Definition at line 654 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
overridevirtual |
Allocate space in the same fashion as this
This will allocate new space with identical layout as this.
Reimplemented from AMP::LinearAlgebra::Vector.
Set this to the component-wise reciprocal of a vector. \(\mathit{this}_i = 1/x_i\).
| x | a vector |
|
staticprivate |
|
virtualinherited |
Register any child objects.
This function will register child objects with the manager
| manager | Restart manager |
Reimplemented in AMP::LinearAlgebra::MultiVector.
Add a view of this vector to an internal queue.
| [in] | v | The view to add |
|
virtualinherited |
Renames.
Renames the vector and any components matching src to dst.
| [in] | src | The original variable name |
| [in] | dst | The new variable name |
Reset.
Reimplemented in AMP::LinearAlgebra::MultiVector.
Scale a vector. For Vectors, \(\mathit{this}_i = \alpha\mathit{this}_i\).
| [in] | alpha | a scalar |
Set vector equal to scaled input. For Vectors, \(\mathit{this}_i = \alpha x_i\).
| [in] | alpha | a scalar |
| [in] | x | a vector |
|
staticprivate |
|
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" );
| [in] | criterion | The method for deciding inclusion in the view |
|
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" );
| [in] | criterion | The method for deciding inclusion in the view |
|
virtualinherited |
Selects a portion of this vector and puts a view into a vector.
| [in] | criterion | The method for deciding inclusion in the view |
Reimplemented in AMP::LinearAlgebra::MultiVector.
|
virtualinherited |
Reimplemented in AMP::LinearAlgebra::MultiVector.
|
staticprivate |
|
inlineinherited |
Definition at line 715 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Definition at line 723 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
modify vector to have max value 'val' specified
modify vector to have min value 'val' specified
|
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.
|
inherited |
Set data in this vector to random values on [0,1).
Set all compenents of a vector to a scalar. For Vectors, the components of this are set to \(\alpha\).
| [in] | alpha | scalar value |
|
staticprivate |
|
virtualinherited |
Get the units for this Vector.
|
inlineinherited |
Definition at line 701 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Set a value in the vector.
| [in] | i | The global index into the vector |
| [in] | v | The value to set |
This uses setValuesByGlobalID to set the value
|
inlineinherited |
Definition at line 733 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inlineinherited |
Definition at line 667 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Change the variable associated with this vector.
| [in] | name | The new variable |
|
inlineinherited |
Definition at line 28 of file enable_shared_from_this.h.
|
inlineinherited |
Definition at line 46 of file enable_shared_from_this.h.
Definition at line 649 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Definition at line 685 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
inherited |
Retrieve ith subvector.
Returns the ith subvector based on teh number of components.
| [in] | index | Index to retrieve |
|
inherited |
Retrieve ith subvector.
Returns the ith subvector based on teh number of components.
| [in] | index | Index to retrieve |
|
inherited |
Retrieve a sub-vector associated with a particular Variable.
| [in] | name | Variable by which to retrieve a subvector |
|
inherited |
Retrieve a sub-vector associated with a particular Variable.
| [in] | name | Variable by which to retrieve a subvector |
A null pointer will be returned if the vector does not contain a sub-vector associated with the Variable
|
inherited |
Retrieve a sub-vector associated with a particular Variable.
| [in] | var | Variable by which to retrieve a subvector |
A null pointer will be returned if the vector does not contain a sub-vector associated with the Variable
|
inherited |
Retrieve a sub-vector associated with a particular Variable.
| [in] | var | Variable by which to retrieve a subvector |
A null pointer will be returned if the vector does not contain a sub-vector associated with the Variable
Subtracts one vector from another. For Vectors, \(\mathit{this}_i = x_i - y_i\).
| [in] | x | Input vector x |
| [in] | y | Input vector y |
|
inherited |
Return the maximum value of the vector. \(\max_i \mathit{this}_i\).
|
inlineinherited |
Definition at line 695 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
Swap the data in this Vector for another.
| [in] | other | Vector to swap data with |
Effectively, this is
without a and b exchanging pointers.
Reimplemented from AMP::LinearAlgebra::Vector.
|
inherited |
|
overridevirtual |
Return the name of the vector.
Reimplemented from AMP::LinearAlgebra::Vector.
|
inlineinherited |
Definition at line 647 of file Vector.h.
References AMP::LinearAlgebra::Vector::d_VectorData.
|
staticinherited |
If needed, create a Sundials 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.
| AmpVector | a shared pointer to a Vector |
|
staticprivate |
Write restart data to file.
This function will write the mesh to an HDF5 file
| fid | File identifier to write |
Reimplemented in AMP::LinearAlgebra::MultiVector.
Return a weighted norm of a vector.
| [in] | x | a vector |
| [in] | y | a vector |
\[\sqrt{\frac{\displaystyle \sum_i x^2_iy^2_i}{n}}\]
|
staticprivate |
|
inherited |
Return a weighted norm of a subset of a vector.
| [in] | x | a vector |
| [in] | y | a vector |
| [in] | mask | a vector |
\[\sqrt{\frac{\displaystyle \sum_{i,\mathit{mask}_i>0} x^2_iy^2_i}{n}}\]
|
staticprivate |
|
inherited |
Set vector entries (including ghosts) to zero.
This is equivalent (but more efficient) to calling setToScalar ( 0.0 ) followed by a makeConsistent(SET)
|
protectedinherited |
|
protectedinherited |
Sundials NVector wrapping the data in the Vector.
However this is created, the N_Vector holds a pointer to the data used in the Vector in such a manner that is consistent with Sundials.
Definition at line 45 of file SundialsVector.h.
|
protectedinherited |
Definition at line 863 of file Vector.h.
Referenced by AMP::LinearAlgebra::Vector::getUnits().
|
protectedinherited |
|
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().
|
protectedinherited |
Definition at line 867 of file Vector.h.
Referenced by AMP::LinearAlgebra::Vector::copyVector(), AMP::LinearAlgebra::Vector::getVectorOperations(), and AMP::LinearAlgebra::Vector::getVectorOperations().
|
protectedinherited |
|
mutableprotectedinherited |
Definition at line 69 of file enable_shared_from_this.h.
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:42. Comments on this page |