Bmat class

A block sparse matrix object. More...


Files

file  bmat.h
 Class Bmat: a block sparse matrix object.

Classes

struct  sBmat
 Contains public data memebers for Bmat class. More...

Typedefs

typedef struct sBmat Bmat
 Declaration of the Bmat class as the Bmat structure.

Functions

BmatBmat_ctor (Vmem *vmem, const char *name, int pnumB, int pnumR[MAXV], int pnumC[MAXV], MATmirror pmirror[MAXV][MAXV])
 The block sparse matrix constructor.
void Bmat_dtor (Bmat **thee)
 The block sparse matrix destructor.
void Bmat_initStructure (Bmat *thee, MATformat pfrmt[MAXV][MAXV], MATsym psym[MAXV][MAXV], int pnumO[MAXV][MAXV], int *IJA[MAXV][MAXV])
 Initialize the nonzero structure given structure information.
void Bmat_copyStructure (Bmat *thee, Bmat *model)
 Copy the nonzero structure from an input model.
void Bmat_killStructure (Bmat *thee)
 Kill the nonzero structure.
int Bmat_numB (Bmat *thee)
 Return the number of blocks.
int Bmat_numR (Bmat *thee, int p, int q)
 Return the number of rows.
int Bmat_numC (Bmat *thee, int p, int q)
 Return the number of columns.
int Bmat_numA (Bmat *thee, int p, int q)
 Return the number of nonzeros we actually store in a block.
int Bmat_numO (Bmat *thee, int p, int q)
 Return the number of nonzeros we actually store in a block which are actually in the strict upper-triangle of the block (DRC only).
int Bmat_numZ (Bmat *thee, int p, int q)
 Return the number of nonzeros we WOULD actually store in a block if we ignored symmetry and stored everything.
int Bmat_numRT (Bmat *thee)
 Return the total number of rows.
int Bmat_numCT (Bmat *thee)
 Return the total number of columns.
int Bmat_numAT (Bmat *thee)
 Return the total number of nonzeros we are actually storing.
int Bmat_numOT (Bmat *thee)
 Return the total number of nonzeros we are actually storing which are located in the strict upper-triangle.
int Bmat_numZT (Bmat *thee)
 Return the total number of nonzeros we WOULD be storing if we ignored all symmetry in all blocks and stored everything.
MATformat Bmat_format (Bmat *thee, int p, int q)
 Return the format of the block.
MATsym Bmat_sym (Bmat *thee, int p, int q)
 Return the symmetry of the block.
MATstate Bmat_state (Bmat *thee, int p, int q)
 Return the state of the block.
MATimpl Bmat_impl (Bmat *thee, int p, int q)
 Return the implicitness of the block.
MATmirror Bmat_mirror (Bmat *thee, int p, int q)
 Return the mirror-ness of the block.
int Bmat_sizeA (Bmat *thee)
 Return the number of nonzeros in all blocks.
int Bmat_sizeIJA (Bmat *thee)
 Return the numer of integer storage locations used.
int * Bmat_IJA (Bmat *thee, int p, int q)
 Return the integer structure IJA.
int * Bmat_IA (Bmat *thee, int p, int q)
 Return the integer structure IA.
int * Bmat_JA (Bmat *thee, int p, int q)
 Return the integer structure JA.
double * Bmat_A (Bmat *thee, int p, int q)
 Return the real structure A.
double * Bmat_diag (Bmat *thee, int p, int q)
 Return the diagonal of A (DRC only).
double * Bmat_offU (Bmat *thee, int p, int q)
 Return the strict upper triangle of A (DRC only).
double * Bmat_offL (Bmat *thee, int p, int q)
 Return the strict lower triangle of A (DRC only).
void Bmat_print (Bmat *thee)
 Print the prolongation matrix blocks.
void Bmat_printSp (Bmat *thee, char *fname, int pflag)
 Print the prolongation matrix in MATLAB sparse form.
void Bmat_printNoD (Bmat *thee)
 Print the matrix as a DENSE matrix in MATLAB format, but first zero out any rows/cols corresponding to Dirichlet boundary points.
void Bmat_printSpNoD (Bmat *thee, char *fname, int pflag)
 Print the matrix as a DENSE matrix in MATLAB format, but first zero out any rows/cols corresponding to Dirichlet boundary points.
void Bmat_zero (Bmat *thee)
 Clear the floating point storage for the sparse matrix. Also clear any sparse factorization storage.
void Bmat_diri (Bmat *thee)
 Setup the dirichlet equations.
