19 #ifndef GEOSX_LINEARALGEBRA_INTERFACES_HYPREVECTOR_HPP_ 20 #define GEOSX_LINEARALGEBRA_INTERFACES_HYPREVECTOR_HPP_ 33 extern "C" struct hypre_IJVector_struct;
39 extern "C" struct hypre_ParVector_struct;
115 virtual bool created()
const override;
118 MPI_Comm
const & comm )
override;
121 MPI_Comm
const & comm )
override;
124 MPI_Comm
const & comm )
override;
126 virtual void open()
override;
128 virtual void close()
override;
130 virtual void reset()
override;
132 virtual void set(
globalIndex const globalRowIndex,
133 real64 const value )
override;
136 real64 const value )
override;
138 virtual void set(
globalIndex const * globalRowIndices,
152 virtual void set(
real64 const value )
override;
154 virtual void zero()
override;
156 virtual void rand(
unsigned const seed = 1984 )
override;
158 virtual void scale(
real64 const scalingFactor )
override;
171 real64 const beta )
override;
233 virtual MPI_Comm
getComm()
const override;
235 virtual void print( std::ostream & os = std::cout )
const override;
237 virtual void write(
string const & filename,
Wrapper class for hypre's ParVector.
virtual void add(globalIndex const globalRowIndex, real64 const value) override
Add into vector value.
Common base template for all vector wrapper types.
virtual void copy(HypreVector const &x) override
Update vector y as y = x.
virtual void createWithLocalSize(localIndex const localSize, MPI_Comm const &comm) override
Create a vector based on local number of elements.
virtual void rand(unsigned const seed=1984) override
Set vector elements to random entries.
virtual void extract(arrayView1d< real64 > const &localVector) const
Extract local solution by copying into a user-provided array.
long long int globalIndex
Global index type (for indexing objects across MPI partitions).
virtual MPI_Comm getComm() const override
Get the communicator used by this vector.
virtual void axpby(real64 const alpha, HypreVector const &x, real64 const beta) override
Update vector y as y = alpha*x + beta*y.
virtual void write(string const &filename, LAIOutputFormat const format=LAIOutputFormat::MATRIX_MARKET) const override
Write the vector to a file.
virtual void create(arrayView1d< real64 const > const &localValues, MPI_Comm const &comm) override
Construct parallel vector from a local array.
This class serves to provide a sliced multidimensional interface to the family of LvArray classes...
virtual void reciprocal() override
Replace vector elements by their reciprocals.
virtual globalIndex globalSize() const override
Returns the global of the vector.
bool closed() const
Query vector closed status.
std::string format(int NDIM, INDEX_TYPE const *const dims)
This function returns a string that may be used as the "type" in a call to TV_ttf_add_row(). This will either be a single value or an array.
virtual void zero() override
Set vector elements to zero.
HypreVector()
Empty vector constructor. Create an empty (distributed) vector.
virtual bool created() const override
Query vector creation status.
hypre_IJVector_struct * HYPRE_IJVector
IJVector pointer alias.
virtual globalIndex getGlobalRowID(localIndex const localRowIndex) const override
Map a local row index to global row index.
virtual void scale(real64 const scalingFactor) override
Multiply all elements by scalingFactor.
virtual real64 dot(HypreVector const &vec) const override
Dot product with the vector vec.
virtual globalIndex ilower() const override
Get lower bound of local partition.
This class serves to provide a "view" of a multidimensional array.
virtual localIndex localSize() const override
Returns the local size of the vector.
virtual real64 norm2() const override
2-norm of the vector.
double real64
64-bit floating point type.
virtual void reset() override
Reset the matrix to default state.
virtual real64 const * extractLocalVector() const override
Extract a view of the local portion of the array.
virtual real64 normInf() const override
Infinity-norm of the vector.
HypreVector & operator=(HypreVector const &src)
Copy assignment.
virtual globalIndex iupper() const override
Get upper bound of local partition.
virtual void createWithGlobalSize(globalIndex const globalSize, MPI_Comm const &comm) override
Create a vector based on global number of elements.
hypre_ParVector_struct * HYPRE_ParVector
ParVector pointer alias.
virtual real64 norm1() const override
1-norm of the vector.
virtual void pointwiseProduct(HypreVector const &x, HypreVector &y) const override
Compute the componentwise multiplication y = v * x.
HYPRE_IJVector const & unwrappedIJ() const
Returns a pointer to the implementation.
virtual void axpy(real64 const alpha, HypreVector const &x) override
Update vector y as y = alpha*x + y.
~HypreVector()
Destructor.
virtual localIndex getLocalRowID(globalIndex const globalRowIndex) const override
Map a global row index to local row index.
virtual void close() override
Assemble vector.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
bool ready() const
Query vector ready status.
HYPRE_ParVector const & unwrapped() const
Returns a pointer to the implementation.
virtual void open() override
Open the vector for modifying entries.
virtual void print(std::ostream &os=std::cout) const override
Print the vector in Trilinos format to the terminal.