aboutsummaryrefslogtreecommitdiff
path: root/src/patch/patch.cc
blob: d575f70951a4de71449cd1f8574f56e46ddc2102 (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
// patch.cc -- describes a coordinate/grid patch
// $Id$

//
// patch::patch
// patch::~patch
// z_patch::z_patch
// x_patch::x_patch
// y_patch::y_patch
//
// patch::minmax_ang_ghost_zone
// patch::ghost_zone_on_edge
// patch::ghost_zone_ptr
// patch::patch_frontier_ptr
// patch::setup_mirror_symmetry_ghost_zone
// patch::setup_periodic_symmetry_ghost_zone
// patch::setup_interpatch_ghost_zone
// patch::set_ghost_zone
// patch::minmax_ang_ghost_zone
// patch::ghost_zone_on_edge
// patch::frontier_ptr_on_edge
// patch::edge_adjacent_to_patch
// patch::interpatch_ghost_zone_on_edge
// patch::assert_all_ghost_zones_fully_setup
//
// patch::print_gridfn
//
// patch_info::grid_array_pars
// patch_info::grid_pars
//

#include <stdio.h>
#include <assert.h>
#include <math.h>

#include "jt/stdc.h"
#include "jt/util.hh"
#include "jt/array.hh"
#include "jt/cpm_map.hh"
#include "jt/linear_map.hh"
#include "jt/interpolate.hh"

using jtutil::error_exit;

#include "fp.hh"
#include "coords.hh"
#include "grid.hh"
#include "patch.hh"
#include "patch_edge.hh"
#include "ghost_zone.hh"
#include "patch_frontier.hh"

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

//
// This function constructs a  patch  object.
//
patch::patch(patch_system &my_patch_system_in, int patch_number_in,
	     const char *name_in, bool is_plus_in, char ctype_in,
	     local_coords::coords_set coords_set_rho_in,
	     local_coords::coords_set coords_set_sigma_in,
	     local_coords::coords_set coords_set_tau_in,
	     const grid_arrays::grid_array_pars& grid_array_pars_in,
	     const grid::grid_pars& grid_pars_in)

	: fd_grid(grid_array_pars_in, grid_pars_in),

	  my_patch_system_(my_patch_system_in), patch_number_(patch_number_in),
	  name_(name_in), is_plus_(is_plus_in), ctype_(ctype_in),

	  coords_set_rho_  (coords_set_rho_in  ),
	  coords_set_sigma_(coords_set_sigma_in),
	  coords_set_tau_  (coords_set_tau_in  ),

	  min_rho_patch_edge_(*new patch_edge(*this, side_is_min, side_is_rho)),
	  max_rho_patch_edge_(*new patch_edge(*this, side_is_max, side_is_rho)),
	  min_sigma_patch_edge_(*new patch_edge(*this,
						side_is_min, side_is_sigma)),
	  max_sigma_patch_edge_(*new patch_edge(*this,
						side_is_max, side_is_sigma)),

	  min_rho_ghost_zone_(NULL),
	  max_rho_ghost_zone_(NULL),
	  min_sigma_ghost_zone_(NULL),
	  max_sigma_ghost_zone_(NULL),

	  min_rho_patch_frontier_(NULL),
	  max_rho_patch_frontier_(NULL),
	  min_sigma_patch_frontier_(NULL),
	  max_sigma_patch_frontier_(NULL) // no comma

{ }

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

//
// This function destroys a  patch  object.
//
patch::~patch()
{
// no need to check for null pointers, since  delete NULL  is a silent no-op

delete max_sigma_ghost_zone_;
delete min_sigma_ghost_zone_;
delete max_rho_ghost_zone_;
delete min_rho_ghost_zone_;

delete max_sigma_patch_frontier_;
delete min_sigma_patch_frontier_;
delete max_rho_patch_frontier_;
delete min_rho_patch_frontier_;

delete & max_sigma_patch_edge_;
delete & min_sigma_patch_edge_;
delete & max_rho_patch_edge_;
delete & min_rho_patch_edge_;
}

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

//
// This function constructs a  z_patch  object.
//
z_patch::z_patch(patch_system &my_patch_system_in, int patch_number_in,
		 const char *name_in, bool is_plus_in,
		 const grid_arrays::grid_array_pars& grid_array_pars_in,
		 const grid::grid_pars& grid_pars_in)
	: patch(my_patch_system_in, patch_number_in,
		name_in, is_plus_in, 'z',
		local_coords::set_mu, local_coords::set_nu,
		local_coords::set_phi,
		grid_array_pars_in, grid_pars_in)
{ }

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

//
// This function constructs an  x_patch  object.
//
x_patch::x_patch(patch_system &my_patch_system_in, int patch_number_in,
		 const char *name_in, bool is_plus_in,
		 const grid_arrays::grid_array_pars& grid_array_pars_in,
		 const grid::grid_pars& grid_pars_in)
	: patch(my_patch_system_in, patch_number_in,
		name_in, is_plus_in, 'x',
		local_coords::set_nu, local_coords::set_phi,
		local_coords::set_mu,
		grid_array_pars_in, grid_pars_in)
{ }

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

//
// This function constructs a  y_patch  object.
//
y_patch::y_patch(patch_system &my_patch_system_in, int patch_number_in,
		 const char *name_in, bool is_plus_in,
		 const grid_arrays::grid_array_pars& grid_array_pars_in,
		 const grid::grid_pars& grid_pars_in)
	: patch(my_patch_system_in, patch_number_in,
		name_in, is_plus_in, 'y',
		local_coords::set_mu, local_coords::set_phi,
		local_coords::set_nu,
		grid_array_pars_in, grid_pars_in)
{ }

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

//
// This function returns a reference to the specified ghost zone
// of this patch.
//
ghost_zone& patch::minmax_ang_ghost_zone(bool want_min, bool want_rho)
	const
{
return want_min ? (want_rho ? min_rho_ghost_zone()
			    : min_sigma_ghost_zone())
		: (want_rho ? max_rho_ghost_zone()
			    : max_sigma_ghost_zone());
}

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

//
// This function returns a reference to the specified ghost zone
// of this patch.
//
ghost_zone& patch::ghost_zone_on_edge(const patch_edge &edge)
const
{
assert(& edge.my_patch() == this);
return minmax_ang_ghost_zone(edge.is_min(), edge.is_rho());
}

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

//
// This function returns a reference to the specified ghost zone
// pointer data member of this patch, asserting that the current
// value of this pointer is NULL.  This is used (only) by
//	patch::setup_*_ghost_zone()
// to set the ghost zone pointers; the assert() ensures that it can't
// be used to overwrite a non-NULL pointer.
//
ghost_zone*& patch::ghost_zone_ptr(const patch_edge& edge)
{
assert(& edge.my_patch() == this);

ghost_zone*& gzp = edge.is_min() ? (edge.is_rho() ? min_rho_ghost_zone_
						  : min_sigma_ghost_zone_)
				 : (edge.is_rho() ? max_rho_ghost_zone_
						  : max_sigma_ghost_zone_);
assert(gzp == NULL);
return gzp;
}

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

//
// This function returns a reference to the specified patch frontier
// pointer data member of this patch, asserting that the current
// value of this pointer is NULL.  This is used (only) by the other
// patch's
//	interpatch_ghost_zone::setup_other_frontier()
// to set this patch's patch frontier pointers; the assert() ensures that
// it can't be used to overwrite a non-NULL pointer.
//
patch_frontier*& patch::patch_frontier_ptr(const patch_edge& edge)
{
assert(& edge.my_patch() == this);

patch_frontier*& pfp
	= edge.is_min() ? (edge.is_rho() ? min_rho_patch_frontier_
					 : min_sigma_patch_frontier_)
			: (edge.is_rho() ? max_rho_patch_frontier_
					 : max_sigma_patch_frontier_);
assert(pfp == NULL);
return pfp;
}

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

//
// This function assert()s that a specified ghost zone of this patch
// hasn't already been set up, then sets it up as a mirror-symmetry
// ghost zone.  It returns a reference to the newly-set-up symmetry
// ghost zone object.
//
symmetry_ghost_zone& patch::setup_mirror_symmetry_ghost_zone
	(const patch_edge& my_edge)
{
// make sure we belong to the right patch
assert(& my_edge.my_patch() == this);

symmetry_ghost_zone *temp = new symmetry_ghost_zone(my_edge);
set_ghost_zone(temp, my_edge);
return *temp;
}

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

//
// This function assert()s that a specified ghost zone of this patch
// hasn't already been set up, then sets it up as a periodic-symmetry
// ghost zone.  It returns a reference to the newly-set-up symmetry
// ghost zone object.
//
symmetry_ghost_zone& patch::setup_periodic_symmetry_ghost_zone
	(const patch_edge& my_edge, const patch_edge& symmetry_edge,
	 bool is_ipar_map_plus)
{
// make sure we belong to the right patch
assert(& my_edge.my_patch() == this);

int my_sample_ipar = my_edge.min_ipar_without_corners();
int symmetry_sample_ipar
	= is_ipar_map_plus ? symmetry_edge.min_ipar_without_corners()
			   : symmetry_edge.max_ipar_without_corners();

symmetry_ghost_zone *temp
	= new symmetry_ghost_zone(my_edge,        symmetry_edge,
				  my_sample_ipar, symmetry_sample_ipar,
				  is_ipar_map_plus);
ghost_zone_ptr(my_edge) = temp;
return *temp;
}

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

//
// This function assert()s that a specified ghost zone of this patch
// hasn't already been set up, then sets it up as an interpatch ghost
// zone.  It returns a reference to the newly-set-up interpatch ghost
// zone object.
//
interpatch_ghost_zone& patch::setup_interpatch_ghost_zone
	(const patch_edge& my_edge, const patch_edge& other_edge,
	 int N_overlap_points)
{
// make sure we belong to the right patch
assert(& my_edge.my_patch() == this);

interpatch_ghost_zone *temp
	= new interpatch_ghost_zone(my_edge, other_edge,
				    N_overlap_points);
ghost_zone_ptr(my_edge) = temp;
return *temp;
}

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

//
// This function finds which patch edge is adjacent to a neighboring
// patch q, or does an error_exit() if q isn't actually a neighboring patch.
// The computation is done using only (rho,sigma) coordinate sets and
// min/max dang bounds ==> it's ok to use this function in setting up
// interpatch ghost zones.
//
// Arguments:
// q = The (supposedly) neighboring patch.
// N_overlap_points = The number of grid points these patches overlap.
//		      If this is nonzero, then these patches must have the
//		      same grid spacing in the perpendicular direction.
//
const patch_edge& patch::edge_adjacent_to_patch(const patch& q,
						int N_overlap_points = 0)
	const
{
const patch& p = *this;

// which (rho,sigma) coordinate do the patches have in common?
// ... this is the perp coordinate for the border
const local_coords::coords_set common_coord_set
	= p.coords_set_rho_sigma() & q.coords_set_rho_sigma();

// is this coordinate rho or sigma in each patch?
const bool common_is_p_rho   = common_coord_set == p.coords_set_rho  ();
const bool common_is_p_sigma = common_coord_set == p.coords_set_sigma();
if ((common_is_p_rho ^ common_is_p_sigma) != 0x1)
   then error_exit(ERROR_EXIT,
"***** patch::edge_adjacent_to_patch():\n"
"        common coordinate isn't exactly one of p.{rho,sigma}!\n"
"        p.name()=\"%s\" q.name()=\"%s\"\n"
"        common_coord_set=%s\n"
"        common_is_p_rho=%d common_is_p_sigma=%d\n"
,
		   p.name(), q.name(),
		   local_coords::name_of_coords_set(common_coord_set),
		   int(common_is_p_rho), int(common_is_p_sigma));
								/*NOTREACHED*/
const bool common_is_q_rho   = common_coord_set == q.coords_set_rho  ();
const bool common_is_q_sigma = common_coord_set == q.coords_set_sigma();
if ((common_is_q_rho ^ common_is_q_sigma) != 0x1)
   then error_exit(ERROR_EXIT,
"***** patch::edge_adjacent_to_patch():\n"
"        common coordinate isn't exactly one of q.{rho,sigma}!\n"
"        p.name()=\"%s\" q.name()=\"%s\"\n"
"        common_coord_set=%s\n"
"        common_is_q_rho=%d common_is_q_sigma=%d\n"
,
		   p.name(), q.name(),
		   local_coords::name_of_coords_set(common_coord_set),
		   int(common_is_q_rho), int(common_is_q_sigma));
								/*NOTREACHED*/

// how much do the patches overlap?
if ((N_overlap_points != 0) && fuzzy<fp>::NE(p.delta_dang(common_is_p_rho),
					     q.delta_dang(common_is_q_rho)))
   then error_exit(ERROR_EXIT,
"***** patch::edge_adjacent_to_patch():\n"
"        N_overlap_points != 0 must have same perp grid spacing in both patches!\n"
"        p.name()=\"%s\" q.name()=\"%s\"\n"
"        common_coord_set=%s\n"
"        common_is_p_rho=%d common_is_q_rho=%d\n"
"        p.delta_dang(common_is_p_rho)=%g\n"
"        q.delta_dang(common_is_q_rho)=%g\n"
,
		   p.name(), q.name(),
		   local_coords::name_of_coords_set(common_coord_set),
		   int(common_is_p_rho), int(common_is_q_rho),
		   double(p.delta_dang(common_is_p_rho)),
		   double(q.delta_dang(common_is_q_rho)));	/*NOTREACHED*/
const fp doverlap = fp(N_overlap_points) * p.delta_dang(common_is_p_rho);

// where is the common boundary relative to the min/max sides of each patch?
const bool common_is_p_min_q_max
    = local_coords::fuzzy_EQ_dang(p.min_dang(common_is_p_rho),
				  q.max_dang(common_is_q_rho) - doverlap);
const bool common_is_p_max_q_min
    = local_coords::fuzzy_EQ_dang(p.max_dang(common_is_p_rho),
				  q.min_dang(common_is_q_rho) + doverlap);
if ((common_is_p_min_q_max ^ common_is_p_max_q_min) != 0x1)
   then error_exit(ERROR_EXIT,
"***** patch::edge_adjacent_to_patch():\n"
"        common coordinate isn't exactly one of {pmax/qmin, pmin/qmax}!\n"
"        p.name()=\"%s\" q.name()=\"%s\"\n"
"        common_coord_set=%s\n"
"        common_is_p_rho=%d common_is_q_rho=%d\n"
"        p.delta_dang(common_is_p_rho)=%g\n"
"        q.delta_dang(common_is_q_rho)=%g\n"
"        N_overlap_points=%d doverlap=%g\n"
"        common_is_p_min_q_max=%d common_is_p_max_q_min=%d\n"
,
		   p.name(), q.name(),
		   local_coords::name_of_coords_set(common_coord_set),
		   int(common_is_p_rho), int(common_is_q_rho),
		   double(p.delta_dang(common_is_p_rho)),
		   double(q.delta_dang(common_is_q_rho)),
		   N_overlap_points, double(doverlap),
		   int(common_is_p_min_q_max), int(common_is_p_max_q_min));
								/*NOTREACHED*/

return p.minmax_ang_patch_edge(common_is_p_min_q_max, common_is_p_rho);
}

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

//
// This function verifies that the ghost zone on a specified edge
// is indeed interpatch, and returns a reference to it as an
//  interpatch_ghost_zone .
//
interpatch_ghost_zone& patch::interpatch_ghost_zone_on_edge
	(const patch_edge &e)
	const
{
ghost_zone &g = ghost_zone_on_edge(e);
assert(g.is_interpatch());
return static_cast<interpatch_ghost_zone &>(g);
}

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

//
// This function verifies (via assert()) that all ghost zones of this
// patch, and all frontiers to which they should point, have been fully
// set up.
//
void patch::assert_all_ghost_zones_fully_setup() const
{
assert(min_rho_ghost_zone_ != NULL);
assert(max_rho_ghost_zone_ != NULL);
assert(min_sigma_ghost_zone_ != NULL);
assert(max_sigma_ghost_zone_ != NULL);

// these calls are no-ops for non-interpatch ghost zones
min_rho_ghost_zone().assert_fully_setup();
max_rho_ghost_zone().assert_fully_setup();
min_sigma_ghost_zone().assert_fully_setup();
max_sigma_ghost_zone().assert_fully_setup();
}

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

//
// This function prints a gridfn in ASCII format to an already-open
// stdio stream.  The output format is suitable for a gnuplot 'splot'
// command.  Individual patches may be selected with the  select.patch
// program (perl script).
//
void patch::print_gridfn(int gfn, bool want_ghost_zones,
			 FILE *output_fp = stdout)
	const
{
fprintf(output_fp, "### %s patch\n", name());
fprintf(output_fp, "# gfn=%d\n", gfn);
fprintf(output_fp, "# dpx = %s\n", name_of_dpx());
fprintf(output_fp, "# dpy = %s\n", name_of_dpy());
fprintf(output_fp, "#\n");
fprintf(output_fp, "# dpx\tdpy\tgridfn\tirho\tisigma\n");
	for (int irho = effective_min_irho(want_ghost_zones) ;
	     irho <= effective_max_irho(want_ghost_zones) ;
	     ++irho)
	{
		for (int isigma = effective_min_isigma(want_ghost_zones) ;
		     isigma <= effective_max_isigma(want_ghost_zones) ;
		     ++isigma)
		{
		const fp rho = rho_of_irho(irho);
		const fp sigma = sigma_of_isigma(isigma);
		const fp dpx = dpx_of_rho_sigma(rho, sigma);
		const fp dpy = dpy_of_rho_sigma(rho, sigma);
		fprintf(output_fp,
			"%g\t%g\t%.15g\t%d\t%d\n",
			dpx, dpy, gridfn(gfn,irho,isigma), irho, isigma);
		}
	printf("\n");
	}
}

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

//
// This function computes, and returns a reference to, a
//  struct grid_arrays::grid_array_pars  from the info in a
//  struct patch_info  and the additional information in the arguments.
//
// The result refers to an internal static buffer in this function; the
// usual caveats about lifetimes/overwriting apply.
//
// Arguments:
// 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.
//
const grid_arrays::grid_array_pars& patch_info::grid_array_pars
	(int N_ghost_points,
	 int N_extend_points,
	 fp delta_drho_dsigma)
	const
{
static struct grid_arrays::grid_array_pars grid_array_pars_buffer;

grid_array_pars_buffer.min_irho
	= jtutil::round<fp>::to_integer(min_drho  /delta_drho_dsigma);
grid_array_pars_buffer.min_isigma
	= jtutil::round<fp>::to_integer(min_dsigma/delta_drho_dsigma);
grid_array_pars_buffer.max_irho
	= array_pars.min_irho
	  + jtutil::round<fp>::to_integer(
		(max_drho  -min_drho  ) / delta_drho_dsigma
					 );
grid_array_pars_buffer.max_isigma
	= array_pars.min_isigma
	  + jtutil::round<fp>::to_integer(
		(max_dsigma-min_dsigma) / delta_drho_dsigma
					 );
grid_array_pars_buffer.min_irho   -= N_extend_points;
grid_array_pars_buffer.min_isigma -= N_extend_points;
grid_array_pars_buffer.max_irho   += N_extend_points;
grid_array_pars_buffer.max_isigma += N_extend_points;

grid_array_pars_buffer.min_rho_N_ghost_points = N_ghost_points;
grid_array_pars_buffer.max_rho_N_ghost_points = N_ghost_points;
grid_array_pars_buffer.min_sigma_N_ghost_points = N_ghost_points;
grid_array_pars_buffer.max_sigma_N_ghost_points = N_ghost_points;

return grid_array_pars_buffer;
}
	  }

