Problem generator for steady planar gravitational flow in a simple 1D gravitational field. More...
Go to the source code of this file.
Functions | |
static int | rtbis (double(*pfun)(double), const double x1, const double x2, const double xacc, const int imax, double *prt) |
Using bisection, find the root of a function "pfun" known to lie between x1 and x2 to an accuracy <= "xacc", but do not exceed "imax" bisections. | |
static Real | grav_pot (const Real x1, const Real x2, const Real x3) |
static double | Bfunc (double rho) |
static Real | expr_drho (const Grid *pG, const int i, const int j, const int k) |
Computes d-d0 (density - initial value). | |
void | problem (Grid *pGrid, Domain *pDomain) |
void | problem_write_restart (Grid *pG, Domain *pD, FILE *fp) |
void | problem_read_restart (Grid *pG, Domain *pD, FILE *fp) |
Gasfun_t | get_usr_expr (const char *expr) |
Sets pointer to expression for special output data. | |
VGFunout_t | get_usr_out_fun (const char *name) |
Returns a user defined output function pointer. | |
void | Userwork_in_loop (Grid *pGrid, Domain *pDomain) |
void | Userwork_after_loop (Grid *pGrid, Domain *pDomain) |
Variables | |
static Real | grav |
static Real | psi |
static Real | H |
static Real | S |
static Real | Phi |
static Real | sin_a |
static Real | cos_a |
static Real | lambda |
static Real | k_par |
static Real | E0 |
static int | root |
static Real *** | d0 = NULL |
Problem generator for steady planar gravitational flow in a simple 1D gravitational field.
PURPOSE: Problem generator for steady planar gravitational flow in a simple 1D gravitational field: g = grav*cos(k_par*x) with periodic boundary conditions. The 1D flow can be initialized in a 3D (x1,x2,x3) domain using the following transformation rules:
This problem is a good test of the source terms in a static grav potential.
PRIVATE FUNCTION PROTOTYPES:
Definition in file pgflow.c.
static double Bfunc | ( | double | rho | ) | [static] |
static Real expr_drho | ( | const Grid * | pG, | |
const int | i, | |||
const int | j, | |||
const int | k | |||
) | [static] |
Gasfun_t get_usr_expr | ( | const char * | expr | ) |
VGFunout_t get_usr_out_fun | ( | const char * | name | ) |
void problem | ( | Grid * | pGrid, | |
Domain * | pDomain | |||
) |
void problem_read_restart | ( | Grid * | pG, | |
Domain * | pD, | |||
FILE * | fp | |||
) |
void problem_write_restart | ( | Grid * | pG, | |
Domain * | pD, | |||
FILE * | fp | |||
) |
int rtbis | ( | double(*)(double) | pfun, | |
const double | x1, | |||
const double | x2, | |||
const double | xacc, | |||
const int | imax, | |||
double * | prt | |||
) | [static] |
Using bisection, find the root of a function "pfun" known to lie between x1 and x2 to an accuracy <= "xacc", but do not exceed "imax" bisections.
The root is returned through the pointer "prt". RETURN VALUE: 0 on Success, 1 on Error ASSUMPTIONS: This routine assumes that a first order zero lies between x1 and x2, i.e. the function is continuous between x1 and x2 and in a sufficiently small neighborhood of the root, the function is monotonic. Written by T. A. Gardiner -- Sept. 24, 2003
Definition at line 251 of file pgflow.c.
References ath_perr().
Referenced by problem().
void Userwork_after_loop | ( | Grid * | pGrid, | |
Domain * | pDomain | |||
) |
Definition at line 49 of file pgflow.c.
Referenced by expr_drho(), and problem().