void Bmat_set (Bmat *thee, int p, int q, int i, int j, double val)
 Set the (i,j)-th entry of the (p,q)-th block to < val >.
void Bmat_addTo (Bmat *thee, int p, int q, int i, int j, double val)
 Contribute < val > to the (i,j)-th entry of the (p,q)-th block.
void Bmat_galerkin (Bmat *thee, Bmat *rmat, Bmat *amat, Bmat *pmat)
 Enforce the Galerkin conditions algebraically.
int Bmat_sluDirect (Bmat *thee)
 Make a decision about whether or not a sparse direct solver should be used in place of an iterative solver, based on the size of the system.
void Bmat_sluCreate (Bmat *thee)
 Create the global matrix from the blocks in the modified ROW or COL storage format. This is useful for preparing a single global matrix for input to e.g. a sparse direct solver.
int Bmat_sluFactor (Bmat *thee)
 Create the sparse LU factors for global matrix.
int Bmat_sluSolve (Bmat *thee, int key, double *f, double *u)
 Forward/backward solve using sparse LU factors of global matrix.
void Bmat_sluDestroy (Bmat *thee)
 Destroy the sparse LU factors for the system matrix.
void Bmat_memChk (Bmat *thee)
 Print the exact current malloc usage.
BmatBmat_clone (Vmem *vmem, char *name, Bmat *X)
 Construct a clone of a Bmat with the same structure.
void Bmat_copy (Bmat *Y, Bmat *X)
 Copy a block matrix.
void Bmat_squeezeBRC (Bmat *thee, int key)
 Remove the boundary rows or columns from a block matrix.
void Bmat_copy2 (Bmat *Y, Bmat *X)
 Copy a block matrix.
void Bmat_axpy (Bmat *Y, Bmat *X, double val, int key)
 Scalar times a Bmat plus a Bmat: Y += val*X.
BmatBmat_ctorPoint (Bmat *P, const char *name, int *ibase, int *numR)
 Create a Bmat pointer to the tail of a Bmat.
void Bmat_dtorPoint (Bmat **thee)
 The Bmat pointer destructor.
void Bmat_printDiriSp (Bmat *thee, char *fname, int pflag)
 Print the Dirichlet info of a Bmat in MATLAB sparse form.
MatBmat_AD (Bmat *thee, int p, int q)
 Return the Mat structure AD.
double Bmat_lnDet (Bmat *thee)
 Calculate the log of the determinant of a SPD Bmat matrix.
void Bmat_copyBXLN (Bmat *thee, Bmat *Alink)
 Produces a Bmat copy of a BXLN.

Detailed Description

A block sparse matrix object.


Typedef Documentation

typedef struct sBmat Bmat

Declaration of the Bmat class as the Bmat structure.

Author:
Michael Holst
Returns:
None


Function Documentation

double* Bmat_A ( Bmat thee,
int  p,
int  q 
)

Return the real structure A.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the real structure
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

Mat* Bmat_AD ( Bmat thee,
int  p,
int  q 
)

Return the Mat structure AD.

Author:
Michael Holst
Note:
Class Whb: Non-Inlineable methods (hbtools.c)
Returns:
the Mat structure AD
Parameters:
thee Pointer to the Bmat object
p index for the row
q index for the column

void Bmat_addTo ( Bmat thee,
int  p,
int  q,
int  i,
int  j,
double  val 
)

Contribute < val > to the (i,j)-th entry of the (p,q)-th block.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks
i the index of the matrix
j the index of the matrix
val the value of the matrix element

void Bmat_axpy ( Bmat Y,
Bmat X,
double  val,
int  key 
)

Scalar times a Bmat plus a Bmat: Y += val*X.

Author:
Stephen Bond
Note:
Class Bmat: Non-inlineable methods (bmat.c)
The function of this routine can be controlled using "key"
Returns:
None
Parameters:
Y The new matrix
X The old matrix
val the coeficient for timing X matrix
key index for different X and Y matrices.

Bmat* Bmat_clone ( Vmem *  vmem,
char *  name,
Bmat X 
)

Construct a clone of a Bmat with the same structure.

Author:
Stephen Bond
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
vmem Memory management object
name character string name for this matrix
X The matrix which is cloned

void Bmat_copy ( Bmat Y,
Bmat X 
)

Copy a block matrix.

Author:
Stephen Bond
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
Y The new matrix
X The old matrix

void Bmat_copy2 ( Bmat Y,
Bmat X 
)

