source: CIVL/examples/mpi-omp/AMG2013/sstruct_mv/box_map.h@ 397ae5f

main test-branch
Last change on this file since 397ae5f was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 3.8 KB
Line 
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
19#ifndef hypre_BOX_MAP_HEADER
20#define hypre_BOX_MAP_HEADER
21
22
23/*--------------------------------------------------------------------------
24 * hypre_StructMap:
25 *--------------------------------------------------------------------------*/
26
27typedef struct hypre_BoxMapEntry_struct
28{
29 hypre_Index imin;
30 hypre_Index imax;
31
32 /* GEC0902 additional information for ghost calculation in the offset */
33 int num_ghost[6];
34
35 void *info;
36
37 /* link list of hypre_BoxMapEntries, ones on the process listed first. */
38 struct hypre_BoxMapEntry_struct *next;
39
40} hypre_BoxMapEntry;
41
42typedef struct
43{
44 int max_nentries;
45 hypre_Index global_imin;
46 hypre_Index global_imax;
47
48 /* GEC0902 additional information for ghost calculation in the offset */
49 int num_ghost[6];
50
51 int nentries;
52 hypre_BoxMapEntry *entries;
53 hypre_BoxMapEntry **table; /* this points into 'entries' array */
54 hypre_BoxMapEntry *boxproc_table; /* (proc, local_box) table pointer */
55 int *indexes[3];
56 int size[3];
57 int *boxproc_offset;
58
59 int last_index[3];
60
61} hypre_BoxMap;
62
63/*--------------------------------------------------------------------------
64 * Accessor macros: hypre_BoxMap
65 *--------------------------------------------------------------------------*/
66
67#define hypre_BoxMapMaxNEntries(map) ((map) -> max_nentries)
68#define hypre_BoxMapGlobalIMin(map) ((map) -> global_imin)
69#define hypre_BoxMapGlobalIMax(map) ((map) -> global_imax)
70#define hypre_BoxMapNEntries(map) ((map) -> nentries)
71#define hypre_BoxMapEntries(map) ((map) -> entries)
72#define hypre_BoxMapTable(map) ((map) -> table)
73#define hypre_BoxMapBoxProcTable(map) ((map) -> boxproc_table)
74#define hypre_BoxMapBoxProcOffset(map) ((map) -> boxproc_offset)
75#define hypre_BoxMapIndexes(map) ((map) -> indexes)
76#define hypre_BoxMapSize(map) ((map) -> size)
77#define hypre_BoxMapLastIndex(map) ((map) -> last_index)
78#define hypre_BoxMapNumGhost(map) ((map) -> num_ghost)
79
80#define hypre_BoxMapIndexesD(map, d) hypre_BoxMapIndexes(map)[d]
81#define hypre_BoxMapSizeD(map, d) hypre_BoxMapSize(map)[d]
82#define hypre_BoxMapLastIndexD(map, d) hypre_BoxMapLastIndex(map)[d]
83
84#define hypre_BoxMapTableEntry(map, i, j, k) \
85hypre_BoxMapTable(map)[((k*hypre_BoxMapSizeD(map, 1) + j)*\
86 hypre_BoxMapSizeD(map, 0) + i)]
87
88#define hypre_BoxMapBoxProcTableEntry(map, box, proc) \
89hypre_BoxMapBoxProcTable(map)[ box + \
90 hypre_BoxMapBoxProcOffset(map)[proc] ]
91
92/*--------------------------------------------------------------------------
93 * Accessor macros: hypre_BoxMapEntry
94 *--------------------------------------------------------------------------*/
95
96#define hypre_BoxMapEntryIMin(entry) ((entry) -> imin)
97#define hypre_BoxMapEntryIMax(entry) ((entry) -> imax)
98#define hypre_BoxMapEntryInfo(entry) ((entry) -> info)
99#define hypre_BoxMapEntryNumGhost(entry) ((entry) -> num_ghost)
100#define hypre_BoxMapEntryNext(entry) ((entry) -> next)
101
102#endif
Note: See TracBrowser for help on using the repository browser.