/*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_StructVector structures * *****************************************************************************/ #ifndef hypre_STRUCT_VECTOR_HEADER #define hypre_STRUCT_VECTOR_HEADER /*-------------------------------------------------------------------------- * hypre_StructVector: *--------------------------------------------------------------------------*/ typedef struct hypre_StructVector_struct { MPI_Comm comm; hypre_StructGrid *grid; hypre_BoxArray *data_space; double *data; /* Pointer to vector data */ int data_alloced; /* Boolean used for freeing data */ int data_size; /* Size of vector data */ int *data_indices; /* num-boxes array of indices into the data array. data_indices[b] is the starting index of vector data corresponding to box b. */ int num_ghost[6]; /* Num ghost layers in each direction */ int global_size; /* Total number coefficients */ int ref_count; } hypre_StructVector; /*-------------------------------------------------------------------------- * Accessor macros: hypre_StructVector *--------------------------------------------------------------------------*/ #define hypre_StructVectorComm(vector) ((vector) -> comm) #define hypre_StructVectorGrid(vector) ((vector) -> grid) #define hypre_StructVectorDataSpace(vector) ((vector) -> data_space) #define hypre_StructVectorData(vector) ((vector) -> data) #define hypre_StructVectorDataAlloced(vector) ((vector) -> data_alloced) #define hypre_StructVectorDataSize(vector) ((vector) -> data_size) #define hypre_StructVectorDataIndices(vector) ((vector) -> data_indices) #define hypre_StructVectorNumGhost(vector) ((vector) -> num_ghost) #define hypre_StructVectorGlobalSize(vector) ((vector) -> global_size) #define hypre_StructVectorRefCount(vector) ((vector) -> ref_count) #define hypre_StructVectorBox(vector, b) \ hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), b) #define hypre_StructVectorBoxData(vector, b) \ (hypre_StructVectorData(vector) + hypre_StructVectorDataIndices(vector)[b]) #define hypre_StructVectorBoxDataValue(vector, b, index) \ (hypre_StructVectorBoxData(vector, b) + \ hypre_BoxIndexRank(hypre_StructVectorBox(vector, b), index)) #endif