aboutsummaryrefslogtreecommitdiff
path: root/src/include/pGV.h
blob: e8dc3e726a7cf5c6bbfb7dc2b28d33301080c9bb (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
 /*@@
   @header    pGV.h
   @date      Wed Oct 13 01:14:02 CEST 1999  
   @author    Gabrielle Allen
   @desc 
   The Pugh Grid Variable structure. Based heavily on the former pGH.h and pGF.h
   @enddesc 
   @version $Header$
 @@*/

#ifndef _PGV_H_
#define _PGV_H_

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {pgv_none, pgv_scalar, pgv_array, pgv_gf} pgv_type;

typedef struct PConnectivity
{
  int dim;
  int *nprocs;
  int **neighbours;
  int periodic;		/* Is the system periodic? */
} pConnectivity;

typedef struct PGS
{
  int vtype;
  void *data;
} pGS;

typedef struct PGExtras
{
  int	dim;			/* dimension of GA */

  int *nsize;		       /* The global size of the array */

  /* Processor group layouts */
  double   maxskew;		/* Maximum point skew */
  int	  **lb;			/* Lower bound (nprocs X dim) for each proc */
  int	  **ub;			/* Upper bound (same sizes) */
  int	   *lnsize;		/* Size on this processor */
  int	    npoints;		/* LOCAL number of points on this proc. */
  int	   *rnpoints;		/* Number of points on each proc */
  int	  **rnsize;		/* [#points on a proc][in each dir] */

  /* Ghosts and overlaps. */
  int	   *nghostzones;	/* Width of ghost zone */
  int	   *ownership[PUGH_NSTAGGER][2];	
				/* The box owned in each direction. */
				/* [stagger][min/max][dir] */
				
  int	  **ghosts[PUGH_NSTAGGER][2];	
				/* The ghost zones on each face. */
				/* [stagger][min/max][face][dir] */
				
  int	  **overlap[PUGH_NSTAGGER][2];	
				/* The overlap region owned on each face. */
				/* [stagger][min/max][face][ijk] */

} pGExtras;

typedef struct PGA
{
  char	*name;		     /* The name of the grid function */
  int	id;		     /* My ID number in my GH parent. */
  void	*padddata;	     /* Storage for the data. */
  void	*data;		     /* See the note above. */
  /*	 buffer_sz[2*dim] */
  int	*buffer_sz;	     /* Size of the face ghost zones */
  void	**send_buffer;	     /* Storage for buffered Comm if */
  void	**recv_buffer;	     /* we don't use derived types */
  int	commflag;	     /* What is the comm flag set to? */
  /*	 do_comm[2*dim] */
  int	*docomm;	     /* Do we do comm or not? */
  int	storage;	     /* Do we have storage or not? */
  int	stagger;	     /* Only Vertex Centered now... */

  void	*parent;	     /* The GH to which I belong */
			     /* Note this is struct PGH whic is
				typedeffed to pGH in pGH.h, but
				that is included AFTER this so we 
				need the full name for the lookahead
				structure reference thingy.
			     */

  int	varsize;	     /* The size of the data */
  int	vtype;		     /* The type of the data */

#ifdef MPI
  MPI_Request *sreq, *rreq;	 /* Comm requests and statuses. */
  MPI_Status ms;
#endif

  pGExtras *extras;
  pConnectivity *connectivity;
} pGA;

typedef struct PGV
{
  pgv_type type;

  pGS *scalar;
  pGA *array;
} pGV;

#ifdef __cplusplus
}
#endif

#endif