next up previous contents
Next: Coordinates Up: CartGrid3D Previous: Specifying the Grid Size,   Contents

An Example

Here is an example of setting up a grid using the PUGH unigrid driver. The relevant parts of the parameter file are as follows:

# PUGH
driver::ghost_size = 2
driver::global_nx = 61
driver::global_ny = 61
driver::global_nz = 33

# CartGrid3D
grid::avoid_origin = "no"
grid::domain = "bitant"
grid::type = "byrange"
grid::xmin = -3.0
grid::xmax = +3.0
grid::ymin = -3.0
grid::ymax = +3.0
grid::zmin =  0.0
grid::zmax = +3.0

The resulting Cactus output (describing the grid) is as follows:

INFO (CartGrid3D): Grid Spacings:
INFO (CartGrid3D):  dx=>1.0000000e-01  dy=>1.0000000e-01  dz=>1.0000000e-01  
INFO (CartGrid3D): Computational Coordinates:
INFO (CartGrid3D):  x=>[-3.000, 3.000]  y=>[-3.000, 3.000]  z=>[-0.200, 3.000]  
INFO (CartGrid3D): Indices of Physical Coordinates:
INFO (CartGrid3D):  x=>[0,60]  y=>[0,60]  z=>[2,32]  
INFO (PUGH): Single processor evolution
INFO (PUGH): 3-dimensional grid functions
INFO (PUGH):   Size: 61 61 33

Since there's no symmetry in the $x$ and $y$ directions, the grid is set up just as specified, with floating-point coordinates running from $-3.0$ to $3.0$ inclusive, and 61 grid points with integer grid indices $[0,60]$ (C) or $[1,61]$ (Fortran).

However, in the $z$ direction there's a reflection symmetry across the $z=0$ plane, so the specified range of the grid, $z \in [0.0,3.0]$, is automagically widened to include the symmetry zone of driver::ghost_size = 2 grid points. The grid thus actually includes the range of floating-point coordinates $z \in [-0.2,3.0]$. The original specification of 33 grid points is left alone, however, so the grid points have integer array indices $[0,32]$ (C) or $[1,33]$ (Fortran). The ``physical'' (ie non-symmetry-zone) part of the grid is precisely the originally-specified range, $z \in [0.0,3.0]$, and has the integer array indices $[2,32]$ (C) or $[3,33]$ (Fortran).


next up previous contents
Next: Coordinates Up: CartGrid3D Previous: Specifying the Grid Size,   Contents