aboutsummaryrefslogtreecommitdiff
path: root/src/include/pGH.h
blob: ad035989217cdcd8bf66f0f06560052bb94a8750 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
 /*@@
   @header    pGH.h
   @date      Fri Feb 21 10:12:58 1997
   @author    
   @desc 
   The Pugh Grid Hierarchy structure. There isn't much point in having
   a GridHierarchy without GridFunctions, so you'd better see
   @seefile pGF.h also.
   @enddesc 
   @history
   @hauthor Gabrielle Allen
   @hdate Sep 10 @hdesc Added the iteration number on a GH
   @endhistory
   @history
   @hauthor Gabrielle Allen @hdate 26 Sep 1998
   @desc Changed IO parameter names, removed GH->iomode, added t_iopars
        structure
   @hauthor Gabrielle Allen @hdate 17 Oct 1998
   @desc Added more IO parameters to IO structure
        structure
   @hauthor Gabrielle Allen @hdate 3 Nov 1998
   @desc Added forceSync
   @hauthor Thomas Radke @hdate 30 Mar 1999
   @desc Added sync_verbose and comm_time
   @endhistory
   @version $Id$
 @@*/

#include "pugh_constants.h"

typedef struct PGH {

#ifdef MPI
  MPI_Comm PUGH_COMM_WORLD;       /* A MPIcommunicator */
#endif

  /* pGH identifier */
  void   * callerid;

  /* Size of the processor group */
  int    nprocs;		/* Number of processors */
  int    myproc;		/* My processor */
  int    nprocx,nprocy,nprocz;	/* Processor topology */
  int    commmodel;             /* Comm model is PUGH_ALLOCATEDBUFFERS */ 
                                /* or PUGH_DERIVEDTYPES. Currently unused */
  
  /* Size of the problems */
  int    nvariables;		/* # of Grid Functions */
  void   ***variables;		/* Pointers to them */
  int    nx,ny,nz;		/* Physical size of the Problem */
  int    stencil_width;		/* Width of ghost zone */

  /* What time level we're on */
  int timelevel;

  /* Processor group layouts */
  Double maxskew;		/* Maximum point skew */
  int    periodic;		/* Is the system periodic? */
  int  **lb;			/* Lower bound (nprocs X 3) for each proc */
  int  **ub;			/* Upper bound (same sizes) */
  int    lnx, lny, lnz;		/* Size on this processor */
  int    npoints;		/* LOCAL number of points on this proc. */
  int   *rnpoints;		/* Number of points on each proc */
  int   *rnx, *rny, *rnz;	/* Number of points on each proc */
  int  **neighbors;		/* An array of size nprocs X 6 of the
				 * neighbors on each side. The entry in
				 * this array is the processor number of
				 * the neighbor.
				 */
  int stagger;                  /* Is staggering turned on? */
  int spxyz[3];                 /* From what index to start slicing: 1 for octant, */
                                /* nx/2 for box, e.g. Set in SetupSlicingCenter, */ 
                                /* used in Write3D and modfied in in BoxInBox.c ! */
  int forceSync;                 /* force synchronisation of GFs with storage */

  int sp2dxyz[3];		/* Slice point for two d slices. */

  /* Information about ghosts and overlaps. */
  int ownership[PUGH_NSTAGGER][3][2];	/* The box owned in each direction. */
                                        /* Indexing here is  [stagger][ijk][min/max]*/
				
  int ghosts[PUGH_NSTAGGER][6][3][2];	/*  The ghost zones on each face. */
				        /*  Indexing here is  */
				        /*  [stagger][face][ijk][min/max] */
				
  int overlap[PUGH_NSTAGGER][6][3][2];	/*  The overlap region owned on each face. */
				        /*  Indexing here is  */
				        /*  [stagger][face][ijk][min/max] */
				 

  /* Coordinate information */
  /*Double  cx0, cy0, cz0;*/	/* Origin of our system */
  Double  dx0, dy0, dz0, dt0;	/* Delta of our system */
  Double  lx0, ly0, lz0;	/* Processor-Local coordinate origins */
  Double  phys_time;            /* physical time */
  int GHiteration;              /* iteration number on processor */

  
  

  /* currently, all GHs are listed in a single, global GHList */
  /* they are distinguished by a unique combination of level numbers */
  int level;                    /* level in Berger-Oliger stack */
  int mglevel;                  /* level in multigrid stack */
  int convlevel;                /* level in convergence stack */

  int active;                   /* 1 -> GH active; 0 -> GH is skipped for conv.test */
                                /* is used in NanCheckGH.c */

  int sync_verbose;             /* verbose output during synchronization */

  cTimer comm_time;             /* time spent in communication */

#ifdef MPI
  /* Derived data types for communication */
  MPI_Datatype send_dt[PUGH_NSTAGGER][6], recv_dt[PUGH_NSTAGGER][6];
#endif

  /* Extension of this structure can be brought in by thorns */
  /*
#include "pGH_Extensions.h"
  */
} pGH;

#define XDP   1
#define XDM   0
#define YDP   3
#define YDM   2
#define ZDP   5
#define ZDM   4