86 lines
3.9 KiB
C
86 lines
3.9 KiB
C
/*BHEADER**********************************************************************
|
|
* (c) 1997 The Regents of the University of California
|
|
*
|
|
* See the file COPYRIGHT_and_DISCLAIMER for a complete copyright
|
|
* notice, contact person, and disclaimer.
|
|
*
|
|
* $Revision$
|
|
*********************************************************************EHEADER*/
|
|
/******************************************************************************
|
|
*
|
|
* Header info for the hypre_StructMatrix structures
|
|
*
|
|
*****************************************************************************/
|
|
|
|
#ifndef hypre_STRUCT_MATRIX_HEADER
|
|
#define hypre_STRUCT_MATRIX_HEADER
|
|
|
|
/*--------------------------------------------------------------------------
|
|
* hypre_StructMatrix:
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
typedef struct hypre_StructMatrix_struct
|
|
{
|
|
MPI_Comm comm;
|
|
|
|
hypre_StructGrid *grid;
|
|
hypre_StructStencil *user_stencil;
|
|
hypre_StructStencil *stencil;
|
|
int num_values; /* Number of "stored" coefficients */
|
|
|
|
hypre_BoxArray *data_space;
|
|
|
|
double *data; /* Pointer to matrix data */
|
|
int data_alloced; /* Boolean used for freeing data */
|
|
int data_size; /* Size of matrix data */
|
|
int **data_indices; /* num-boxes by stencil-size array
|
|
of indices into the data array.
|
|
data_indices[b][s] is the starting
|
|
index of matrix data corresponding
|
|
to box b and stencil coefficient s */
|
|
|
|
int symmetric; /* Is the matrix symmetric */
|
|
int *symm_elements;/* Which elements are "symmetric" */
|
|
int num_ghost[6]; /* Num ghost layers in each direction */
|
|
|
|
int global_size; /* Total number of nonzero coeffs */
|
|
|
|
hypre_CommPkg *comm_pkg; /* Info on how to update ghost data */
|
|
|
|
int ref_count;
|
|
|
|
} hypre_StructMatrix;
|
|
|
|
/*--------------------------------------------------------------------------
|
|
* Accessor macros: hypre_StructMatrix
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
#define hypre_StructMatrixComm(matrix) ((matrix) -> comm)
|
|
#define hypre_StructMatrixGrid(matrix) ((matrix) -> grid)
|
|
#define hypre_StructMatrixUserStencil(matrix) ((matrix) -> user_stencil)
|
|
#define hypre_StructMatrixStencil(matrix) ((matrix) -> stencil)
|
|
#define hypre_StructMatrixNumValues(matrix) ((matrix) -> num_values)
|
|
#define hypre_StructMatrixDataSpace(matrix) ((matrix) -> data_space)
|
|
#define hypre_StructMatrixData(matrix) ((matrix) -> data)
|
|
#define hypre_StructMatrixDataAlloced(matrix) ((matrix) -> data_alloced)
|
|
#define hypre_StructMatrixDataSize(matrix) ((matrix) -> data_size)
|
|
#define hypre_StructMatrixDataIndices(matrix) ((matrix) -> data_indices)
|
|
#define hypre_StructMatrixSymmetric(matrix) ((matrix) -> symmetric)
|
|
#define hypre_StructMatrixSymmElements(matrix) ((matrix) -> symm_elements)
|
|
#define hypre_StructMatrixNumGhost(matrix) ((matrix) -> num_ghost)
|
|
#define hypre_StructMatrixGlobalSize(matrix) ((matrix) -> global_size)
|
|
#define hypre_StructMatrixCommPkg(matrix) ((matrix) -> comm_pkg)
|
|
#define hypre_StructMatrixRefCount(matrix) ((matrix) -> ref_count)
|
|
|
|
#define hypre_StructMatrixBox(matrix, b) \
|
|
hypre_BoxArrayBox(hypre_StructMatrixDataSpace(matrix), b)
|
|
|
|
#define hypre_StructMatrixBoxData(matrix, b, s) \
|
|
(hypre_StructMatrixData(matrix) + hypre_StructMatrixDataIndices(matrix)[b][s])
|
|
|
|
#define hypre_StructMatrixBoxDataValue(matrix, b, s, index) \
|
|
(hypre_StructMatrixBoxData(matrix, b, s) + \
|
|
hypre_BoxIndexRank(hypre_StructMatrixBox(matrix, b), index))
|
|
|
|
#endif
|