| 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_SStructMatrix structures
|
|---|
| 18 | *
|
|---|
| 19 | *****************************************************************************/
|
|---|
| 20 |
|
|---|
| 21 | #ifndef hypre_SSTRUCT_MATRIX_HEADER
|
|---|
| 22 | #define hypre_SSTRUCT_MATRIX_HEADER
|
|---|
| 23 |
|
|---|
| 24 | /*--------------------------------------------------------------------------
|
|---|
| 25 | * hypre_SStructMatrix:
|
|---|
| 26 | *--------------------------------------------------------------------------*/
|
|---|
| 27 |
|
|---|
| 28 | typedef struct
|
|---|
| 29 | {
|
|---|
| 30 | MPI_Comm comm;
|
|---|
| 31 | hypre_SStructPGrid *pgrid;
|
|---|
| 32 | hypre_SStructStencil **stencils; /* nvar array of stencils */
|
|---|
| 33 |
|
|---|
| 34 | int nvars;
|
|---|
| 35 | int **smaps;
|
|---|
| 36 | hypre_StructStencil ***sstencils; /* nvar x nvar array of sstencils */
|
|---|
| 37 | hypre_StructMatrix ***smatrices; /* nvar x nvar array of smatrices */
|
|---|
| 38 | int **symmetric; /* Stencil entries symmetric?
|
|---|
| 39 | * (nvar x nvar array) */
|
|---|
| 40 |
|
|---|
| 41 | /* temporary storage for SetValues routines */
|
|---|
| 42 | int sentries_size;
|
|---|
| 43 | int *sentries;
|
|---|
| 44 |
|
|---|
| 45 | int complex; /* Matrix complex? */
|
|---|
| 46 |
|
|---|
| 47 | int ref_count;
|
|---|
| 48 |
|
|---|
| 49 | } hypre_SStructPMatrix;
|
|---|
| 50 |
|
|---|
| 51 | typedef struct hypre_SStructMatrix_struct
|
|---|
| 52 | {
|
|---|
| 53 | MPI_Comm comm;
|
|---|
| 54 | int ndim;
|
|---|
| 55 | hypre_SStructGraph *graph;
|
|---|
| 56 | int ***splits; /* S/U-matrix split for each stencil */
|
|---|
| 57 |
|
|---|
| 58 | /* S-matrix info */
|
|---|
| 59 | int nparts;
|
|---|
| 60 | hypre_SStructPMatrix **pmatrices;
|
|---|
| 61 | int ***symmetric; /* Stencil entries symmetric?
|
|---|
| 62 | * (nparts x nvar x nvar array) */
|
|---|
| 63 |
|
|---|
| 64 | /* U-matrix info */
|
|---|
| 65 | HYPRE_IJMatrix ijmatrix;
|
|---|
| 66 | hypre_ParCSRMatrix *parcsrmatrix;
|
|---|
| 67 |
|
|---|
| 68 | /* temporary storage for SetValues routines */
|
|---|
| 69 | int entries_size;
|
|---|
| 70 | int *Sentries;
|
|---|
| 71 | int *Uentries;
|
|---|
| 72 | HYPRE_BigInt *tmp_col_coords;
|
|---|
| 73 | double *tmp_coeffs;
|
|---|
| 74 |
|
|---|
| 75 | int ns_symmetric; /* Non-stencil entries symmetric? */
|
|---|
| 76 | int complex; /* Matrix complex? */
|
|---|
| 77 | HYPRE_BigInt global_size; /* Total number of nonzero coeffs */
|
|---|
| 78 |
|
|---|
| 79 | int ref_count;
|
|---|
| 80 |
|
|---|
| 81 | /* GEC0902 adding an object type to the matrix */
|
|---|
| 82 | int object_type;
|
|---|
| 83 |
|
|---|
| 84 | } hypre_SStructMatrix;
|
|---|
| 85 |
|
|---|
| 86 | /*--------------------------------------------------------------------------
|
|---|
| 87 | * Accessor macros: hypre_SStructMatrix
|
|---|
| 88 | *--------------------------------------------------------------------------*/
|
|---|
| 89 |
|
|---|
| 90 | #define hypre_SStructMatrixComm(mat) ((mat) -> comm)
|
|---|
| 91 | #define hypre_SStructMatrixNDim(mat) ((mat) -> ndim)
|
|---|
| 92 | #define hypre_SStructMatrixGraph(mat) ((mat) -> graph)
|
|---|
| 93 | #define hypre_SStructMatrixSplits(mat) ((mat) -> splits)
|
|---|
| 94 | #define hypre_SStructMatrixSplit(mat, p, v) ((mat) -> splits[p][v])
|
|---|
| 95 | #define hypre_SStructMatrixNParts(mat) ((mat) -> nparts)
|
|---|
| 96 | #define hypre_SStructMatrixPMatrices(mat) ((mat) -> pmatrices)
|
|---|
| 97 | #define hypre_SStructMatrixPMatrix(mat, part) ((mat) -> pmatrices[part])
|
|---|
| 98 | #define hypre_SStructMatrixSymmetric(mat) ((mat) -> symmetric)
|
|---|
| 99 | #define hypre_SStructMatrixIJMatrix(mat) ((mat) -> ijmatrix)
|
|---|
| 100 | #define hypre_SStructMatrixParCSRMatrix(mat) ((mat) -> parcsrmatrix)
|
|---|
| 101 | #define hypre_SStructMatrixEntriesSize(mat) ((mat) -> entries_size)
|
|---|
| 102 | #define hypre_SStructMatrixSEntries(mat) ((mat) -> Sentries)
|
|---|
| 103 | #define hypre_SStructMatrixUEntries(mat) ((mat) -> Uentries)
|
|---|
| 104 | #define hypre_SStructMatrixTmpColCoords(mat) ((mat) -> tmp_col_coords)
|
|---|
| 105 | #define hypre_SStructMatrixTmpCoeffs(mat) ((mat) -> tmp_coeffs)
|
|---|
| 106 | #define hypre_SStructMatrixNSSymmetric(mat) ((mat) -> ns_symmetric)
|
|---|
| 107 | #define hypre_SStructMatrixComplex(mat) ((mat) -> complex)
|
|---|
| 108 | #define hypre_SStructMatrixGlobalSize(mat) ((mat) -> global_size)
|
|---|
| 109 | #define hypre_SStructMatrixRefCount(mat) ((mat) -> ref_count)
|
|---|
| 110 | #define hypre_SStructMatrixObjectType(mat) ((mat) -> object_type)
|
|---|
| 111 |
|
|---|
| 112 | /*--------------------------------------------------------------------------
|
|---|
| 113 | * Accessor macros: hypre_SStructPMatrix
|
|---|
| 114 | *--------------------------------------------------------------------------*/
|
|---|
| 115 |
|
|---|
| 116 | #define hypre_SStructPMatrixComm(pmat) ((pmat) -> comm)
|
|---|
| 117 | #define hypre_SStructPMatrixPGrid(pmat) ((pmat) -> pgrid)
|
|---|
| 118 | #define hypre_SStructPMatrixStencils(pmat) ((pmat) -> stencils)
|
|---|
| 119 | #define hypre_SStructPMatrixNVars(pmat) ((pmat) -> nvars)
|
|---|
| 120 | #define hypre_SStructPMatrixStencil(pmat, var) ((pmat) -> stencils[var])
|
|---|
| 121 | #define hypre_SStructPMatrixSMaps(pmat) ((pmat) -> smaps)
|
|---|
| 122 | #define hypre_SStructPMatrixSMap(pmat, var) ((pmat) -> smaps[var])
|
|---|
| 123 | #define hypre_SStructPMatrixSStencils(pmat) ((pmat) -> sstencils)
|
|---|
| 124 | #define hypre_SStructPMatrixSStencil(pmat, vi, vj) \
|
|---|
| 125 | ((pmat) -> sstencils[vi][vj])
|
|---|
| 126 | #define hypre_SStructPMatrixSMatrices(pmat) ((pmat) -> smatrices)
|
|---|
| 127 | #define hypre_SStructPMatrixSMatrix(pmat, vi, vj) \
|
|---|
| 128 | ((pmat) -> smatrices[vi][vj])
|
|---|
| 129 | #define hypre_SStructPMatrixSymmetric(pmat) ((pmat) -> symmetric)
|
|---|
| 130 | #define hypre_SStructPMatrixSEntriesSize(pmat) ((pmat) -> sentries_size)
|
|---|
| 131 | #define hypre_SStructPMatrixSEntries(pmat) ((pmat) -> sentries)
|
|---|
| 132 | #define hypre_SStructPMatrixComplex(pmat) ((pmat) -> complex)
|
|---|
| 133 | #define hypre_SStructPMatrixRefCount(pmat) ((pmat) -> ref_count)
|
|---|
| 134 |
|
|---|
| 135 | #endif
|
|---|