| 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 | *
|
|---|
| 17 | * Header info for the hypre_SStructVector structures
|
|---|
| 18 | *
|
|---|
| 19 | *****************************************************************************/
|
|---|
| 20 |
|
|---|
| 21 | #ifndef hypre_SSTRUCT_VECTOR_HEADER
|
|---|
| 22 | #define hypre_SSTRUCT_VECTOR_HEADER
|
|---|
| 23 |
|
|---|
| 24 | /*--------------------------------------------------------------------------
|
|---|
| 25 | * hypre_SStructVector:
|
|---|
| 26 | *--------------------------------------------------------------------------*/
|
|---|
| 27 |
|
|---|
| 28 | typedef struct
|
|---|
| 29 | {
|
|---|
| 30 | MPI_Comm comm;
|
|---|
| 31 | hypre_SStructPGrid *pgrid;
|
|---|
| 32 |
|
|---|
| 33 | int nvars;
|
|---|
| 34 | hypre_StructVector **svectors; /* nvar array of svectors */
|
|---|
| 35 | hypre_CommPkg **comm_pkgs; /* nvar array of comm pkgs */
|
|---|
| 36 |
|
|---|
| 37 | int complex; /* Is the vector complex */
|
|---|
| 38 |
|
|---|
| 39 | int ref_count;
|
|---|
| 40 |
|
|---|
| 41 | int *dataindices; /* GEC1002 array for starting index of the
|
|---|
| 42 | svector. pdataindices[varx] */
|
|---|
| 43 | int datasize; /* Size of the pvector = sums size of svectors */
|
|---|
| 44 |
|
|---|
| 45 | } hypre_SStructPVector;
|
|---|
| 46 |
|
|---|
| 47 | typedef struct hypre_SStructVector_struct
|
|---|
| 48 | {
|
|---|
| 49 | MPI_Comm comm;
|
|---|
| 50 | int ndim;
|
|---|
| 51 | hypre_SStructGrid *grid;
|
|---|
| 52 | int object_type;
|
|---|
| 53 |
|
|---|
| 54 | /* s-vector info */
|
|---|
| 55 | int nparts;
|
|---|
| 56 | hypre_SStructPVector **pvectors;
|
|---|
| 57 | hypre_CommPkg ***comm_pkgs; /* nvar array of comm pkgs */
|
|---|
| 58 |
|
|---|
| 59 | /* u-vector info */
|
|---|
| 60 | HYPRE_IJVector ijvector;
|
|---|
| 61 | hypre_ParVector *parvector;
|
|---|
| 62 |
|
|---|
| 63 | /* GEC10020902 pointer to big chunk of memory and auxiliary information */
|
|---|
| 64 |
|
|---|
| 65 | double *data; /* GEC1002 pointer to chunk data */
|
|---|
| 66 | int *dataindices; /* GEC1002 dataindices[partx] is the starting index
|
|---|
| 67 | of vector data for the part=partx */
|
|---|
| 68 | int datasize ; /* GEC1002 size of all data = ghlocalsize */
|
|---|
| 69 |
|
|---|
| 70 | int complex; /* Is the vector complex */
|
|---|
| 71 | HYPRE_BigInt global_size; /* Total number coefficients */
|
|---|
| 72 |
|
|---|
| 73 | int ref_count;
|
|---|
| 74 |
|
|---|
| 75 | } hypre_SStructVector;
|
|---|
| 76 |
|
|---|
| 77 | /*--------------------------------------------------------------------------
|
|---|
| 78 | * Accessor macros: hypre_SStructVector
|
|---|
| 79 | *--------------------------------------------------------------------------*/
|
|---|
| 80 |
|
|---|
| 81 | #define hypre_SStructVectorComm(vec) ((vec) -> comm)
|
|---|
| 82 | #define hypre_SStructVectorNDim(vec) ((vec) -> ndim)
|
|---|
| 83 | #define hypre_SStructVectorGrid(vec) ((vec) -> grid)
|
|---|
| 84 | #define hypre_SStructVectorObjectType(vec) ((vec) -> object_type)
|
|---|
| 85 | #define hypre_SStructVectorNParts(vec) ((vec) -> nparts)
|
|---|
| 86 | #define hypre_SStructVectorPVectors(vec) ((vec) -> pvectors)
|
|---|
| 87 | #define hypre_SStructVectorPVector(vec, part) ((vec) -> pvectors[part])
|
|---|
| 88 | #define hypre_SStructVectorIJVector(vec) ((vec) -> ijvector)
|
|---|
| 89 | #define hypre_SStructVectorParVector(vec) ((vec) -> parvector)
|
|---|
| 90 | #define hypre_SStructVectorComplex(vec) ((vec) -> complex)
|
|---|
| 91 | #define hypre_SStructVectorGlobalSize(vec) ((vec) -> global_size)
|
|---|
| 92 | #define hypre_SStructVectorRefCount(vec) ((vec) -> ref_count)
|
|---|
| 93 | #define hypre_SStructVectorData(vec) ((vec) -> data )
|
|---|
| 94 | #define hypre_SStructVectorDataIndices(vec) ((vec) -> dataindices)
|
|---|
| 95 | #define hypre_SStructVectorDataSize(vec) ((vec) -> datasize)
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 | /*--------------------------------------------------------------------------
|
|---|
| 99 | * Accessor macros: hypre_SStructPVector
|
|---|
| 100 | *--------------------------------------------------------------------------*/
|
|---|
| 101 |
|
|---|
| 102 | #define hypre_SStructPVectorComm(pvec) ((pvec) -> comm)
|
|---|
| 103 | #define hypre_SStructPVectorPGrid(pvec) ((pvec) -> pgrid)
|
|---|
| 104 | #define hypre_SStructPVectorNVars(pvec) ((pvec) -> nvars)
|
|---|
| 105 | #define hypre_SStructPVectorSVectors(pvec) ((pvec) -> svectors)
|
|---|
| 106 | #define hypre_SStructPVectorSVector(pvec, v) ((pvec) -> svectors[v])
|
|---|
| 107 | #define hypre_SStructPVectorCommPkgs(pvec) ((pvec) -> comm_pkgs)
|
|---|
| 108 | #define hypre_SStructPVectorCommPkg(pvec, v) ((pvec) -> comm_pkgs[v])
|
|---|
| 109 | #define hypre_SStructPVectorComplex(pvec) ((pvec) -> complex)
|
|---|
| 110 | #define hypre_SStructPVectorRefCount(pvec) ((pvec) -> ref_count)
|
|---|
| 111 | #define hypre_SStructPVectorDataIndices(pvec) ((pvec) -> dataindices )
|
|---|
| 112 | #define hypre_SStructPVectorDataSize(pvec) ((pvec) -> datasize )
|
|---|
| 113 |
|
|---|
| 114 | #endif
|
|---|