MFEM  v3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
mfem::HypreParMatrix Class Reference

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

#include <hypre.hpp>

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

Public Member Functions

 HypreParMatrix (hypre_ParCSRMatrix *a)
 Converts hypre's format to HypreParMatrix. More...
 
 HypreParMatrix (MPI_Comm comm, int glob_size, int *row_starts, SparseMatrix *diag)
 Creates block-diagonal square parallel matrix. Diagonal given by diag. More...
 
 HypreParMatrix (MPI_Comm comm, int global_num_rows, int global_num_cols, int *row_starts, int *col_starts, SparseMatrix *diag)
 
 HypreParMatrix (MPI_Comm comm, int global_num_rows, int global_num_cols, int *row_starts, int *col_starts, SparseMatrix *diag, SparseMatrix *offd, int *cmap)
 Creates general (rectangular) parallel matrix. More...
 
 HypreParMatrix (MPI_Comm comm, int *row_starts, int *col_starts, SparseMatrix *a)
 Creates a parallel matrix from SparseMatrix on processor 0. More...
 
 HypreParMatrix (MPI_Comm comm, int global_num_rows, int global_num_cols, int *row_starts, int *col_starts, Table *diag)
 Creates boolean block-diagonal rectangular parallel matrix. More...
 
 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) More...
 
 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 ()
 
MPI_Comm GetComm ()
 MPI communicator. More...
 
 operator hypre_ParCSRMatrix * ()
 Typecasting to hypre's hypre_ParCSRMatrix*. More...
 
 operator HYPRE_ParCSRMatrix ()
 Typecasting to hypre's HYPRE_ParCSRMatrix, a.k.a. void *. More...
 
hypre_ParCSRMatrix * StealData ()
 Changes the ownership of the the matrix. More...
 
int NNZ ()
 Returns the number of nonzeros. More...
 
int * RowPart ()
 Returns the row partitioning. More...
 
int * ColPart ()
 Returns the column partitioning. More...
 
int M ()
 Returns the global number of rows. More...
 
int N ()
 Returns the global number of columns. More...
 
void GetDiag (Vector &diag)
 Get the diagonal of the matrix. More...
 
HypreParMatrixTranspose ()
 Returns the transpose of *this. More...
 
int GetNumRows () const
 Returns the number of rows in the diagonal block of the ParCSRMatrix. More...
 
int GetNumCols () const
 Returns the number of columns in the diagonal block of the ParCSRMatrix. More...
 
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. More...
 
int Mult (HYPRE_ParVector x, HYPRE_ParVector y, double alpha=1.0, double beta=0.0)
 Computes y = alpha * A * x + beta * y. More...
 
int MultTranspose (HypreParVector &x, HypreParVector &y, double alpha=1.0, double beta=0.0)
 Computes y = alpha * A^t * x + beta * y. More...
 
void Mult (double a, const Vector &x, double b, Vector &y) const
 
void MultTranspose (double a, const Vector &x, double b, Vector &y) const
 
virtual void Mult (const Vector &x, Vector &y) const
 Operator application. More...
 
virtual void MultTranspose (const Vector &x, Vector &y) const
 Action of the transpose operator. More...
 
void ScaleRows (const Vector &s)
 Scale the local row i by s(i). More...
 
void InvScaleRows (const Vector &s)
 Scale the local row i by 1./s(i) More...
 
void operator*= (double s)
 Scale all entries by s: A_scaled = s*A. More...
 
void Print (const char *fname, int offi=0, int offj=0)
 Prints the locally owned rows in parallel. More...
 
void Read (MPI_Comm comm, const char *fname)
 Reads the matrix from a file. More...
 
virtual ~HypreParMatrix ()
 Calls hypre's destroy function. More...
 
- Public Member Functions inherited from mfem::Operator
 Operator (int s=0)
 Construct a square Operator with given size s (default 0) More...
 
 Operator (int h, int w)
 
int Height () const
 Get the height (size of output) of the Operator. Synonym with NumRows. More...
 
int NumRows () const
 
int Width () const
 Get the width (size of input) of the Operator. Synonym with NumCols. More...
 
int NumCols () const
 
virtual OperatorGetGradient (const Vector &x) const
 Evaluate the gradient operator at the point x. More...
 
void PrintMatlab (std::ostream &out, int n=0, int m=0)
 Prints operator with input size n and output size m in matlab format. More...
 
virtual ~Operator ()
 

Additional Inherited Members

- Protected Attributes inherited from mfem::Operator
int height
 
int width
 

Detailed Description

Wrapper for hypre's ParCSR matrix class.

Definition at line 103 of file hypre.hpp.

Constructor & Destructor Documentation

mfem::HypreParMatrix::HypreParMatrix ( hypre_ParCSRMatrix *  a)
inline

Converts hypre's format to HypreParMatrix.

Definition at line 117 of file hypre.hpp.

mfem::HypreParMatrix::HypreParMatrix ( MPI_Comm  comm,
int  glob_size,
int *  row_starts,
SparseMatrix diag 
)

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

Definition at line 178 of file hypre.cpp.

mfem::HypreParMatrix::HypreParMatrix ( MPI_Comm  comm,
int  global_num_rows,
int  global_num_cols,
int *  row_starts,
int *  col_starts,
SparseMatrix diag 
)

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

Definition at line 214 of file hypre.cpp.

mfem::HypreParMatrix::HypreParMatrix ( MPI_Comm  comm,
int  global_num_rows,
int  global_num_cols,
int *  row_starts,
int *  col_starts,
SparseMatrix diag,
SparseMatrix offd,
int *  cmap 
)

Creates general (rectangular) parallel matrix.

Definition at line 248 of file hypre.cpp.

mfem::HypreParMatrix::HypreParMatrix ( MPI_Comm  comm,
int *  row_starts,
int *  col_starts,
SparseMatrix a 
)

Creates a parallel matrix from SparseMatrix on processor 0.

Definition at line 289 of file hypre.cpp.

mfem::HypreParMatrix::HypreParMatrix ( MPI_Comm  comm,
int  global_num_rows,
int  global_num_cols,
int *  row_starts,
int *  col_starts,
Table diag 
)

Creates boolean block-diagonal rectangular parallel matrix.

Definition at line 323 of file hypre.cpp.

mfem::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)

Definition at line 362 of file hypre.cpp.

mfem::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).

Definition at line 430 of file hypre.cpp.

mfem::HypreParMatrix::~HypreParMatrix ( )
virtual

Calls hypre's destroy function.

Definition at line 731 of file hypre.cpp.

Member Function Documentation

void mfem::HypreParMatrix::CheckCommPkg ( )

Definition at line 500 of file hypre.cpp.

int* mfem::HypreParMatrix::ColPart ( )
inline

Returns the column partitioning.

Definition at line 172 of file hypre.hpp.

void mfem::HypreParMatrix::DestroyCommPkg ( )

Definition at line 508 of file hypre.cpp.

int* mfem::HypreParMatrix::GetColStarts ( ) const
inline

Definition at line 197 of file hypre.hpp.

MPI_Comm mfem::HypreParMatrix::GetComm ( )
inline

MPI communicator.

Definition at line 156 of file hypre.hpp.

void mfem::HypreParMatrix::GetDiag ( Vector diag)

Get the diagonal of the matrix.

Definition at line 546 of file hypre.cpp.

int mfem::HypreParMatrix::GetGlobalNumCols ( ) const
inline

Definition at line 193 of file hypre.hpp.

int mfem::HypreParMatrix::GetGlobalNumRows ( ) const
inline

Definition at line 191 of file hypre.hpp.

int mfem::HypreParMatrix::GetNumCols ( ) const
inline

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

Definition at line 188 of file hypre.hpp.

int mfem::HypreParMatrix::GetNumRows ( ) const
inline

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

Definition at line 184 of file hypre.hpp.

int* mfem::HypreParMatrix::GetRowStarts ( ) const
inline

Definition at line 195 of file hypre.hpp.

void mfem::HypreParMatrix::InvScaleRows ( const Vector s)

Scale the local row i by 1./s(i)

Definition at line 665 of file hypre.cpp.

int mfem::HypreParMatrix::M ( )
inline

Returns the global number of rows.

Definition at line 174 of file hypre.hpp.

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

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

Definition at line 572 of file hypre.cpp.

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

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

Definition at line 625 of file hypre.cpp.

void mfem::HypreParMatrix::Mult ( double  a,
const Vector x,
double  b,
Vector y 
) const

Definition at line 578 of file hypre.cpp.

virtual void mfem::HypreParMatrix::Mult ( const Vector x,
Vector y 
) const
inlinevirtual

Operator application.

Implements mfem::Operator.

Definition at line 212 of file hypre.hpp.

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

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

Definition at line 631 of file hypre.cpp.

void mfem::HypreParMatrix::MultTranspose ( double  a,
const Vector x,
double  b,
Vector y 
) const

Definition at line 600 of file hypre.cpp.

virtual void mfem::HypreParMatrix::MultTranspose ( const Vector x,
Vector y 
) const
inlinevirtual

Action of the transpose operator.

Reimplemented from mfem::Operator.

Definition at line 214 of file hypre.hpp.

int mfem::HypreParMatrix::N ( )
inline

Returns the global number of columns.

Definition at line 176 of file hypre.hpp.

int mfem::HypreParMatrix::NNZ ( )
inline

Returns the number of nonzeros.

Definition at line 168 of file hypre.hpp.

mfem::HypreParMatrix::operator HYPRE_ParCSRMatrix ( )

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

Definition at line 533 of file hypre.cpp.

mfem::HypreParMatrix::operator hypre_ParCSRMatrix * ( )

Typecasting to hypre's hypre_ParCSRMatrix*.

Definition at line 527 of file hypre.cpp.

void mfem::HypreParMatrix::operator*= ( double  s)

Scale all entries by s: A_scaled = s*A.

Definition at line 697 of file hypre.cpp.

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

Prints the locally owned rows in parallel.

Definition at line 716 of file hypre.cpp.

void mfem::HypreParMatrix::Read ( MPI_Comm  comm,
const char *  fname 
)

Reads the matrix from a file.

Definition at line 721 of file hypre.cpp.

int* mfem::HypreParMatrix::RowPart ( )
inline

Returns the row partitioning.

Definition at line 170 of file hypre.hpp.

void mfem::HypreParMatrix::ScaleRows ( const Vector s)

Scale the local row i by s(i).

Definition at line 637 of file hypre.cpp.

void mfem::HypreParMatrix::SetCommPkg ( hypre_ParCSRCommPkg *  comm_pkg)

Definition at line 490 of file hypre.cpp.

hypre_ParCSRMatrix * mfem::HypreParMatrix::StealData ( )

Changes the ownership of the the matrix.

Definition at line 539 of file hypre.cpp.

HypreParMatrix * mfem::HypreParMatrix::Transpose ( )

Returns the transpose of *this.

Definition at line 561 of file hypre.cpp.


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