MFEM v2.0
Public Member Functions | Private Attributes
HypreParMatrix Class Reference

Wrapper for hypre's ParCSR matrix class. More...

#include <hypre.hpp>

Inheritance diagram for HypreParMatrix:
Inheritance graph
[legend]
Collaboration diagram for HypreParMatrix:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HypreParMatrix (hypre_ParCSRMatrix *a)
 Converts hypre's format to HypreParMatrix.
 HypreParMatrix (int size, int *row, SparseMatrix *diag)
 Creates block-diagonal square parallel matrix. Diagonal given by diag.
 HypreParMatrix (int M, int N, int *row, int *col, SparseMatrix *diag)
 HypreParMatrix (int M, int N, int *row, int *col, SparseMatrix *diag, SparseMatrix *offd, int *cmap)
 Creates general (rectangular) parallel matrix.
 HypreParMatrix (int *row, int *col, SparseMatrix *a)
 Creates a parallel matrix from SparseMatrix on processor 0.
 HypreParMatrix (int M, int N, int *row, int *col, Table *diag)
 Creates boolean block-diagonal rectangular parallel matrix.
 HypreParMatrix (MPI_Comm comm, int id, int np, int *row, int *col, int *i_diag, int *j_diag, int *i_offd, int *j_offd, int *cmap, int cmap_size)
 Creates boolean rectangular parallel matrix (which owns its data)
 HypreParMatrix (MPI_Comm comm, int nrows, int glob_nrows, int glob_ncols, int *I, int *J, double *data, int *rows, int *cols)
void SetCommPkg (hypre_ParCSRCommPkg *comm_pkg)
void CheckCommPkg ()
void DestroyCommPkg ()
 operator hypre_ParCSRMatrix * ()
 Typecasting to hypre's hypre_ParCSRMatrix*.
 operator HYPRE_ParCSRMatrix ()
 Typecasting to hypre's HYPRE_ParCSRMatrix, a.k.a. void *.
hypre_ParCSRMatrix * StealData ()
 Changes the ownership of the the matrix.
int NNZ ()
 Returns the number of nonzeros.
int * RowPart ()
 Returns the row partitioning.
int * ColPart ()
 Returns the row partitioning.
int M ()
 Returns the global number of rows.
int N ()
 Returns the global number of columns.
void GetDiag (Vector &diag)
 Get the diagonal of the matrix.
HypreParMatrixTranspose ()
 Returns the transpose of *this.
int GetNumRows () const
 Returns the number of rows in the diagonal block of the ParCSRMatrix.
int GetGlobalNumRows () const
int GetGlobalNumCols () const
int * GetRowStarts () const
int * GetColStarts () const
int Mult (HypreParVector &x, HypreParVector &y, double alpha=1.0, double beta=0.0)
 Computes y = alpha * A * x + beta * y.
int Mult (HYPRE_ParVector x, HYPRE_ParVector y, double alpha=1.0, double beta=0.0)
 Computes y = alpha * A * x + beta * y.
int MultTranspose (HypreParVector &x, HypreParVector &y, double alpha=1.0, double beta=0.0)
 Computes y = alpha * A^t * x + beta * y.
virtual void Mult (const Vector &x, Vector &y) const
 Operator application.
virtual void MultTranspose (const Vector &x, Vector &y) const
 Action of the transpose operator.
void Print (const char *fname, int offi=0, int offj=0)
 Prints the locally owned rows in parallel.
void Read (const char *fname)
 Reads the matrix from a file.
virtual ~HypreParMatrix ()
 Calls hypre's destroy function.

Private Attributes

hypre_ParCSRMatrix * A
 The actual object.
hypre_ParCSRCommPkg * CommPkg
 Internal communication object associated with A.
HypreParVectorX
 Auxiliary vectors for typecasting.
HypreParVectorY

Detailed Description

Wrapper for hypre's ParCSR matrix class.

Definition at line 83 of file hypre.hpp.


Constructor & Destructor Documentation

HypreParMatrix::HypreParMatrix ( hypre_ParCSRMatrix *  a) [inline]

Converts hypre's format to HypreParMatrix.

Definition at line 97 of file hypre.hpp.

References CommPkg, X, and Y.

HypreParMatrix::HypreParMatrix ( int  size,
int *  row,
SparseMatrix diag 
)

Creates block-diagonal square parallel matrix. Diagonal given by diag.

HypreParMatrix::HypreParMatrix ( int  M,
int  N,
int *  row,
int *  col,
SparseMatrix diag 
)

Creates block-diagonal rectangular parallel matrix. Diagonal given by diag.

HypreParMatrix::HypreParMatrix ( int  M,
int  N,
int *  row,
int *  col,
SparseMatrix diag,
SparseMatrix offd,
int *  cmap 
)

Creates general (rectangular) parallel matrix.

HypreParMatrix::HypreParMatrix ( int *  row,
int *  col,
SparseMatrix a 
)

Creates a parallel matrix from SparseMatrix on processor 0.

HypreParMatrix::HypreParMatrix ( int  M,
int  N,
int *  row,
int *  col,
Table diag 
)

Creates boolean block-diagonal rectangular parallel matrix.

