GEOSX
|
This class creates and provides basic support for the Epetra_FEVector vector object type used in Trilinos. We use the FE version because Epetra_Vector support for long globalIDs is haphazard. More...
#include <EpetraVector.hpp>
Public Member Functions | |
Epetra_FEVector const & | unwrapped () const |
Returns a const pointer to the underlying Epetra object. More... | |
Epetra_FEVector & | unwrapped () |
Returns a non-const pointer to the underlying Epetra object. More... | |
Constructor/Destructor Methods | |
EpetraVector () | |
Empty vector constructor. Create an empty (distributed) vector. | |
EpetraVector (EpetraVector const &src) | |
Copy constructor. More... | |
EpetraVector (EpetraVector &&src) noexcept | |
Move constructor. More... | |
EpetraVector & | operator= (EpetraVector const &src) |
Copy assignment. More... | |
EpetraVector & | operator= (EpetraVector &&src) noexcept |
Move assignment. More... | |
~EpetraVector () | |
Destructor. | |
VectorBase interface | |
virtual bool | created () const override |
Query vector creation status. More... | |
virtual void | createWithLocalSize (localIndex const localSize, MPI_Comm const &comm) override |
Create a vector based on local number of elements. More... | |
virtual void | createWithGlobalSize (globalIndex const globalSize, MPI_Comm const &comm) override |
Create a vector based on global number of elements. More... | |
virtual void | create (arrayView1d< real64 const > const &localValues, MPI_Comm const &comm) override |
Construct parallel vector from a local array. More... | |
virtual void | open () override |
Open the vector for modifying entries. | |
virtual void | close () override |
Assemble vector. More... | |
virtual void | reset () override |
Reset the matrix to default state. | |
virtual void | set (globalIndex const globalRowIndex, real64 const value) override |
Set vector value. More... | |
virtual void | add (globalIndex const globalRowIndex, real64 const value) override |
Add into vector value. More... | |
virtual void | set (globalIndex const *globalRowIndices, real64 const *values, localIndex size) override |
Set vector values. More... | |
virtual void | add (globalIndex const *globalRowIndices, real64 const *values, localIndex const size) override |
Add vector values. More... | |
virtual void | set (arraySlice1d< globalIndex const > const &globalRowIndices, arraySlice1d< real64 const > const &values) override |
Set vector values using array1d. More... | |
virtual void | add (arraySlice1d< globalIndex const > const &globalRowIndices, arraySlice1d< real64 const > const &values) override |
Add into vector values using array1d. More... | |
virtual void | set (real64 const value) override |
Set all elements to a constant value. More... | |
virtual void | zero () override |
Set vector elements to zero. | |
virtual void | rand (unsigned const seed=1984) override |
Set vector elements to random entries. More... | |
virtual void | scale (real64 const scalingFactor) override |
Multiply all elements by scalingFactor. More... | |
virtual void | reciprocal () override |
Replace vector elements by their reciprocals. More... | |
virtual real64 | dot (EpetraVector const &vec) const override |
Dot product with the vector vec. More... | |
virtual void | copy (EpetraVector const &x) override |
Update vector y as y = x . More... | |
virtual void | axpy (real64 const alpha, EpetraVector const &x) override |
Update vector y as y = alpha*x + y . More... | |
virtual void | axpby (real64 const alpha, EpetraVector const &x, real64 const beta) override |
Update vector y as y = alpha*x + beta*y . More... | |
virtual void | pointwiseProduct (EpetraVector const &x, EpetraVector &y) const override |
Compute the componentwise 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 real64 | get (globalIndex globalRow) const override |
Get a value by index. More... | |
virtual void | get (arraySlice1d< globalIndex const > const &globalIndices, arraySlice1d< real64 > const &values) const override |
Get a sequence of values by index. More... | |
virtual localIndex | getLocalRowID (globalIndex const globalRow) const override |
Map a global row index to local row index. More... | |
virtual globalIndex | getGlobalRowID (localIndex const localRow) const override |
Map a local row index to global row index. More... | |
virtual real64 const * | extractLocalVector () const override |
Extract a view of the local portion of the array. More... | |
virtual real64 * | extractLocalVector () override |
Extract a view of the local portion of the array. More... | |
virtual MPI_Comm | getComm () 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... | |
This class creates and provides basic support for the Epetra_FEVector vector object type used in Trilinos. We use the FE version because Epetra_Vector support for long globalIDs is haphazard.
Definition at line 34 of file EpetraVector.hpp.
geosx::EpetraVector::EpetraVector | ( | EpetraVector const & | src | ) |
Copy constructor.
src | EpetraVector to be copied. |
|
noexcept |
Move constructor.
src | EpetraVector to move from |
|
overridevirtual |
Add into vector value.
globalRow | global row |
value | Values to add in given row |
Add into vector value at given row.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Add vector values.
globalIndices | global row indices |
values | values to add in given rows |
size | number of elements |
Add vector values at given elements.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Add into vector values using array1d.
globalIndices | global rows indices |
values | values to add in given rows |
Add into vector values at given rows.
Implements geosx::VectorBase< EpetraVector >.
|
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 geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Update vector y
as y
= alpha*x + y
.
alpha | scaling factor for added vector |
x | vector to add |
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Assemble vector.
Performs parallel communication to scatter assembled entries to appropriate locations
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
|
overridevirtual |
Construct parallel vector from a local array.
localValues | local data to put into vector |
comm | MPI communicator to use |
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Query vector creation status.
true
if vector has been created Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Create a vector based on global number of elements.
globalSize | Global number of elements |
comm | MPI communicator to use |
Create a vector based on global number of elements. Every processors gets the same number of local elements except proc 0, which gets any remainder elements as well if the split can't be done evenly.
Implements geosx::VectorBase< EpetraVector >.
|
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. For specifying a global size and having automatic partitioning, see createWithGlobalSize().
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Dot product with the vector vec.
vec | vector to dot-product with |
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Extract a view of the local portion of the array.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Extract a view of the local portion of the array.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Get a value by index.
globalRow | global row index |
globalRow
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Get a sequence of values by index.
[in] | globalIndices | array of global row indices |
[out] | values | array of vector values |
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Get the communicator used by this vector.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Map a local row index to global row index.
[in] | localRow | the local row index |
localRow
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Map a global row index to local row index.
[in] | globalRow | the global row index |
globalRow
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Returns the global of the vector.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Get lower bound of local partition.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Get upper bound of local partition.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Returns the local size of the vector.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Infinity-norm of the vector.
Implements geosx::VectorBase< EpetraVector >.
EpetraVector& geosx::EpetraVector::operator= | ( | EpetraVector const & | src | ) |
|
noexcept |
|
overridevirtual |
Compute the componentwise multiplication y
= v * x
.
x | first vector (input) |
y | second vector (output) |
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Print the vector in Trilinos format to the terminal.
os | the output stream to print to |
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Set vector elements to random entries.
seed | the random number seed to use |
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Replace vector elements by their reciprocals.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Multiply all elements by scalingFactor.
scalingFactor | scaling Factor |
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Set vector value.
globalRow | global row index |
value | Value to add at given row |
Set vector value at given element.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Set vector values.
globalIndices | global row indices |
values | Values to add in given rows |
size | Number of elements |
Set vector values at given elements.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Set vector values using array1d.
globalIndices | global row indices |
values | values to add in given rows |
Set vector values at given elements.
Implements geosx::VectorBase< EpetraVector >.
|
overridevirtual |
Set all elements to a constant value.
value | value to set vector elements to |
Implements geosx::VectorBase< EpetraVector >.
Epetra_FEVector const& geosx::EpetraVector::unwrapped | ( | ) | const |
Returns a const pointer to the underlying Epetra object.
Epetra_FEVector& geosx::EpetraVector::unwrapped | ( | ) |
Returns a non-const pointer to the underlying Epetra object.
|
overridevirtual |
Write the vector to a file.
filename | name of the output file | |
[in] | format | output format |
Implements geosx::VectorBase< EpetraVector >.