| 1 | /*BHEADER**********************************************************************
|
|---|
| 2 | * Copyright (c) 2008, Lawrence Livermore National Security, LLC.
|
|---|
| 3 | * Produced at the Lawrence Livermore National Laboratory.
|
|---|
| 4 | * This file is part of HYPRE. See file COPYRIGHT for details.
|
|---|
| 5 | *
|
|---|
| 6 | * HYPRE is free software; you can redistribute it and/or modify it under the
|
|---|
| 7 | * terms of the GNU Lesser General Public License (as published by the Free
|
|---|
| 8 | * Software Foundation) version 2.1 dated February 1999.
|
|---|
| 9 | *
|
|---|
| 10 | * $Revision: 2.4 $
|
|---|
| 11 | ***********************************************************************EHEADER*/
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 | /******************************************************************************
|
|---|
| 15 | *
|
|---|
| 16 | * Header info for the hypre_StructVector structures
|
|---|
| 17 | *
|
|---|
| 18 | *****************************************************************************/
|
|---|
| 19 |
|
|---|
| 20 | #ifndef hypre_STRUCT_VECTOR_HEADER
|
|---|
| 21 | #define hypre_STRUCT_VECTOR_HEADER
|
|---|
| 22 |
|
|---|
| 23 | /*--------------------------------------------------------------------------
|
|---|
| 24 | * hypre_StructVector:
|
|---|
| 25 | *--------------------------------------------------------------------------*/
|
|---|
| 26 |
|
|---|
| 27 | typedef struct hypre_StructVector_struct
|
|---|
| 28 | {
|
|---|
| 29 | MPI_Comm comm;
|
|---|
| 30 |
|
|---|
| 31 | hypre_StructGrid *grid;
|
|---|
| 32 |
|
|---|
| 33 | hypre_BoxArray *data_space;
|
|---|
| 34 |
|
|---|
| 35 | double *data; /* Pointer to vector data */
|
|---|
| 36 | int data_alloced; /* Boolean used for freeing data */
|
|---|
| 37 | int data_size; /* Size of vector data */
|
|---|
| 38 | int *data_indices; /* num-boxes array of indices into
|
|---|
| 39 | the data array. data_indices[b]
|
|---|
| 40 | is the starting index of vector
|
|---|
| 41 | data corresponding to box b. */
|
|---|
| 42 |
|
|---|
| 43 | int num_ghost[6]; /* Num ghost layers in each direction */
|
|---|
| 44 |
|
|---|
| 45 | int global_size; /* Total number coefficients */
|
|---|
| 46 |
|
|---|
| 47 | int OffProcAdd; /* offproc addto value flag */
|
|---|
| 48 |
|
|---|
| 49 | int add_num_ghost[6]; /* ghostlayers to scan for offproc
|
|---|
| 50 | add values */
|
|---|
| 51 |
|
|---|
| 52 | int ref_count;
|
|---|
| 53 |
|
|---|
| 54 | } hypre_StructVector;
|
|---|
| 55 |
|
|---|
| 56 | /*--------------------------------------------------------------------------
|
|---|
| 57 | * Accessor macros: hypre_StructVector
|
|---|
| 58 | *--------------------------------------------------------------------------*/
|
|---|
| 59 |
|
|---|
| 60 | #define hypre_StructVectorComm(vector) ((vector) -> comm)
|
|---|
| 61 | #define hypre_StructVectorGrid(vector) ((vector) -> grid)
|
|---|
| 62 | #define hypre_StructVectorDataSpace(vector) ((vector) -> data_space)
|
|---|
| 63 | #define hypre_StructVectorData(vector) ((vector) -> data)
|
|---|
| 64 | #define hypre_StructVectorDataAlloced(vector) ((vector) -> data_alloced)
|
|---|
| 65 | #define hypre_StructVectorDataSize(vector) ((vector) -> data_size)
|
|---|
| 66 | #define hypre_StructVectorDataIndices(vector) ((vector) -> data_indices)
|
|---|
| 67 | #define hypre_StructVectorNumGhost(vector) ((vector) -> num_ghost)
|
|---|
| 68 | #define hypre_StructVectorGlobalSize(vector) ((vector) -> global_size)
|
|---|
| 69 | #define hypre_StructVectorOffProcAdd(vector) ((vector) -> OffProcAdd)
|
|---|
| 70 | #define hypre_StructVectorAddNumGhost(vector) ((vector) -> add_num_ghost)
|
|---|
| 71 | #define hypre_StructVectorRefCount(vector) ((vector) -> ref_count)
|
|---|
| 72 |
|
|---|
| 73 | #define hypre_StructVectorBox(vector, b) \
|
|---|
| 74 | hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), b)
|
|---|
| 75 |
|
|---|
| 76 | #define hypre_StructVectorBoxData(vector, b) \
|
|---|
| 77 | (hypre_StructVectorData(vector) + hypre_StructVectorDataIndices(vector)[b])
|
|---|
| 78 |
|
|---|
| 79 | #define hypre_StructVectorBoxDataValue(vector, b, index) \
|
|---|
| 80 | (hypre_StructVectorBoxData(vector, b) + \
|
|---|
| 81 | hypre_BoxIndexRank(hypre_StructVectorBox(vector, b), index))
|
|---|
| 82 |
|
|---|
| 83 | #endif
|
|---|