PLUTO
|
Set up the global and local grids in the three coordinate directions. More...
#include "pluto.h"
Go to the source code of this file.
Macros | |
#define | MAX_ITER 50 |
Functions | |
static void | InitializeGrid (Runtime *, Grid *) |
static void | MakeGrid (int, Runtime *, double *, double *, double *) |
static void | stretch_fun (double, double *, double *, double *) |
void | SetGrid (Runtime *rtime, Grid *GXYZ) |
void | FreeGrid (Grid *grid) |
Set up the global and local grids in the three coordinate directions.
Collects functions for allocating memory and defining grid coordinates.
Definition in file set_grid.c.
#define MAX_ITER 50 |
void FreeGrid | ( | Grid * | grid | ) |
Free array memory allocated previously.
Definition at line 191 of file set_grid.c.
Allocate memory for grid arrays, set shortcut pointers for local grids.
Definition at line 215 of file set_grid.c.
|
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);
Definition at line 273 of file set_grid.c.
[in] | rtime | pointer to a Runtime structure |
[out] | GXYZ | pointer to array of Grid structures |
Definition at line 21 of file set_grid.c.
|
static |