Copy a block matrix.

Author:
Stephen Bond
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
Y The new matrix
X The old matrix

void Bmat_copyBXLN ( Bmat thee,
Bmat Alink 
)

Produces a Bmat copy of a BXLN.

Author:
Stephen Bond 2002/01/26
Note:
Class Whb: Non-Inlineable methods (brcmat.c)
Returns:
None
Parameters:
thee Pointer to the Bmat object
Alink Pointer to the Bmat object

void Bmat_copyStructure ( Bmat thee,
Bmat model 
)

Copy the nonzero structure from an input model.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
thee Pointer to the block sparse matrix
model an input model

Bmat* Bmat_ctor ( Vmem *  vmem,
const char *  name,
int  pnumB,
int  pnumR[MAXV],
int  pnumC[MAXV],
MATmirror  pmirror[MAXV][MAXV] 
)

The block sparse matrix constructor.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
This constructor only does minimal initialization of a Bmat object after creating the object itself; it doesn't create any storage for either the integer structure arrays or the nonzero storage arrays.
This constructor only fixes the number of blocks and the numbers of rows and columns in each block; the nonzero structure is not set yet.
Returns:
Pointer to a newly allocated (empty) block sparse matrix
Parameters:
vmem Memory management object
name character string name for this matrix
pnumB number of blocks
pnumR num of rows in the matrix
pnumC num of cols (DRC REQUIRES numC=numR)
pmirror the mirror-ness of the block

Bmat* Bmat_ctorPoint ( Bmat P,
const char *  name,
int *  ibase,
int *  numR 
)

Create a Bmat pointer to the tail of a Bmat.

Author:
Stephen Bond
Note:
Class Whb: Non-Inlineable methods (hbtools.c)
Returns:
Bmat pointer to the tail of a Bmat.
Parameters:
P prolongation matrix maintained by aprx
name character string name for the block matrix
ibase pointer to size array
numR num of rows in each array block

double* Bmat_diag ( Bmat thee,
int  p,
int  q 
)

Return the diagonal of A (DRC only).

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the diagonal of A (DRC only).
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

void Bmat_diri ( Bmat thee  ) 

Setup the dirichlet equations.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
thee Pointer to the block sparse matrix

void Bmat_dtor ( Bmat **  thee  ) 

The block sparse matrix destructor.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
This destructor does the reverse of Bmat_ctor, and if necessary first reverses Bmat_initStructure (or Bmat_copyStructure). I.e., if necessary, it first frees the large integer and real arrays created by Bmat_initStructure or Bmat_copyStructure, and then frees the Bmat object itself at the last moment.
Returns:
None
Parameters:
thee Pointer to the block sparse matrix

void Bmat_dtorPoint ( Bmat **  thee  ) 

The Bmat pointer destructor.

Author:
Stephen Bond
Note:
Class Whb: Non-Inlineable methods (hbtools.c)
Returns:
None
Parameters:
thee Pointer to Pointer of the Bmat object

MATformat Bmat_format ( Bmat thee,
int  p,
int  q 
)

Return the format of the block.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the format of the block.
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

void Bmat_galerkin ( Bmat thee,
Bmat rmat,
Bmat amat,
Bmat pmat 
)

Enforce the Galerkin conditions algebraically.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
thee Pointer to the block sparse matrix
rmat R matrix which is stored column-wise (ROW-format)
amat A matrix which is stored in one of three forms, namely, either row-wise (ROW), col-wise (COL), or by diagonal followed by upper-triangle row-wise and then by lower triangle columne-wise (DRC).
pmat P matrix which is stored row-wise (ROW-format)

int* Bmat_IA ( Bmat thee,
int  p,
int  q 
)

Return the integer structure IA.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the integer structure IA.
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

int* Bmat_IJA ( Bmat thee,
int  p,
int  q 
)

Return the integer structure IJA.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the integer structure IJA.
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

MATimpl Bmat_impl ( Bmat thee,
int  p,
int  q 
)

Return the implicitness of the block.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the implicitness of the block.
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

void Bmat_initStructure ( Bmat thee,
MATformat  pfrmt[MAXV][MAXV],
MATsym  psym[MAXV][MAXV],
int  pnumO[MAXV][MAXV],
int *  IJA[MAXV][MAXV] 
)

Initialize the nonzero structure given structure information.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
This routine actually does the storage creation for both the integer structure information arrays and the nonzero value arrays.
Returns:
None
Parameters:
thee Pointer to the block sparse matrix
pfrmt format types of the block sparse matrix
psym symmetric types of the block sparse matrix
pnumO num of nonzeros we are actually storing in the strict upper-triangle of matrix. (DRC only)
IJA integer structure [ IA ; JA ]

int* Bmat_JA ( Bmat thee,
int  p,
int  q 
)

Return the integer structure JA.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the integer structure JA.
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

void Bmat_killStructure ( Bmat thee  ) 

Kill the nonzero structure.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
thee Pointer to the block sparse matrix

double Bmat_lnDet ( Bmat thee  ) 

Calculate the log of the determinant of a SPD Bmat matrix.

Author:
Stephen Bond
Note:
Class Whb: Non-Inlineable methods (cholesky.c)
Uses Cholesky factorization (slow for large matrices).
Returns:
None
Parameters:
thee Pointer to the Bmat object

void Bmat_memChk ( Bmat thee  ) 

Print the exact current malloc usage.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
thee Pointer to the block sparse matrix

MATmirror Bmat_mirror ( Bmat thee,
int  p,
int  q 
)

Return the mirror-ness of the block.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the mirror-ness of the block.
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

int Bmat_numA ( Bmat thee,
int  p,
int  q 
)

Return the number of nonzeros we actually store in a block.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the number of nonzeros we actually store in a block.
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

int Bmat_numAT ( Bmat thee  ) 

Return the total number of nonzeros we are actually storing.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the total number of nonzeros we are actually storing.
Parameters:
thee Pointer to the block sparse matrix

int Bmat_numB ( Bmat thee  ) 

Return the number of blocks.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the number of blocks
Parameters:
thee Pointer to the block sparse matrix

int Bmat_numC ( Bmat thee,
int  p,
int  q 
)

Return the number of columns.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the number of columns.
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

int Bmat_numCT ( Bmat thee  ) 

Return the total number of columns.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the total number of columns
Parameters:
thee Pointer to the block sparse matrix

int Bmat_numO ( Bmat thee,
int  p,
int  q 
)

Return the number of nonzeros we actually store in a block which are actually in the strict upper-triangle of the block (DRC only).

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the number of nonzeros we actually store in a block which are actually in the strict upper-triangle of the block (DRC only).
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

int Bmat_numOT ( Bmat thee  ) 

Return the total number of nonzeros we are actually storing which are located in the strict upper-triangle.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the total number of nonzeros we are actually storing which are located in the strict upper-triangle.
Parameters:
thee Pointer to the block sparse matrix

int Bmat_numR ( Bmat thee,
int  p,
int  q 
)

Return the number of rows.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the number of rows
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

int Bmat_numRT ( Bmat thee  ) 

Return the total number of rows.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the total number of rows
Parameters:
thee Pointer to the block sparse matrix

int Bmat_numZ ( Bmat thee,
int  p,
int  q 
)

Return the number of nonzeros we WOULD actually store in a block if we ignored symmetry and stored everything.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the number of nonzeros we WOULD actually store in a block if we ignored symmetry and stored everything.
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

int Bmat_numZT ( Bmat thee  ) 

Return the total number of nonzeros we WOULD be storing if we ignored all symmetry in all blocks and stored everything.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the total number of nonzeros we WOULD be storing if we ignored all symmetry in all blocks and stored everything.
Parameters:
thee Pointer to the block sparse matrix

double* Bmat_offL ( Bmat thee,
int  p,
int  q 
)

Return the strict lower triangle of A (DRC only).

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the strict lower triangle of A (DRC only).
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

double* Bmat_offU ( Bmat thee,
int  p,
int  q 
)

Return the strict upper triangle of A (DRC only).

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the strict upper triangle of A (DRC only).
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

void Bmat_print ( Bmat thee  ) 

Print the prolongation matrix blocks.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
thee Pointer to the block sparse matrix

void Bmat_printDiriSp ( Bmat thee,
char *  fname,
int  pflag 
)

Print the Dirichlet info of a Bmat in MATLAB sparse form.

Author:
Stephen Bond 2002/08/24
Note:
Class Whb: Non-Inlineable methods (hbtools.c)
Returns:
None
Parameters:
thee Pointer to the Bmat object
fname character string name for the block matrix
pflag index for write/append

void Bmat_printNoD ( Bmat thee  ) 

