GEOS
|
This class creates and provides basic support for Vec vector object type used in PETSc. More...
#include <PetscVector.hpp>
Public Member Functions | |
const Vec & | unwrapped () const |
Returns a const pointer to the underlying Vec. More... | |
Vec & | unwrapped () |
Returns a non-const pointer to the underlying Vec. More... | |
Constructor/Destructor Methods | |
PetscVector () | |
Empty vector constructor. | |
PetscVector (PetscVector const &src) | |
Copy constructor. More... | |
PetscVector (PetscVector &&src) noexcept | |
Move constructor. More... | |
PetscVector & | operator= (PetscVector const &src) |
Copy assignment. More... | |
PetscVector & | operator= (PetscVector &&src) noexcept |
Move assignment. More... | |
~PetscVector () | |
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 (PetscVector const &vec) const override |
Dot product with the vector vec. More... | |
virtual void | copy (PetscVector const &x) override |
Update vector y as y = x . More... | |
virtual void | axpy (real64 const alpha, PetscVector const &x) override |
Update vector y as y = alpha*x + y . More... | |
virtual void | axpby (real64 const alpha, PetscVector const &x, real64 const beta) override |
Update vector y as y = alpha*x + beta*y . More... | |
virtual void | pointwiseProduct (PetscVector const &x, PetscVector &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 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... | |
virtual MPI_Comm | comm () const override |
Get the communicator used by this vector. 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 |
This class creates and provides basic support for Vec vector object type used in PETSc.
Definition at line 45 of file PetscVector.hpp.
geos::PetscVector::PetscVector | ( | PetscVector const & | src | ) |
Copy constructor.
src | PetscVector to be copied. |
|
noexcept |
Move constructor.
src | PetscVector to move from |
|
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< PetscVector >.
|
overridevirtual |
Update vector y
as y
= alpha*x + y
.
alpha | scaling factor for added vector |
x | vector to add |
Implements geos::VectorBase< PetscVector >.
|
overridevirtual |
Close vector for modification.
After calling this method, the view obtained via open() should not be used.
Implements geos::VectorBase< PetscVector >.
|
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< PetscVector >.
|
overridevirtual |
Update vector y
as y
= x
.
x | vector to copy |
Implements geos::VectorBase< PetscVector >.
|
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< PetscVector >.
|
overridevirtual |
Query vector creation status.
true
if vector has been created Implements geos::VectorBase< PetscVector >.
|
overridevirtual |
Dot product with the vector vec.
vec | vector to dot-product with |
Implements geos::VectorBase< PetscVector >.
|
overridevirtual |
Returns the global of the vector.
Implements geos::VectorBase< PetscVector >.
|
overridevirtual |
Get lower bound of local partition.
Implements geos::VectorBase< PetscVector >.
|
overridevirtual |
Get upper bound of local partition.
Implements geos::VectorBase< PetscVector >.
|
overridevirtual |
Returns the local size of the vector.
Implements geos::VectorBase< PetscVector >.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
inlinevirtual |
Open the vector for modifying entries.
Reimplemented from geos::VectorBase< PetscVector >.
Definition at line 129 of file VectorBase.hpp.
|
noexcept |
PetscVector& geos::PetscVector::operator= | ( | PetscVector const & | src | ) |
|
overridevirtual |
Compute the component-wise multiplication y
= v * x
.
x | first vector (input) |
y | second vector (output) |
Implements geos::VectorBase< PetscVector >.
|
overridevirtual |
Print the vector in Trilinos format to the terminal.
os | the output stream to print to |
Implements geos::VectorBase< PetscVector >.
|
overridevirtual |
Set vector elements to random entries.
seed | the random number seed to use |
Implements geos::VectorBase< PetscVector >.
|
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< PetscVector >.
|
overridevirtual |
Multiply all elements by factor.
factor | scaling factor |
Implements geos::VectorBase< PetscVector >.
|
overridevirtual |
Set all elements to a constant value.
value | value to set vector elements to |
Implements geos::VectorBase< PetscVector >.
|
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< PetscVector >.
Vec& geos::PetscVector::unwrapped | ( | ) |
Returns a non-const pointer to the underlying Vec.
const Vec& geos::PetscVector::unwrapped | ( | ) | const |
Returns a const pointer to the underlying Vec.
|
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< PetscVector >.