HypreParMatrix::HypreParMatrix ( MPI_Comm  comm,
int  id,
int  np,
int *  row,
int *  col,
int *  i_diag,
int *  j_diag,
int *  i_offd,
int *  j_offd,
int *  cmap,
int  cmap_size 
)

Creates boolean rectangular parallel matrix (which owns its data)

HypreParMatrix::HypreParMatrix ( MPI_Comm  comm,
int  nrows,
int  glob_nrows,
int  glob_ncols,
int *  I,
int *  J,
double *  data,
int *  rows,
int *  cols 
)

Creates a general parallel matrix from a local CSR matrix on each processor described by the I, J and data arrays. The local matrix should be of size (local) nrows by (global) glob_ncols. The parallel matrix contains copies of the rows and cols arrays (so they can be deleted).

virtual HypreParMatrix::~HypreParMatrix ( ) [virtual]

Calls hypre's destroy function.


Member Function Documentation

void HypreParMatrix::CheckCommPkg ( )
int* HypreParMatrix::ColPart ( ) [inline]

Returns the row partitioning.

Definition at line 142 of file hypre.hpp.

References A.

void HypreParMatrix::DestroyCommPkg ( )
int* HypreParMatrix::GetColStarts ( ) const [inline]

Definition at line 163 of file hypre.hpp.

References A.

void HypreParMatrix::GetDiag ( Vector diag)

Get the diagonal of the matrix.

int HypreParMatrix::GetGlobalNumCols ( ) const [inline]

Definition at line 159 of file hypre.hpp.

References A.

Referenced by ParFiniteElementSpace::GlobalTrueVSize().

int HypreParMatrix::GetGlobalNumRows ( ) const [inline]

Definition at line 157 of file hypre.hpp.

References A.

Referenced by ParFiniteElementSpace::GlobalVSize().

int HypreParMatrix::GetNumRows ( ) const [inline]

Returns the number of rows in the diagonal block of the ParCSRMatrix.

Definition at line 154 of file hypre.hpp.

References A.

int* HypreParMatrix::GetRowStarts ( ) const [inline]

Definition at line 161 of file hypre.hpp.

References A.

int HypreParMatrix::M ( ) [inline]

Returns the global number of rows.

Definition at line 144 of file hypre.hpp.

References A.

int HypreParMatrix::Mult ( HypreParVector x,
HypreParVector y,
double  alpha = 1.0,
double  beta = 0.0 
)

Computes y = alpha * A * x + beta * y.

int HypreParMatrix::Mult ( HYPRE_ParVector  x,
HYPRE_ParVector  y,
double  alpha = 1.0,
double  beta = 0.0 
)

Computes y = alpha * A * x + beta * y.

virtual void HypreParMatrix::Mult ( const Vector x,
Vector y 
) const [virtual]

Operator application.

Implements Operator.

virtual void HypreParMatrix::MultTranspose ( const Vector x,
Vector y 
) const [virtual]

Action of the transpose operator.

Reimplemented from Operator.

int HypreParMatrix::MultTranspose ( HypreParVector x,
HypreParVector y,
double  alpha = 1.0,
double  beta = 0.0 
)

Computes y = alpha * A^t * x + beta * y.

int HypreParMatrix::N ( ) [inline]

Returns the global number of columns.

Definition at line 146 of file hypre.hpp.

References A.

int HypreParMatrix::NNZ ( ) [inline]

Returns the number of nonzeros.

Definition at line 138 of file hypre.hpp.

References A.

HypreParMatrix::operator HYPRE_ParCSRMatrix ( )

Typecasting to hypre's HYPRE_ParCSRMatrix, a.k.a. void *.

HypreParMatrix::operator hypre_ParCSRMatrix * ( )

Typecasting to hypre's hypre_ParCSRMatrix*.

void HypreParMatrix::Print ( const char *  fname,
int  offi = 0,
int  offj = 0 
)

Prints the locally owned rows in parallel.

void HypreParMatrix::Read ( const char *  fname)

Reads the matrix from a file.

int* HypreParMatrix::RowPart ( ) [inline]

Returns the row partitioning.

Definition at line 140 of file hypre.hpp.

References A.

void HypreParMatrix::SetCommPkg ( hypre_ParCSRCommPkg *  comm_pkg)
hypre_ParCSRMatrix* HypreParMatrix::StealData ( )

Changes the ownership of the the matrix.

HypreParMatrix* HypreParMatrix::Transpose ( )

Returns the transpose of *this.


Member Data Documentation

hypre_ParCSRMatrix* HypreParMatrix::A [private]

The actual object.

Definition at line 87 of file hypre.hpp.

Referenced by ColPart(), GetColStarts(), GetGlobalNumCols(), GetGlobalNumRows(), GetNumRows(), GetRowStarts(), M(), N(), NNZ(), and RowPart().

hypre_ParCSRCommPkg* HypreParMatrix::CommPkg [private]

Internal communication object associated with A.

Definition at line 90 of file hypre.hpp.

Referenced by HypreParMatrix().

HypreParVector* HypreParMatrix::X [mutable, private]

Auxiliary vectors for typecasting.

Definition at line 93 of file hypre.hpp.

Referenced by HypreParMatrix().

HypreParVector * HypreParMatrix::Y [mutable, private]

Definition at line 93 of file hypre.hpp.

Referenced by HypreParMatrix().


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines