aboutsummaryrefslogtreecommitdiff
path: root/src/patch/patch_info.hh
blob: 7f58f21e5b0246de5e09a46cc27a86f51b11db83 (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
// patch_info.hh -- POD struct of minimal info varying from one patch to another
// $Id$

//
// prerequisites:
//    <stdio.h>
//    <assert.h>
//    <math.h>
//    "../jtutil/util.hh"
//    "../jtutil//array.hh"
//    "../jtutil/linear_map.hh"
//    "coords.hh"
//    "grid.hh"
//

//*****************************************************************************

//
// This (POD, and hence static-initializable) struct gives a minimal
// set of information which varies from one patch to another.
//
// The member functions allow a patch to be constructed from this struct
// together with the additional information provided by their arguments.
// This doesn't allow the most general possible type of patch (eg it
// constrains all ghost zones to have the same width), but does cover
// the common casees.
//
// Arguments for member functions:
// N_ghost_points = Width in grid points of all ghost zones.
// N_extend_points = Number of grid points to extend each patch past
//		     "just touching" so as to overlap neighboring patches.
//		     Thus patches overlap by
//			N_overlap_points = 2*N_extend_points + 1
//		     grid points.  For example, with N_extend_points == 2,
//		     here are the grid points of two neighboring patches:
//			x   x   x   x   x   X   X
//                                      |
//			        O   O   o   o   o   o   o
//		     Here | marks the "just touching" boundary,
//		     x and o the grid points before this extension,
//		     and X and O the extra grid points added by this
//		     extension.
// delta_drho_dsigma = Grid spacing (both rho and sigma) in degrees.
//
struct	patch_info
	{
	const char* name;
	bool is_plus;
	char ctype;
	fp min_drho, max_drho;
	fp min_dsigma, max_dsigma;

	// compute and return reference to  struct grid_arrays::grid_array_pars
	// ... result refers to internal static buffer;
	//     the usual caveats about lifetimes/overwriting apply
	const grid_arrays::grid_array_pars&
	  grid_array_pars(int N_ghost_points, int N_extend_points,
			  fp delta_drho_dsigma)
		const;

	// compute and return reference to  struct grid::grid_pars
	// ... result refers to internal static buffer;
	//     the usual caveats about lifetimes/overwriting apply
	const grid::grid_pars& grid_pars(int N_extend_points,
					 fp delta_drho_dsigma)
		const;
	};