Template Numerical Library: TNL::Containers::HypreParVector Class Reference

Template Numerical Library version\ main:be7e16d88

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
TNL::Containers::HypreParVector Class Reference
Wrappers for the Hypre library

Wrapper for Hypre's parallel vector. More...

`#include <TNL/Containers/HypreParVector.h>`

Collaboration diagram for TNL::Containers::HypreParVector:
[legend]

## Public Types
using | ConstLocalViewType = LocalVectorType::ConstViewType
using | ConstViewType = VectorType::ConstViewType
using | DeviceType = HYPRE_Device
using | IndexType = HYPRE_Int
using | LocalRangeType = Subrange< IndexType >
using | LocalVectorType = Containers::Vector< RealType, DeviceType, IndexType >
using | LocalViewType = LocalVectorType::ViewType
using | RealType = HYPRE_Real
using | SynchronizerType = ViewType::SynchronizerType
using | ValueType = RealType
using | VectorType = Containers::DistributedVector< RealType, DeviceType, IndexType >
using | ViewType = VectorType::ViewType

## Public Member Functions
| HypreParVector (const HypreParVector &other)=delete
| HypreParVector (const LocalRangeType &localRange, IndexType ghosts, IndexType globalSize, MPI_Comm communicator, LocalViewType localData)
| Initialization by raw data.
| HypreParVector (hypre_ParVector *handle, bool take_ownership=true)
| Convert Hypre's format to HypreParVector.
| HypreParVector (HypreParVector &&other) noexcept
void | bind (const LocalRangeType &localRange, IndexType ghosts, IndexType globalSize, MPI_Comm communicator, LocalViewType localData)
| Drop previously set data (deallocate if the vector was the owner) and bind to the given data (i.e., the vector does not become the owner).
void | bind (hypre_ParVector *handle, bool take_ownership=true)
| Convert Hypre's format to HypreParVector.
void | bind (HypreParVector &vector)
void | bind (VectorType &vector)
void | bind (ViewType view)
MPI_Comm | getCommunicator () const
| Return the MPI communicator.
ConstLocalViewType | getConstLocalView () const
ConstLocalViewType | getConstLocalViewWithGhosts () const
ConstViewType | getConstView () const
IndexType | getGhosts () const
LocalRangeType | getLocalRange () const
LocalViewType | getLocalView ()
LocalViewType | getLocalViewWithGhosts ()
HYPRE_Int | getSize () const
| Returns the global size of the vector.
std::shared_ptr< SynchronizerType > | getSynchronizer () const
int | getValuesPerElement () const
ViewType | getView ()
| operator hypre_ParVector * () const
| Typecasting to Hypre's hypre_ParVector* (which is equivalent to HYPRE_ParVector*).
HypreParVector & | operator= (const HypreParVector &other)=delete
HypreParVector & | operator= (HypreParVector &&other) noexcept
void | reset ()
| Reset the vector to empty state.
void | setDistribution (LocalRangeType localRange, IndexType ghosts, IndexType globalSize, const MPI::Comm &communicator)
void | setSynchronizer (std::shared_ptr< SynchronizerType > synchronizer, int valuesPerElement=1)
void | setValue (RealType value)
| Set all elements of the vector to value.
void | startSynchronization ()
void | waitForSynchronization () const

## Protected Attributes
HYPRE_Int | ghosts = 0
HypreVector | localData
bool | owns_handle = true
std::shared_ptr< SynchronizerType > | synchronizer = nullptr
hypre_ParVector * | v = nullptr
int | valuesPerElement = 1

## Detailed Description

Wrapper for Hypre's parallel vector.

Links to upstream sources:

- https://github.com/hypre-space/hypre/blob/master/src/parcsr_mv/par_vector.h
- https://github.com/hypre-space/hypre/blob/master/src/parcsr_mv/par_vector.c
- https://github.com/hypre-space/hypre/blob/master/src/parcsr_mv/_hypre_parcsr_mv.h (catch-all interface)

## Constructor & Destructor Documentation

## ◆ HypreParVector()

TNL::Containers::HypreParVector::HypreParVector | ( | hypre_ParVector * | handle,
|  | bool | take_ownership = true )
| inlineexplicit

Convert Hypre's format to HypreParVector.

Parameters

  handle | is the Hypre vector handle.
  take_ownership | indicates if the vector should take ownership of the handle, i.e. whether to call hypre_VectorDestroy when it does not need it anymore.

## Member Function Documentation

## ◆ bind()

void TNL::Containers::HypreParVector::bind | ( | hypre_ParVector * | handle,
|  | bool | take_ownership = true )
| inline

Convert Hypre's format to HypreParVector.

Parameters

  handle | is the Hypre vector handle.
  take_ownership | indicates if the vector should take ownership of the handle, i.e. whether to call hypre_VectorDestroy when it does not need it anymore.

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

- src/TNL/Containers/HypreParVector.h