hypre/sstruct_mv/sstruct_matrix.h
falgout b365889e9f Completed the implementation of SetNeighborBox for all variable types:
- Generalized the Struct communication routines to handle data transformations
- Added more flexibility to Set(Box)Values routines for efficiency.
- Inter-part shared boundary data is now updated appropriately
- Added SetNeighborPart function (to replace SetNeighborBox)
- Added a finite-element-style input file capability for the sstruct driver
- The Split solver can now be used standalone (added to struct/sstruct drivers)
- Added a Jacobi block solver to Split (useful for regression testing)
- Added regression tests for the new SetNeighborPart features
2008-01-23 01:14:45 +00:00

153 lines
6.8 KiB
C

/*BHEADER**********************************************************************
* Copyright (c) 2007, Lawrence Livermore National Security, LLC.
* Produced at the Lawrence Livermore National Laboratory.
* Written by the HYPRE team. UCRL-CODE-222953.
* All rights reserved.
*
* This file is part of HYPRE (see http://www.llnl.gov/CASC/hypre/).
* Please see the COPYRIGHT_and_LICENSE file for the copyright notice,
* disclaimer, contact information and the GNU Lesser General Public License.
*
* HYPRE is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License (as published by the Free Software
* Foundation) version 2.1 dated February 1999.
*
* HYPRE is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the terms and conditions of the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Revision$
***********************************************************************EHEADER*/
/******************************************************************************
*
* Header info for the hypre_SStructMatrix structures
*
*****************************************************************************/
#ifndef hypre_SSTRUCT_MATRIX_HEADER
#define hypre_SSTRUCT_MATRIX_HEADER
/*--------------------------------------------------------------------------
* hypre_SStructMatrix:
*--------------------------------------------------------------------------*/
typedef struct
{
MPI_Comm comm;
hypre_SStructPGrid *pgrid;
hypre_SStructStencil **stencils; /* nvar array of stencils */
int nvars;
int **smaps;
hypre_StructStencil ***sstencils; /* nvar x nvar array of sstencils */
hypre_StructMatrix ***smatrices; /* nvar x nvar array of smatrices */
int **symmetric; /* Stencil entries symmetric?
* (nvar x nvar array) */
/* temporary storage for SetValues routines */
int sentries_size;
int *sentries;
int accumulated; /* AddTo values accumulated? */
int complex; /* Matrix complex? */
int ref_count;
} hypre_SStructPMatrix;
typedef struct hypre_SStructMatrix_struct
{
MPI_Comm comm;
int ndim;
hypre_SStructGraph *graph;
int ***splits; /* S/U-matrix split for each stencil */
/* S-matrix info */
int nparts;
hypre_SStructPMatrix **pmatrices;
int ***symmetric; /* Stencil entries symmetric?
* (nparts x nvar x nvar array) */
/* U-matrix info */
HYPRE_IJMatrix ijmatrix;
hypre_ParCSRMatrix *parcsrmatrix;
/* temporary storage for SetValues routines */
int entries_size;
int *Sentries;
int *Uentries;
int *tmp_col_coords;
double *tmp_coeffs;
int ns_symmetric; /* Non-stencil entries symmetric? */
int complex; /* Matrix complex? */
int global_size; /* Total number of nonzero coeffs */
int ref_count;
/* GEC0902 adding an object type to the matrix */
int object_type;
} hypre_SStructMatrix;
/*--------------------------------------------------------------------------
* Accessor macros: hypre_SStructMatrix
*--------------------------------------------------------------------------*/
#define hypre_SStructMatrixComm(mat) ((mat) -> comm)
#define hypre_SStructMatrixNDim(mat) ((mat) -> ndim)
#define hypre_SStructMatrixGraph(mat) ((mat) -> graph)
#define hypre_SStructMatrixSplits(mat) ((mat) -> splits)
#define hypre_SStructMatrixSplit(mat, p, v) ((mat) -> splits[p][v])
#define hypre_SStructMatrixNParts(mat) ((mat) -> nparts)
#define hypre_SStructMatrixPMatrices(mat) ((mat) -> pmatrices)
#define hypre_SStructMatrixPMatrix(mat, part) ((mat) -> pmatrices[part])
#define hypre_SStructMatrixSymmetric(mat) ((mat) -> symmetric)
#define hypre_SStructMatrixIJMatrix(mat) ((mat) -> ijmatrix)
#define hypre_SStructMatrixParCSRMatrix(mat) ((mat) -> parcsrmatrix)
#define hypre_SStructMatrixEntriesSize(mat) ((mat) -> entries_size)
#define hypre_SStructMatrixSEntries(mat) ((mat) -> Sentries)
#define hypre_SStructMatrixUEntries(mat) ((mat) -> Uentries)
#define hypre_SStructMatrixTmpColCoords(mat) ((mat) -> tmp_col_coords)
#define hypre_SStructMatrixTmpCoeffs(mat) ((mat) -> tmp_coeffs)
#define hypre_SStructMatrixNSSymmetric(mat) ((mat) -> ns_symmetric)
#define hypre_SStructMatrixComplex(mat) ((mat) -> complex)
#define hypre_SStructMatrixGlobalSize(mat) ((mat) -> global_size)
#define hypre_SStructMatrixRefCount(mat) ((mat) -> ref_count)
#define hypre_SStructMatrixObjectType(mat) ((mat) -> object_type)
/*--------------------------------------------------------------------------
* Accessor macros: hypre_SStructPMatrix
*--------------------------------------------------------------------------*/
#define hypre_SStructPMatrixComm(pmat) ((pmat) -> comm)
#define hypre_SStructPMatrixPGrid(pmat) ((pmat) -> pgrid)
#define hypre_SStructPMatrixStencils(pmat) ((pmat) -> stencils)
#define hypre_SStructPMatrixNVars(pmat) ((pmat) -> nvars)
#define hypre_SStructPMatrixStencil(pmat, var) ((pmat) -> stencils[var])
#define hypre_SStructPMatrixSMaps(pmat) ((pmat) -> smaps)
#define hypre_SStructPMatrixSMap(pmat, var) ((pmat) -> smaps[var])
#define hypre_SStructPMatrixSStencils(pmat) ((pmat) -> sstencils)
#define hypre_SStructPMatrixSStencil(pmat, vi, vj) \
((pmat) -> sstencils[vi][vj])
#define hypre_SStructPMatrixSMatrices(pmat) ((pmat) -> smatrices)
#define hypre_SStructPMatrixSMatrix(pmat, vi, vj) \
((pmat) -> smatrices[vi][vj])
#define hypre_SStructPMatrixSymmetric(pmat) ((pmat) -> symmetric)
#define hypre_SStructPMatrixSEntriesSize(pmat) ((pmat) -> sentries_size)
#define hypre_SStructPMatrixSEntries(pmat) ((pmat) -> sentries)
#define hypre_SStructPMatrixAccumulated(pmat) ((pmat) -> accumulated)
#define hypre_SStructPMatrixComplex(pmat) ((pmat) -> complex)
#define hypre_SStructPMatrixRefCount(pmat) ((pmat) -> ref_count)
#endif