| [2aa6644] | 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 | *
|
|---|
| 18 | * Header info for Auxiliary Parallel CSR Matrix data structures
|
|---|
| 19 | *
|
|---|
| 20 | * Note: this matrix currently uses 0-based indexing.
|
|---|
| 21 | *
|
|---|
| 22 | *****************************************************************************/
|
|---|
| 23 |
|
|---|
| 24 | #ifndef hypre_AUX_PARCSR_MATRIX_HEADER
|
|---|
| 25 | #define hypre_AUX_PARCSR_MATRIX_HEADER
|
|---|
| 26 |
|
|---|
| 27 | /*--------------------------------------------------------------------------
|
|---|
| 28 | * Auxiliary Parallel CSR Matrix
|
|---|
| 29 | *--------------------------------------------------------------------------*/
|
|---|
| 30 |
|
|---|
| 31 | typedef struct
|
|---|
| 32 | {
|
|---|
| 33 | int local_num_rows; /* defines number of rows on this processors */
|
|---|
| 34 | int local_num_cols; /* defines number of cols of diag */
|
|---|
| 35 |
|
|---|
| 36 | int need_aux; /* if need_aux = 1, aux_j, aux_data are used to
|
|---|
| 37 | generate the parcsr matrix (default),
|
|---|
| 38 | for need_aux = 0, data is put directly into
|
|---|
| 39 | parcsr structure (requires the knowledge of
|
|---|
| 40 | offd_i and diag_i ) */
|
|---|
| 41 |
|
|---|
| 42 | int *row_length; /* row_length_diag[i] contains number of stored
|
|---|
| 43 | elements in i-th row */
|
|---|
| 44 | int *row_space; /* row_space_diag[i] contains space allocated to
|
|---|
| 45 | i-th row */
|
|---|
| 46 | HYPRE_BigInt **aux_j; /* contains collected column indices */
|
|---|
| 47 | double **aux_data; /* contains collected data */
|
|---|
| 48 | int *indx_diag; /* indx_diag[i] points to first empty space of portion
|
|---|
| 49 | in diag_j , diag_data assigned to row i */
|
|---|
| 50 | int *indx_offd; /* indx_offd[i] points to first empty space of portion
|
|---|
| 51 | in offd_j , offd_data assigned to row i */
|
|---|
| 52 | int max_off_proc_elmts; /* length of off processor stash set for
|
|---|
| 53 | SetValues and AddTOValues */
|
|---|
| 54 | int current_num_elmts; /* current no. of elements stored in stash */
|
|---|
| 55 | int off_proc_i_indx; /* pointer to first empty space in
|
|---|
| 56 | set_off_proc_i_set */
|
|---|
| 57 | HYPRE_BigInt *off_proc_i; /* length 2*num_off_procs_elmts, contains info pairs
|
|---|
| 58 | (code, no. of elmts) where code contains global
|
|---|
| 59 | row no. if SetValues, and (-global row no. -1)
|
|---|
| 60 | if AddToValues*/
|
|---|
| 61 | HYPRE_BigInt *off_proc_j; /* contains column indices */
|
|---|
| 62 | double *off_proc_data; /* contains corresponding data */
|
|---|
| 63 | HYPRE_BigInt *aux_offd_j;/* contains collected column indices for immediate
|
|---|
| 64 | insertion into ParCSRMatrix data structure */
|
|---|
| 65 | } hypre_AuxParCSRMatrix;
|
|---|
| 66 |
|
|---|
| 67 | /*--------------------------------------------------------------------------
|
|---|
| 68 | * Accessor functions for the Parallel CSR Matrix structure
|
|---|
| 69 | *--------------------------------------------------------------------------*/
|
|---|
| 70 |
|
|---|
| 71 | #define hypre_AuxParCSRMatrixLocalNumRows(matrix) ((matrix) -> local_num_rows)
|
|---|
| 72 | #define hypre_AuxParCSRMatrixLocalNumCols(matrix) ((matrix) -> local_num_cols)
|
|---|
| 73 |
|
|---|
| 74 | #define hypre_AuxParCSRMatrixNeedAux(matrix) ((matrix) -> need_aux)
|
|---|
| 75 | #define hypre_AuxParCSRMatrixRowLength(matrix) ((matrix) -> row_length)
|
|---|
| 76 | #define hypre_AuxParCSRMatrixRowSpace(matrix) ((matrix) -> row_space)
|
|---|
| 77 | #define hypre_AuxParCSRMatrixAuxJ(matrix) ((matrix) -> aux_j)
|
|---|
| 78 | #define hypre_AuxParCSRMatrixAuxData(matrix) ((matrix) -> aux_data)
|
|---|
| 79 |
|
|---|
| 80 | #define hypre_AuxParCSRMatrixIndxDiag(matrix) ((matrix) -> indx_diag)
|
|---|
| 81 | #define hypre_AuxParCSRMatrixIndxOffd(matrix) ((matrix) -> indx_offd)
|
|---|
| 82 |
|
|---|
| 83 | #define hypre_AuxParCSRMatrixMaxOffProcElmts(matrix) ((matrix) -> max_off_proc_elmts)
|
|---|
| 84 | #define hypre_AuxParCSRMatrixCurrentNumElmts(matrix) ((matrix) -> current_num_elmts)
|
|---|
| 85 | #define hypre_AuxParCSRMatrixOffProcIIndx(matrix) ((matrix) -> off_proc_i_indx)
|
|---|
| 86 | #define hypre_AuxParCSRMatrixOffProcI(matrix) ((matrix) -> off_proc_i)
|
|---|
| 87 | #define hypre_AuxParCSRMatrixOffProcJ(matrix) ((matrix) -> off_proc_j)
|
|---|
| 88 | #define hypre_AuxParCSRMatrixOffProcData(matrix) ((matrix) -> off_proc_data)
|
|---|
| 89 | #define hypre_AuxParCSRMatrixAuxOffdJ(matrix) ((matrix) -> aux_offd_j)
|
|---|
| 90 |
|
|---|
| 91 | #endif
|
|---|