~ubuntu-branches/ubuntu/karmic/hypre/karmic

« back to all changes in this revision

Viewing changes to src/sstruct_mv/sstruct_grid.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2009-03-20 11:40:12 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090320114012-132h6ok9w2r6o609
Tags: 2.4.0b-2
Rebuild against new openmpi.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*BHEADER**********************************************************************
2
 
 * Copyright (c) 2006   The Regents of the University of California.
 
2
 * Copyright (c) 2008,  Lawrence Livermore National Security, LLC.
3
3
 * Produced at the Lawrence Livermore National Laboratory.
4
 
 * Written by the HYPRE team. UCRL-CODE-222953.
5
 
 * All rights reserved.
6
 
 *
7
 
 * This file is part of HYPRE (see http://www.llnl.gov/CASC/hypre/).
8
 
 * Please see the COPYRIGHT_and_LICENSE file for the copyright notice, 
9
 
 * disclaimer, contact information and the GNU Lesser General Public License.
10
 
 *
11
 
 * HYPRE is free software; you can redistribute it and/or modify it under the 
12
 
 * terms of the GNU General Public License (as published by the Free Software
13
 
 * Foundation) version 2.1 dated February 1999.
14
 
 *
15
 
 * HYPRE is distributed in the hope that it will be useful, but WITHOUT ANY 
16
 
 * WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or FITNESS 
17
 
 * FOR A PARTICULAR PURPOSE.  See the terms and conditions of the GNU General
18
 
 * Public License for more details.
19
 
 *
20
 
 * You should have received a copy of the GNU Lesser General Public License
21
 
 * along with this program; if not, write to the Free Software Foundation,
22
 
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
 
 *
24
 
 * $Revision: 2.11 $
 
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.14 $
25
11
 ***********************************************************************EHEADER*/
26
12
 
27
13
 
28
14
 
 
15
 
29
16
/******************************************************************************
30
17
 *
31
18
 * Header info for the hypre_SStructGrid structures
89
76
{
90
77
   hypre_Box    box;
91
78
   int          part;
92
 
   hypre_Index  ilower;
93
 
   hypre_Index  coord;
94
 
   hypre_Index  dir;
95
 
   int          primary;
 
79
   hypre_Index  ilower; /* box ilower, but on the neighbor index-space */
 
80
   hypre_Index  coord;  /* lives on local index-space */
 
81
   hypre_Index  dir;    /* lives on local index-space */
96
82
 
97
83
} hypre_SStructNeighbor;
98
84
 
107
93
   int  type;
108
94
   int  proc;
109
95
   int  offset;
110
 
   int  box;
111
 
  /* GEC0902 ghost offset   */
112
 
   int  ghoffset;
 
96
   int  boxnum;
 
97
   int  ghoffset; /* GEC0902 ghost offset   */
113
98
 
114
99
} hypre_SStructMapInfo;
115
100
 
117
102
{
118
103
   int          type;
119
104
   int          proc;
120
 
   int          offset;  /* minimum offset for this box */
121
 
   int          box;
122
 
   int          ghoffset;  /* GEC0902 minimum offset ghost for this box */
123
 
   int          part;    /* part the box lives on */
124
 
   hypre_Index  ilower;  /* local ilower on neighbor index-space */
125
 
   hypre_Index  coord;   /* lives on local index-space */
126
 
   hypre_Index  dir;     /* lives on neighbor index-space */
127
 
   hypre_Index  stride;  /* lives on local index-space */
 
105
   int          offset;   /* minimum offset for this box */
 
106
   int          boxnum;
 
107
   int          ghoffset; /* GEC0902 minimum offset ghost for this box */
 
108
   int          part;     /* part the box lives on */
 
109
   hypre_Index  ilower;   /* box ilower, but on the neighbor index-space */
 
110
   hypre_Index  coord;    /* lives on local index-space */
 
111
   hypre_Index  dir;      /* lives on local index-space */
 
112
   hypre_Index  stride;   /* lives on local index-space */
128
113
   hypre_Index  ghstride; /* GEC1002 the ghost equivalent of strides */ 
129
114
 
130
115
} hypre_SStructNMapInfo;
131
116
 
 
117
typedef struct
 
