hypre/struct_mv/struct_grid.h
baker59 3a9db09b25 Incorporated the box manager into the struct grid and associated struct
routines.  Eliminated the box neighbor structure from the grid.
2006-11-16 19:11:31 +00:00

111 lines
4.5 KiB
C

/*BHEADER**********************************************************************
* Copyright (c) 2006 The Regents of the University of California.
* 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_StructGrid structures
*
*****************************************************************************/
#ifndef hypre_STRUCT_GRID_HEADER
#define hypre_STRUCT_GRID_HEADER
/*--------------------------------------------------------------------------
* hypre_StructGrid:
*--------------------------------------------------------------------------*/
typedef struct hypre_StructGrid_struct
{
MPI_Comm comm;
int dim; /* Number of grid dimensions */
hypre_BoxArray *boxes; /* Array of boxes in this process */
int *ids; /* Unique IDs for boxes */
int max_distance; /* Neighborhood size */
hypre_Box *bounding_box; /* Bounding box around grid */
int local_size; /* Number of grid points locally */
int global_size; /* Total number of grid points */
hypre_Index periodic; /* Indicates if grid is periodic */
int num_periods; /* number of box set periods */
hypre_Index *pshifts; /* shifts of periodicity */
int ref_count;
int ghlocal_size; /* Number of vars in box including ghosts */
int num_ghost[6]; /* ghost layer size for each box */
hypre_BoxManager *box_man;
} hypre_StructGrid;
/*--------------------------------------------------------------------------
* Accessor macros: hypre_StructGrid
*--------------------------------------------------------------------------*/
#define hypre_StructGridComm(grid) ((grid) -> comm)
#define hypre_StructGridDim(grid) ((grid) -> dim)
#define hypre_StructGridBoxes(grid) ((grid) -> boxes)
#define hypre_StructGridIDs(grid) ((grid) -> ids)
#define hypre_StructGridMaxDistance(grid) ((grid) -> max_distance)
#define hypre_StructGridBoundingBox(grid) ((grid) -> bounding_box)
#define hypre_StructGridLocalSize(grid) ((grid) -> local_size)
#define hypre_StructGridGlobalSize(grid) ((grid) -> global_size)
#define hypre_StructGridPeriodic(grid) ((grid) -> periodic)
#define hypre_StructGridNumPeriods(grid) ((grid) -> num_periods)
#define hypre_StructGridPShifts(grid) ((grid) -> pshifts)
#define hypre_StructGridPShift(grid, i) ((grid) -> pshifts[i])
#define hypre_StructGridRefCount(grid) ((grid) -> ref_count)
#define hypre_StructGridGhlocalSize(grid) ((grid) -> ghlocal_size)
#define hypre_StructGridNumGhost(grid) ((grid) -> num_ghost)
#define hypre_StructGridBoxMan(grid) ((grid) -> box_man)
#define hypre_StructGridBox(grid, i) \
(hypre_BoxArrayBox(hypre_StructGridBoxes(grid), i))
#define hypre_StructGridNumBoxes(grid) \
(hypre_BoxArraySize(hypre_StructGridBoxes(grid)))
#define hypre_StructGridIDPeriod(grid) \
hypre_BoxNeighborsIDPeriod(hypre_StructGridNeighbors(grid))
/*--------------------------------------------------------------------------
* Looping macros:
*--------------------------------------------------------------------------*/
#define hypre_ForStructGridBoxI(i, grid) \
hypre_ForBoxI(i, hypre_StructGridBoxes(grid))
#endif