//******************************************************************************
//
//
// This function computes, and returns a reference to, a
//  struct grid_arrays::grid_pars  from the info in a  struct patch_info
// and the additional information in the arguments.
//
// The result refers to an internal static buffer in this function; the
// usual caveats about lifetimes/overwriting apply.
//
// Arguments:
// N_extend_points = Number of grid points to extend each patch past
//		     "just touching" so as to overlap neighboring patches.
//		     Thus patches overlap by  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.
//
const grid::grid_pars& patch_info::grid_pars(int N_extend_points,
					     fp delta_drho_dsigma)
	const
{
static struct grid::grid_pars grid_pars_buffer;

const fp extend_drho_dsigma = fp(N_extend_points) * delta_drho_dsigma;

grid_pars_buffer.  min_drho   = min_drho   - extend_drho_dsigma;
grid_pars_buffer.delta_drho   = delta_drho_dsigma;
grid_pars_buffer.  max_drho   = max_drho   + extend_drho_dsigma;
grid_pars_buffer.  min_dsigma = min_dsigma - extend_drho_dsigma;
grid_pars_buffer.delta_dsigma = delta_drho_dsigma;
grid_pars_buffer.  max_dsigma = max_dsigma + extend_drho_dsigma;

return grid_pars_buffer;
}
	  }