Print the matrix as a DENSE matrix in MATLAB format, but first zero out any rows/cols corresponding to Dirichlet boundary points.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
This routine is useful for e.g. checking that Galerkin conditions hold for stiffness matrices. Removing the dirichlet equations is crucial; otherwise the Galerkin condition cannot hold. Note that the matrix (and the Galerkin coarse matrix) are then of course singular.
Returns:
None
Parameters:
thee Pointer to the block sparse matrix

void Bmat_printSp ( Bmat thee,
char *  fname,
int  pflag 
)

Print the prolongation matrix in MATLAB sparse form.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
thee Pointer to the block sparse matrix
fname output file/buff/unix/inet name
pflag flag==0 ==> write, flag==1 ==> append

void Bmat_printSpNoD ( Bmat thee,
char *  fname,
int  pflag 
)

Print the matrix as a DENSE matrix in MATLAB format, but first zero out any rows/cols corresponding to Dirichlet boundary points.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
This routine is useful for e.g. checking that Galerkin conditions hold for stiffness matrices. Removing the dirichlet equations is crucial; otherwise the Galerkin condition cannot hold. Note that the matrix (and the Galerkin coarse matrix) are then of course singular.
Returns:
None
Parameters:
thee Pointer to the block sparse matrix
fname output file/buff/unix/inet name
pflag index for write/append

void Bmat_set ( Bmat thee,
int  p,
int  q,
int  i,
int  j,
double  val 
)

Set the (i,j)-th entry of the (p,q)-th block to < val >.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks
i the index of the matrix
j the index of the matrix
val the value of the matrix element

int Bmat_sizeA ( Bmat thee  ) 

Return the number of nonzeros in all blocks.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the number of nonzeros in all blocks.
Parameters:
thee Pointer to the block sparse matrix

int Bmat_sizeIJA ( Bmat thee  ) 

Return the numer of integer storage locations used.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the numer of integer storage locations used.
Parameters:
thee Pointer to the block sparse matrix

void Bmat_sluCreate ( Bmat thee  ) 

Create the global matrix from the blocks in the modified ROW or COL storage format. This is useful for preparing a single global matrix for input to e.g. a sparse direct solver.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
thee Pointer to the block sparse matrix

void Bmat_sluDestroy ( Bmat thee  ) 

Destroy the sparse LU factors for the system matrix.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
This frees our < ia,ja,a > storage, and also the internal storage that was malloc'd by the sparse direct library.
Returns:
None
Parameters:
thee Pointer to the block sparse matrix

int Bmat_sluDirect ( Bmat thee  ) 

Make a decision about whether or not a sparse direct solver should be used in place of an iterative solver, based on the size of the system.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
This is obviously heuristic in nature; in general the cutoff size where iterative methods start to win is smaller in 3D.
Returns:
the decision about whether or not a sparse direct solver should be used in place of an iterative solver, based on the size of the system.
Parameters:
thee Pointer to the block sparse matrix

int Bmat_sluFactor ( Bmat thee  ) 

Create the sparse LU factors for global matrix.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
Sparse LU factor
Parameters:
thee Pointer to the block sparse matrix

int Bmat_sluSolve ( Bmat thee,
int  key,
double *  f,
double *  u 
)

Forward/backward solve using sparse LU factors of global matrix.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
This requires that Bmat_sluFactor has been previously called.
Returns:
Success enumeration
Parameters:
thee Pointer to the block sparse matrix
key index for choosing NOTRANS or TRANS
f the number of right-hand sides
u solution

void Bmat_squeezeBRC ( Bmat thee,
int  key 
)

Remove the boundary rows or columns from a block matrix.

Author:
Stephen Bond
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
None
Parameters:
thee Pointer to the block sparse matrix
key index for removing the boundary rows or columns from a matrix

MATstate Bmat_state ( Bmat thee,
int  p,
int  q 
)

Return the state of the block.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the state of the block.
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

MATsym Bmat_sym ( Bmat thee,
int  p,
int  q 
)

Return the symmetry of the block.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
Returns:
the symmetry of the block.
Parameters:
thee Pointer to the block sparse matrix
p the index of the blocks
q the index of the blocks

void Bmat_zero ( Bmat thee  ) 

Clear the floating point storage for the sparse matrix. Also clear any sparse factorization storage.

Author:
Michael Holst
Note:
Class Bmat: Non-inlineable methods (bmat.c)
This is basically done in preparation for an accumulation as part of a matrix assembly, and before a new sparse factorization.
Returns:
None
Parameters:
thee Pointer to the block sparse matrix


Generated on Mon Aug 9 11:13:45 2010 for MC by  doxygen 1.5.6