![]() |
Documentation 6b54b78464
|
Class for holding and manipulating vectors needed by linear solvers. More...
#include <CSysVector.hpp>
Public Member Functions | |
| CSysVector ()=default | |
| Required by CVecExpr. | |
| ~CSysVector () | |
| Destructor. | |
| CSysVector (unsigned long size, ScalarType val=0.0) | |
| Construct from size and value. | |
| CSysVector (unsigned long numBlk, unsigned long numBlkDomain, unsigned long numVar, ScalarType val=0.0) | |
| Construct from size and value (block version). | |
| CSysVector (unsigned long size, const ScalarType *u_array) | |
| Construct from array. | |
| CSysVector (unsigned long numBlk, unsigned long numBlkDomain, unsigned long numVar, const ScalarType *u_array) | |
| Constructor from array (block version). | |
| CSysVector (const CSysVector &u) | |
| Copy constructor of the class. | |
| void | swap (CSysVector &other) |
| Swap contents with another vector. | |
| void | Initialize (unsigned long numBlk, unsigned long numBlkDomain, unsigned long numVar, ScalarType val=0.0) |
| Initialize the class with a scalar. | |
| void | Initialize (unsigned long numBlk, unsigned long numBlkDomain, unsigned long numVar, const ScalarType *ptr) |
| Initialize the class with an array. | |
| template<class T > | |
| void | PassiveCopy (const CSysVector< T > &other) |
| Set our values (resizing if required) by copying from other, the derivative information is lost. | |
| void | HtDTransfer (bool trigger=true) const |
| Performs the memory copy from host to device. | |
| void | DtHTransfer (bool trigger=true) const |
| Performs the memory copy from device to host. | |
| ScalarType * | GetDevicePointer () const |
| return device pointer that points to the CSysVector values in GPU memory | |
| const ScalarType * | GetHostPointer () const |
| return host pointer that points to the CSysVector values, counterpart of GetDevicePointer | |
| unsigned long | GetLocSize () const |
| return the number of local elements in the CSysVector | |
| unsigned long | GetNElmDomain () const |
| return the number of local elements in the CSysVector without ghost cells | |
| unsigned long | GetNVar () const |
| return the number of variables at each block (typically number per node) | |
| unsigned long | GetNBlk () const |
| return the number of blocks (typically number of nodes locally) | |
| unsigned long | GetNBlkDomain () const |
| return the number of blocks (typically number of nodes locally) | |
| ScalarType & | operator[] (unsigned long i) |
| Access operator with assignment permitted. | |
| const ScalarType & | operator[] (unsigned long i) const |
| const ScalarType * | begin () const |
| Iterators for range for loops. | |
| const ScalarType * | end () const |
| ScalarType & | operator() (unsigned long iPoint, unsigned long iVar) |
| Access operator with assignment permitted block version. | |
| const ScalarType & | operator() (unsigned long iPoint, unsigned long iVar) const |
| CSysVector & | operator= (const CSysVector &other) |
| Assignment operator from another vector. | |
| CSysVector & | operator= (ScalarType val) |
| template<class T > | |
| CSysVector & | operator= (const VecExpr::CVecExpr< T, ScalarType > &expr) |
| CSysVector & | operator+= (ScalarType val) |
| template<class T > | |
| CSysVector & | operator+= (const VecExpr::CVecExpr< T, ScalarType > &expr) |
| CSysVector & | operator-= (ScalarType val) |
| template<class T > | |
| CSysVector & | operator-= (const VecExpr::CVecExpr< T, ScalarType > &expr) |
| CSysVector & | operator*= (ScalarType val) |
| template<class T > | |
| CSysVector & | operator*= (const VecExpr::CVecExpr< T, ScalarType > &expr) |
| CSysVector & | operator/= (ScalarType val) |
| template<class T > | |
| CSysVector & | operator/= (const VecExpr::CVecExpr< T, ScalarType > &expr) |
| void | SetValZero (void) |
| Sets to zero all the entries of the vector. | |
| template<class T > | |
| ScalarType | dot (const VecExpr::CVecExpr< T, ScalarType > &expr) const |
| Dot product between "this" and an expression. | |
| ScalarType | squaredNorm () const |
| Squared L2 norm of the vector (via dot with self). | |
| ScalarType | norm () const |
| L2 norm of the vector. | |
| ScalarType * | GetBlock (unsigned long iPoint) |
| Get pointer to a block. | |
| const ScalarType * | GetBlock (unsigned long iPoint) const |
| void | SetBlock_Zero (unsigned long iPoint) |
| Set the values to zero for one block. | |
| template<class VectorType , bool Overwrite = true> | |
| void | SetBlock (unsigned long iPoint, const VectorType &block, ScalarType alpha=1) |
| Set "block" to the vector. | |
| template<class VectorType > | |
| void | AddBlock (unsigned long iPoint, const VectorType &block, ScalarType alpha=1) |
| Add "block" to the vector, see SetBlock. | |
| template<class VectorType > | |
| void | SubtractBlock (unsigned long iPoint, const VectorType &block) |
| Subtract "block" from the vector, see AddBlock. | |
| template<class VectorType > | |
| void | UpdateBlocks (unsigned long iPoint, unsigned long jPoint, const VectorType &block, ScalarType alpha=1) |
| Add to iPoint, subtract from jPoint. | |
| template<size_t N, class T , class VecTypeSIMD , class F = ScalarType> | |
| void | SetBlock (simd::Array< T, N > iPoint, const VecTypeSIMD &vector, simd::Array< F, N > mask=1) |
| Vectorized version of SetBlock, sets multiple iPoint's. | |
| template<size_t N, class T , class VecTypeSIMD , class F = ScalarType> | |
| void | UpdateBlocks (simd::Array< T, N > iPoint, simd::Array< T, N > jPoint, const VecTypeSIMD &vector, simd::Array< F, N > mask=1) |
| Vectorized version of UpdateBlocks, updates multiple i/jPoint's. | |
Public Member Functions inherited from VecExpr::CVecExpr< CSysVector< ScalarType >, ScalarType > | |
| const CSysVector< ScalarType > & | derived () const |
| Cast the expression to Derived, usually to allow evaluation via operator[]. | |
Static Public Member Functions | |
| static const su2matrix< ScalarType > & | multiDot (const std::vector< CSysVector > &V, size_t i0, size_t n, const std::vector< CSysVector > &W, size_t m) |
| Computes the product of V^T W efficiencly, where V and W are tall matrices stored as vectors of CSysVector. | |
Static Public Attributes | |
| static constexpr bool | StoreAsRef = true |
Related Symbols | |
(Note that these are not member symbols.) | |
| Squared | norm |
Class for holding and manipulating vectors needed by linear solvers.
|
default |
Required by CVecExpr.
Default constructor of the class.
| CSysVector< ScalarType >::~CSysVector | ( | ) |
Destructor.
|
inlineexplicit |
Construct from size and value.
| [in] | size | - Number of elements locally. |
| [in] | val | - Default value for elements. |
|
inline |
Construct from size and value (block version).
| [in] | numBlk | - Number of blocks locally. |
| [in] | numBlkDomain | - Number of blocks locally (without ghost cells). |
| [in] | numVar | - Number of variables in each block. |
| [in] | val | - Default value for elements. |
|
inline |
Construct from array.
| [in] | size | - Number of elements locally. |
| [in] | u_array | - Vector stored as array being copied. |
|
inline |
Constructor from array (block version).
| [in] | numBlk | - number of blocks locally |
| [in] | numBlkDomain | - number of blocks locally (without g cells) |
| [in] | numVar | - number of variables in each block |
| [in] | u_array | - vector stored as array being copied |
|
inline |
Copy constructor of the class.
| [in] | u | - Vector being copied. |
|
inline |
Add "block" to the vector, see SetBlock.
|
inline |
Iterators for range for loops.
|
inline |
Dot product between "this" and an expression.
| [in] | expr | - Expression. |
| void CSysVector< ScalarType >::DtHTransfer | ( | bool | trigger = true | ) | const |
Performs the memory copy from device to host.
| [in] | trigger | - boolean value that decides whether to conduct the transfer or not. True by default. |
|
inline |
|
inline |
Get pointer to a block.
| [in] | iPoint | - Index of block. |
|
inline |
|
inline |
return device pointer that points to the CSysVector values in GPU memory
|
inline |
return host pointer that points to the CSysVector values, counterpart of GetDevicePointer
|
inline |
return the number of local elements in the CSysVector
|
inline |
return the number of blocks (typically number of nodes locally)
|
inline |
return the number of blocks (typically number of nodes locally)
|
inline |
return the number of local elements in the CSysVector without ghost cells
|
inline |
return the number of variables at each block (typically number per node)
| void CSysVector< ScalarType >::HtDTransfer | ( | bool | trigger = true | ) | const |
Performs the memory copy from host to device.
| [in] | trigger | - boolean value that decides whether to conduct the transfer or not. True by default. |
|
inline |
Initialize the class with an array.
| [in] | numBlk | - number of blocks locally |
| [in] | numBlkDomain | - number of blocks locally (without g cells) |
| [in] | numVar | - number of variables in each block |
| [in] | ptr | - pointer to data with which to initialize the vector |
|
inline |
Initialize the class with a scalar.
| [in] | numBlk | - number of blocks locally |
| [in] | numBlkDomain | - number of blocks locally (without g cells) |
| [in] | numVar | - number of variables in each block |
| [in] | val | - default value for elements |
|
static |
Computes the product of V^T W efficiencly, where V and W are tall matrices stored as vectors of CSysVector.
| [in] | V | - Tall matrix. |
| [in] | i0 | - First column of V to consider. |
| [in] | n | - Number of columns to consider from V starting at i0. |
| [in] | W | - Tall matrix. |
| [in] | m | - Number of columns to consider from W. |
|
inline |
L2 norm of the vector.
|
inline |
Access operator with assignment permitted block version.
| [in] | iPoint | - Index of block. |
| [in] | iVar | - Index of variable. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Assignment operator from another vector.
| [in] | other | - Another vector. |
|
inline |
|
inline |
|
inline |
Access operator with assignment permitted.
| [in] | i | - Local index to access. |
|
inline |
|
inline |
Set our values (resizing if required) by copying from other, the derivative information is lost.
| [in] | other | - source CSysVector |
|
inline |
Vectorized version of SetBlock, sets multiple iPoint's.
| [in] | iPoint | - SIMD integer, the positions to update. |
| [in] | vector | - Vector of SIMD scalars. |
| [in] | mask | - Optional scale factor (axpy type operation). |
|
inline |
Set "block" to the vector.
| [in] | iPoint | - index of the point where set the residual. |
| [in] | block | - Value to set to the residual. |
| [in] | alpha | - Scale factor (axpy-type operation). |
|
inline |
Set the values to zero for one block.
| [in] | iPoint | - Index of the block being set to zero. |
|
inline |
Sets to zero all the entries of the vector.
|
inline |
Squared L2 norm of the vector (via dot with self).
|
inline |
Subtract "block" from the vector, see AddBlock.
|
inline |
Swap contents with another vector.
|
inline |
Vectorized version of UpdateBlocks, updates multiple i/jPoint's.
|
inline |
Add to iPoint, subtract from jPoint.
|
related |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
staticconstexpr |