GEOSX
Public Member Functions | List of all members
geos::EpetraVector Class Referencefinal

Wrapper around Trilinos' Epetra_Vector object. More...

#include <EpetraVector.hpp>

Inheritance diagram for geos::EpetraVector:
Inheritance graph
[legend]

Public Member Functions

const Epetra_Vector & unwrapped () const
 Returns a const pointer to the underlying Epetra object. More...
 
Epetra_Vector & 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...
 
EpetraVectoroperator= (EpetraVector const &src)
 Copy assignment. More...
 
EpetraVectoroperator= (EpetraVector &&src) noexcept
 Move assignment. More...
 
 ~EpetraVector ()
 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 (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 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< real64open ()
 Open the vector for modifying entries. More...
 
virtual void zero ()
 Set vector elements to zero.
 
arrayView1d< real64 const > values () const
 

Detailed Description

Wrapper around Trilinos' Epetra_Vector object.

Definition at line 32 of file EpetraVector.hpp.

Constructor & Destructor Documentation

◆ EpetraVector() [1/2]

geos::EpetraVector::EpetraVector ( EpetraVector const &  src)

Copy constructor.

Parameters
srcEpetraVector to be copied.

◆ EpetraVector() [2/2]

geos::EpetraVector::EpetraVector ( EpetraVector &&  src)
noexcept

Move constructor.

Parameters
srcEpetraVector to move from

Member Function Documentation

◆ axpby()

virtual void geos::EpetraVector::axpby ( real64 const  alpha,
EpetraVector const &  x,
real64 const  beta 
)
overridevirtual

Update vector y as y = alpha*x + beta*y.

Parameters
alphascaling factor for added vector
xvector to add
betascaling factor for self vector

Implements geos::VectorBase< EpetraVector >.

◆ axpy()

virtual void geos::EpetraVector::axpy ( real64 const  alpha,
EpetraVector const &  x 
)
overridevirtual

Update vector y as y = alpha*x + y.

Parameters
alphascaling factor for added vector
xvector to add

Implements geos::VectorBase< EpetraVector >.

◆ close()

virtual void geos::EpetraVector::close ( )
overridevirtual

Close vector for modification.

After calling this method, the view obtained via open() should not be used.

Implements geos::VectorBase< EpetraVector >.

◆ closed()

bool geos::VectorBase< VECTOR >::closed
inline

Query vector closed status.

Returns
true if vector has been opened and has not been closed since; false otherwise

Definition at line 63 of file VectorBase.hpp.

◆ comm()

virtual MPI_Comm geos::EpetraVector::comm ( ) const
overridevirtual

Get the communicator used by this vector.

Returns
the MPI communicator

◆ copy()

virtual void geos::EpetraVector::copy ( EpetraVector const &  x)
overridevirtual

Update vector y as y = x.

Parameters
xvector to copy
Note
Unlike copy assignment operator, this method expects both vectors to be created and have identical parallel distributions, and never reallocates memory.

Implements geos::VectorBase< EpetraVector >.

◆ create()

virtual void geos::EpetraVector::create ( localIndex const  localSize,
MPI_Comm const &  comm 
)
overridevirtual

Create a vector based on local number of elements.

Parameters
localSizelocal number of elements
commMPI communicator to use

Create a vector based on local number of elements. Global size is the sum across processors.

Reimplemented from geos::VectorBase< EpetraVector >.

◆ created()

virtual bool geos::EpetraVector::created ( ) const
overridevirtual

Query vector creation status.

Returns
true if vector has been created

◆ dot()

virtual real64 geos::EpetraVector::dot ( EpetraVector const &  vec) const
overridevirtual

Dot product with the vector vec.

Parameters
vecvector to dot-product with
Returns
dot product

Implements geos::VectorBase< EpetraVector >.

◆ globalSize()

virtual globalIndex geos::EpetraVector::globalSize ( ) const
overridevirtual

Returns the global of the vector.

Returns
the global size

◆ ilower()

virtual globalIndex geos::EpetraVector::ilower ( ) const
overridevirtual

Get lower bound of local partition.

Returns
index of the first global row owned by this processor

◆ iupper()

virtual globalIndex geos::EpetraVector::iupper ( ) const
overridevirtual

Get upper bound of local partition.

Returns
next index after last global row owned by that processor
Note
[ v.ilower(); v.iupper() ) is a half-open index range

◆ localSize()

virtual localIndex geos::EpetraVector::localSize ( ) const
overridevirtual

Returns the local size of the vector.

Returns
the local size (on this processor)

◆ norm1()

virtual real64 geos::EpetraVector::norm1 ( ) const
overridevirtual

1-norm of the vector.

Returns
the 1-norm value

◆ norm2()

virtual real64 geos::EpetraVector::norm2 ( ) const
overridevirtual

2-norm of the vector.

Returns
the 2-norm value

◆ normInf()

virtual real64 geos::EpetraVector::normInf ( ) const
overridevirtual

Infinity-norm of the vector.

Returns
the inf-norm value

◆ open()

virtual arrayView1d< real64 > geos::VectorBase< VECTOR >::open
inline

Open the vector for modifying entries.

Returns
an array view to assemble local values into

Definition at line 128 of file VectorBase.hpp.

◆ operator=() [1/2]

EpetraVector& geos::EpetraVector::operator= ( EpetraVector &&  src)
noexcept

Move assignment.

Parameters
srcEpetraVector to be moved from.
Returns
the new vector

◆ operator=() [2/2]

EpetraVector& geos::EpetraVector::operator= ( EpetraVector const &  src)

Copy assignment.

Parameters
srcEpetraVector to be copied.
Returns
the new vector

◆ pointwiseProduct()

virtual void geos::EpetraVector::pointwiseProduct ( EpetraVector const &  x,
EpetraVector y 
) const
overridevirtual

Compute the component-wise multiplication y = v * x.

Parameters
xfirst vector (input)
ysecond vector (output)

Implements geos::VectorBase< EpetraVector >.

◆ print()

virtual void geos::EpetraVector::print ( std::ostream &  os = std::cout) const
overridevirtual

Print the vector in Trilinos format to the terminal.

Parameters
osthe output stream to print to

Implements geos::VectorBase< EpetraVector >.

◆ rand()

virtual void geos::EpetraVector::rand ( unsigned const  seed)
overridevirtual

Set vector elements to random entries.

Parameters
seedthe random number seed to use

Implements geos::VectorBase< EpetraVector >.

◆ ready()

bool geos::VectorBase< VECTOR >::ready
inline

Query vector ready status.

Returns
true if vector has been created and is currently closed

Definition at line 75 of file VectorBase.hpp.

◆ reciprocal()

virtual void geos::EpetraVector::reciprocal ( )
overridevirtual

Replace vector elements by their reciprocals.

Note
No guarding is done against division by zero.

Implements geos::VectorBase< EpetraVector >.

◆ scale()

virtual void geos::EpetraVector::scale ( real64 const  factor)
overridevirtual

Multiply all elements by factor.

Parameters
factorscaling factor

Implements geos::VectorBase< EpetraVector >.

◆ set()

virtual void geos::EpetraVector::set ( real64 const  value)
overridevirtual

Set all elements to a constant value.

Parameters
valuevalue to set vector elements to

Implements geos::VectorBase< EpetraVector >.

◆ setName()

void geos::VectorBase< VECTOR >::setName
inline

Set a name for the vector (mainly used during various logging).

Parameters
namethe name

Definition at line 112 of file VectorBase.hpp.

◆ touch()

virtual void geos::EpetraVector::touch ( )
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< EpetraVector >.

◆ unwrapped() [1/2]

Epetra_Vector& geos::EpetraVector::unwrapped ( )

Returns a non-const pointer to the underlying Epetra object.

Returns
non-const pointer to the underlying Epetra object

◆ unwrapped() [2/2]

const Epetra_Vector& geos::EpetraVector::unwrapped ( ) const

Returns a const pointer to the underlying Epetra object.

Returns
const pointer to the underlying Epetra object

◆ values()

arrayView1d< real64 const > geos::VectorBase< VECTOR >::values
inline
Returns
a const access view to local vector values

Definition at line 304 of file VectorBase.hpp.

◆ write()

virtual void geos::EpetraVector::write ( string const &  filename,
LAIOutputFormat const  format = LAIOutputFormat::MATRIX_MARKET 
) const
overridevirtual

Write the vector to a file.

Parameters
filenamename of the output file
[in]formatoutput format

Implements geos::VectorBase< EpetraVector >.


The documentation for this class was generated from the following file: