Set up the global and local grids in the three coordinate directions. More...
#include "pluto.h"
Functions | |
static void | InitializeGrid (Input *, Grid *) |
static void | MakeGrid (int, Input *, double *, double *, double *) |
void | SetGrid (Input *INI, Grid *GXYZ) |
void | FreeGrid (Grid *grid) |
Collects functions for allocating memory and defining grid coordinates.
void FreeGrid | ( | Grid * | grid | ) |
Free array memory allocated previously.
|
static |
Allocate memory for grid arrays, set shortcut pointers for local grids.
|
static |
Build grid nodes as defined by pluto.ini.
Options are:
'u' = uniform grid, simply defined as
dx = (xR - xL)/npoint, xleft(i) = xl + i*dx, xright(i) = xleft(i) + dx
's' = stretched grid; solve
dx*( 1 + r + r^2 + r^3 + ... r^(N-1)) = xR - xL in the stretching ratio r, provided dx, N, xR and xL are known. dx is taken from the closest uniform grid.
'l+' = logarithmic grid, mesh size increases with x; it is defined as
x + |xL| - xL y = Log[ ------------- ] , with uniform spacing y(i+1/2) - y(i-1/2) = dy |xL| dy = (yR - yL)/N and dx(i) becomes dx(i) = (x(i-) + fabs(xL) - xL)*(10^dy - 1.0); NOTE: xR must be positive and xL can take any value different from 0
'l-' = logarithmic grid, mesh size decreases with x; it is defined as
xR + |xL| - x y = Log[ -------------- ] , with uniform spacing y(i+1/2) - y(i-1/2) = dy |xL| dy = -(yR - yL)/N dx(i) = (x(i-) - fabs(xL) - xR)*(10^dy - 1.0);