Dev /

MatrixTypes

CardioWave provides several different sparse-matrix types to provide flexibility in the definition of the domain as well as a high levels of performance. Each sparse-matrix type targets a specific kind of grid or computational mesh:

  • STN - stencil matrix - used for regular (Cartesian) meshes
    • Very small amount of memory is needed
    • Very fast to compute with
    • Computational domain must be linear (1-D), rectangular (2-D), or cubic (3-D)
    • Computational domain must be homogeneous
  • SPB - sparse-banded matrix - used for "warped" regular meshes where the computational nodes may be in slightly irregular positions, but the connections between them are regular
    • Roughly 8*N*M bytes of memory for an N x N matrix with M neighbors per computational node
    • Somewhat fast to compute with
    • Suitable for regular grid where mesh spacings are not uniform
    • Suitable for warped regular grids - hexahedral elements where the faces are not perpendicular to each other
    • Suitable for regular or warped regular grids with inhomogeneities
  • SPR - sparse-general matrix - used for irregular meshes where the nodes are in irregular positions and the connections between nodes are also irregular
    • Roughly 12*N*M bytes of memory for an N x N matrix with (at most) M neighbors per computational node
    • Slowest to compute with
    • Suitable for any mesh -- triangular or tetrahedral elements with different numbers of neighbors per node
    • Suitable for any kind of inhomogeneity or anisotropy

They are all based on the same C structure:

  typedef struct {
	int   type;
	int   rows,cols;
	int   maxnz;
	int   csep;
	domain_t dtype;
	int   msgtag;
	int*  jcoef;
	real* coef;
  } sparse;

All sparse matrices should be initialized with the _INIT_SPARSE macro:

  #define _INIT_SPARSE {0,0,0,0,0,-1,MPI_ANY_TAG,NULL,NULL}

When you declare a sparse matrix type, do:

     sparse Mtx = _INIT_SPARSE;

The matrix-type field is one of the following pre-defined constants:

  #define _PRIMARY   1
  #define _PRIMARY_U 1
  #define _BAND_S    2
  #define _BAND_U    3
  #define _BAND      3
  #define _BANDED    3
  #define _COORD_S   4
  #define _COORD_U   5
  #define _COORD     5

The above types are consistent with the NSPCG package. The following are not:

  #define _PRIMARY_S 6
  #define _NULL      0
  #define _STENCIL   10
  #define _FULL      11
  #define _ZERO      12

To read in a domain to CardioWave, you must use a DomainModule.

See also User.DomainSelection, VectorTypes

Edit - History - Print - Recent Changes - Search
Page last modified on June 05, 2007, at 01:17 PM