GEOSX
Public Member Functions | List of all members
geos::HypreExport Class Reference

Facilitates exporting Hypre matrix and associated vector objects (either in parallel or serial). More...

#include <HypreExport.hpp>

Public Member Functions

 HypreExport ()
 Parallel export constructor. More...
 
 HypreExport (HypreMatrix const &mat, integer targetRank)
 Single-rank export constructor. More...
 
 ~HypreExport ()
 Destructor.
 
template<typename OFFSET_TYPE , typename COLUMN_TYPE >
void exportCRS (HypreMatrix const &mat, arrayView1d< OFFSET_TYPE > const &rowOffsets, arrayView1d< COLUMN_TYPE > const &colIndices, arrayView1d< real64 > const &values) const
 Export the matrix into CRS arrays provided by the user. More...
 
void exportVector (HypreVector const &vec, arrayView1d< real64 > const &values) const
 Export the target vector into an array provided by the user. More...
 
void importVector (arrayView1d< const real64 > const &values, HypreVector &vec) const
 Import the target vector from an array provided by the user. More...
 

Detailed Description

Facilitates exporting Hypre matrix and associated vector objects (either in parallel or serial).

Definition at line 36 of file HypreExport.hpp.

Constructor & Destructor Documentation

◆ HypreExport() [1/2]

geos::HypreExport::HypreExport ( )

Parallel export constructor.

Use this constructor when exporting local part of the matrix on each rank.

◆ HypreExport() [2/2]

geos::HypreExport::HypreExport ( HypreMatrix const &  mat,
integer  targetRank 
)

Single-rank export constructor.

Parameters
matmatrix to export, only used to infer parallel partitioning info (doesn't need to be filled yet)
targetRankthe rank to gather matrix on

Use this constructor when exporting the whole matrix on a single rank.

Member Function Documentation

◆ exportCRS()

template<typename OFFSET_TYPE , typename COLUMN_TYPE >
void geos::HypreExport::exportCRS ( HypreMatrix const &  mat,
arrayView1d< OFFSET_TYPE > const &  rowOffsets,
arrayView1d< COLUMN_TYPE > const &  colIndices,
arrayView1d< real64 > const &  values 
) const

Export the matrix into CRS arrays provided by the user.

Template Parameters
OFFSET_TYPErow pointer offset type
COLUMN_TYPEcolumn index type
Parameters
matthe source matrix
rowOffsetsarray view to user-managed array of row pointers
colIndicesarray view to user-managed array of column indices
valuesarray view to user-managed array of matrix values

This function must be called on all ranks in the matrix's communicator. Only target rank needs to provide meaningful pointer parameters when doing single-rank export.

◆ exportVector()

void geos::HypreExport::exportVector ( HypreVector const &  vec,
arrayView1d< real64 > const &  values 
) const

Export the target vector into an array provided by the user.

Parameters
vecthe source vector, must be compatible with matrix row distribution
valuesarray view to user-managed array of vector values

This method can be used to extract data from vectors associated with the original matrix. It is mostly useful for single-rank export (gather) of vector values. In parallel users can just call vec.extractLocalVector() and obtain values without copying.

This function must be called on all ranks in the matrix/vector communicator. Only target rank needs to provide meaningful pointer parameter when doing single-rank export.

◆ importVector()

void geos::HypreExport::importVector ( arrayView1d< const real64 > const &  values,
HypreVector vec 
) const

Import the target vector from an array provided by the user.

Parameters
valuesarray view to user-managed array of vector values
vecthe target vector, must be compatible with matrix row distribution

This method can be used to populate data into vectors associated with the original matrix. It is mostly useful for single-rank import (scatter) of vector values. In parallel users can just call vec.extractLocalVector() and populate values without copying.

This function must be called on all ranks in the matrix/vector communicator. Only target rank needs to provide meaningful pointer parameter when doing single-rank import.


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