GEOS
|
Wrapper class for hypre's ParVector. More...
#include <HypreVector.hpp>
Public Member Functions | |
HYPRE_ParVector const & | unwrapped () const |
Returns a pointer to the implementation. More... | |
Constructor/Destructor Methods | |
HypreVector () | |
Empty vector constructor. Create an empty (distributed) vector. | |
HypreVector (HypreVector const &src) | |
Copy constructor. More... | |
HypreVector (HypreVector &&src) noexcept | |
Move constructor. More... | |
HypreVector & | operator= (HypreVector const &src) |
Copy assignment. More... | |
HypreVector & | operator= (HypreVector &&src) noexcept |
Move assignment. More... | |
~HypreVector () | |
Destructor. | |
VectorBase interface | |
virtual bool | created () const override |
Query vector creation status. More... | |
virtual void | create (localIndex const localSize, MPI_Comm const &comm) override |
Create a vector based on local number of elements. More... | |
virtual void | close () override |
Close vector for modification. More... | |
virtual void | touch () override |
Notify the vector about external modification through direct data pointer. More... | |
virtual void | reset () override |
Reset the vector to default state. | |
virtual void | set (real64 const value) override |
Set all elements to a constant value. More... | |
virtual void | rand (unsigned const seed) override |
Set vector elements to random entries. More... | |
virtual void | scale (real64 const scalingFactor) override |
Multiply all elements by factor. More... | |
virtual void | reciprocal () override |
Replace vector elements by their reciprocals. More... | |
virtual real64 | dot (HypreVector const &vec) const override |
Dot product with the vector vec. More... | |
virtual void | copy (HypreVector const &x) override |
Update vector y as y = x . More... | |
virtual void | axpy (real64 const alpha, HypreVector const &x) override |
Update vector y as y = alpha*x + y . More... | |
virtual void | axpby (real64 const alpha, HypreVector const &x, real64 const beta) override |
Update vector y as y = alpha*x + beta*y . More... | |
virtual void | pointwiseProduct (HypreVector const &x, HypreVector &y) const override |
Compute the component-wise multiplication y = v * x . More... | |
virtual real64 | norm1 () const override |
1-norm of the vector. More... | |
virtual real64 | norm2 () const override |
2-norm of the vector. More... | |
virtual real64 | normInf () const override |
Infinity-norm of the vector. More... | |
virtual globalIndex | globalSize () const override |
Returns the global of the vector. More... | |
virtual localIndex | localSize () const override |
Returns the local size of the vector. More... | |
virtual globalIndex | ilower () const override |
Get lower bound of local partition. More... | |
virtual globalIndex | iupper () const override |
Get upper bound of local partition. More... | |
virtual MPI_Comm | comm () const override |
Get the communicator used by this vector. More... | |
virtual void | print (std::ostream &os=std::cout) const override |
Print the vector in Trilinos format to the terminal. More... | |
virtual void | write (string const &filename, LAIOutputFormat const format=LAIOutputFormat::MATRIX_MARKET) const override |
Write the vector to a file. More... | |
void | setName (string const &name) |
Set a name for the vector (mainly used during various logging). More... | |
bool | closed () const |
Query vector closed status. More... | |
bool | ready () const |
Query vector ready status. More... | |
virtual arrayView1d< real64 > | open () |
Open the vector for modifying entries. More... | |
virtual void | zero () |
Set vector elements to zero. | |
arrayView1d< real64 const > | values () const |
Wrapper class for hypre's ParVector.
This class creates and provides basic support for the HYPRE_ParVector object type used in Hypre using the linear-algebraic system interface (IJ interface).
Definition at line 50 of file HypreVector.hpp.
geos::HypreVector::HypreVector | ( | HypreVector const & | src | ) |
Copy constructor.
src | vector to be copied |
|
noexcept |
Move constructor.
src | vector to be moved |
|
overridevirtual |
Update vector y
as y
= alpha*x + beta*y
.
alpha | scaling factor for added vector |
x | vector to add |
beta | scaling factor for self vector |
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Update vector y
as y
= alpha*x + y
.
alpha | scaling factor for added vector |
x | vector to add |
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Close vector for modification.
After calling this method, the view obtained via open() should not be used.
Implements geos::VectorBase< HypreVector >.
|
inline |
Query vector closed status.
true
if vector has been opened and has not been closed since; false
otherwise Definition at line 64 of file VectorBase.hpp.
|
overridevirtual |
Get the communicator used by this vector.
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Update vector y
as y
= x
.
x | vector to copy |
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Create a vector based on local number of elements.
localSize | local number of elements |
comm | MPI communicator to use |
Create a vector based on local number of elements. Global size is the sum across processors.
Reimplemented from geos::VectorBase< HypreVector >.
|
overridevirtual |
Query vector creation status.
true
if vector has been created Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Dot product with the vector vec.
vec | vector to dot-product with |
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Returns the global of the vector.
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Get lower bound of local partition.
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Get upper bound of local partition.
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Returns the local size of the vector.
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
inlinevirtual |
Open the vector for modifying entries.
Reimplemented from geos::VectorBase< HypreVector >.
Definition at line 129 of file VectorBase.hpp.
|
noexcept |
HypreVector& geos::HypreVector::operator= | ( | HypreVector const & | src | ) |
|
overridevirtual |
Compute the component-wise multiplication y
= v * x
.
x | first vector (input) |
y | second vector (output) |
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Print the vector in Trilinos format to the terminal.
os | the output stream to print to |
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Set vector elements to random entries.
seed | the random number seed to use |
Implements geos::VectorBase< HypreVector >.
|
inline |
Query vector ready status.
true
if vector has been created and is currently closed Definition at line 76 of file VectorBase.hpp.
|
overridevirtual |
Replace vector elements by their reciprocals.
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Multiply all elements by factor.
factor | scaling factor |
Implements geos::VectorBase< HypreVector >.
|
overridevirtual |
Set all elements to a constant value.
value | value to set vector elements to |
Implements geos::VectorBase< HypreVector >.
|
inline |
Set a name for the vector (mainly used during various logging).
name | the name |
Definition at line 113 of file VectorBase.hpp.
|
overridevirtual |
Notify the vector about external modification through direct data pointer.
This method MUST be called after any changes to vector values performed through direct pointer access, so that the underlying Array object can be made aware of external changes in a specific memory space.
Implements geos::VectorBase< HypreVector >.
HYPRE_ParVector const& geos::HypreVector::unwrapped | ( | ) | const |
Returns a pointer to the implementation.
|
inline |
Definition at line 305 of file VectorBase.hpp.
|
overridevirtual |
Write the vector to a file.
filename | name of the output file | |
[in] | format | output format |
Implements geos::VectorBase< HypreVector >.