118
{
 
119
   hypre_CommInfo  *comm_info;
 
120
   int              send_part;
 
121
   int              recv_part;
 
122
   int              send_var;
 
123
   int              recv_var;
 
124
   
 
125
} hypre_SStructCommInfo;
 
126
 
132
127
typedef struct hypre_SStructGrid_struct
133
128
{
134
129
   MPI_Comm                   comm;
143
138
   hypre_SStructNeighbor    **neighbors;
144
139
   int                      **nvneighbors;
145
140
   hypre_SStructNeighbor   ***vneighbors;
 
141
   hypre_SStructCommInfo    **vnbor_comm_info; /* for updating shared data */
 
142
   int                        vnbor_ncomms;
146
143
 
147
144
   /* u-variables info: During construction, array entries are consecutive.
148
145
    * After 'Assemble', entries are referenced via local cell rank. */
180
177
#define hypre_SStructGridNeighbors(grid)      ((grid) -> neighbors)
181
178
#define hypre_SStructGridNVNeighbors(grid)    ((grid) -> nvneighbors)
182
179
#define hypre_SStructGridVNeighbors(grid)     ((grid) -> vneighbors)
 
180
#define hypre_SStructGridVNborCommInfo(grid)  ((grid) -> vnbor_comm_info)
 
181
#define hypre_SStructGridVNborNComms(grid)    ((grid) -> vnbor_ncomms)
183
182
#define hypre_SStructGridNUCVars(grid)        ((grid) -> nucvars)
184
183
#define hypre_SStructGridUCVars(grid)         ((grid) -> ucvars)
185
184
#define hypre_SStructGridUCVar(grid, i)       ((grid) -> ucvars[i])
233
232
#define hypre_SStructMapInfoType(info)            ((info) -> type)
234
233
#define hypre_SStructMapInfoProc(info)            ((info) -> proc)
235
234
#define hypre_SStructMapInfoOffset(info)          ((info) -> offset)
236
 
#define hypre_SStructMapInfoBox(info)             ((info) -> box)
 
235
#define hypre_SStructMapInfoBoxnum(info)          ((info) -> boxnum)
237
236
#define hypre_SStructMapInfoGhoffset(info)        ((info) -> ghoffset)
238
237
 
239
238
/*--------------------------------------------------------------------------
258
257
#define hypre_SStructNeighborILower(neighbor)  ((neighbor) -> ilower)
259
258
#define hypre_SStructNeighborCoord(neighbor)   ((neighbor) -> coord)
260
259
#define hypre_SStructNeighborDir(neighbor)     ((neighbor) -> dir)
261
 
#define hypre_SStructNeighborPrimary(neighbor) ((neighbor) -> primary)
 
260
 
 
261
/*--------------------------------------------------------------------------
 
262
 * Accessor macros: hypre_SStructCommInfo
 
263
 *--------------------------------------------------------------------------*/
 
264
 
 
265
#define hypre_SStructCommInfoCommInfo(cinfo)  ((cinfo) -> comm_info)
 
266
#define hypre_SStructCommInfoSendPart(cinfo)  ((cinfo) -> send_part)
 
267
#define hypre_SStructCommInfoRecvPart(cinfo)  ((cinfo) -> recv_part)
 
268
#define hypre_SStructCommInfoSendVar(cinfo)   ((cinfo) -> send_var)
 
269
#define hypre_SStructCommInfoRecvVar(cinfo)   ((cinfo) -> recv_var)
262
270
 
263
271
/*--------------------------------------------------------------------------
264
272
 * Accessor macros: hypre_SStructUCVar