Functions | Variables

prob/pgflow.c File Reference

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

Detailed Description

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.


Function Documentation

static double Bfunc ( double  rho  )  [static]

Definition at line 317 of file pgflow.c.

References Gamma, Gamma_1, H, Phi, psi, and S.

Referenced by problem().

Here is the caller graph for this function:

static Real expr_drho ( const Grid *  pG,
const int  i,
const int  j,
const int  k 
) [static]

Computes d-d0 (density - initial value).

Definition at line 328 of file pgflow.c.

References d0.

Gasfun_t get_usr_expr ( const char *  expr  ) 

Sets pointer to expression for special output data.

Definition at line 216 of file pgflow.c.

VGFunout_t get_usr_out_fun ( const char *  name  ) 

Returns a user defined output function pointer.

Definition at line 222 of file pgflow.c.

static Real grav_pot ( const Real  x1,
const Real  x2,
const Real  x3 
) [static]

Definition at line 307 of file pgflow.c.

References cos_a, grav, k_par, and sin_a.

void problem ( Grid *  pGrid,
Domain *  pDomain 
)

Definition at line 69 of file pgflow.c.

References ath_error(), Bfunc(), calloc_3d_array(), cc_pos(), cos_a, d0, E0, Gamma, Gamma_1, grav, H, k_par, lambda, nx1, nx2, nx3, par_getd(), par_geti(), Phi, psi, rho, root, rtbis(), S, sin_a, and StaticGravPot.

Here is the call graph for this function:

void problem_read_restart ( Grid *  pG,
Domain *  pD,
FILE *  fp 
)

Definition at line 211 of file pgflow.c.

void problem_write_restart ( Grid *  pG,
Domain *  pD,
FILE *  fp 
)

Definition at line 206 of file pgflow.c.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void Userwork_after_loop ( Grid *  pGrid,
Domain *  pDomain 
)

Definition at line 230 of file pgflow.c.

void Userwork_in_loop ( Grid *  pGrid,
Domain *  pDomain 
)

Definition at line 226 of file pgflow.c.


Variable Documentation

Real cos_a [static]

Definition at line 44 of file pgflow.c.

Real*** d0 = NULL [static]

Definition at line 49 of file pgflow.c.

Referenced by expr_drho(), and problem().

Real E0 [static]

Definition at line 46 of file pgflow.c.

Referenced by problem().

Real grav [static]

Definition at line 42 of file pgflow.c.

Referenced by grav_pot(), and problem().

Real H [static]

Definition at line 43 of file pgflow.c.

Referenced by Bfunc(), and problem().

Real k_par [static]

Definition at line 45 of file pgflow.c.

Real lambda [static]

Definition at line 45 of file pgflow.c.

Referenced by problem().

Real Phi [static]

Definition at line 43 of file pgflow.c.

Referenced by Bfunc(), and problem().

Real psi [static]

Definition at line 42 of file pgflow.c.

Referenced by Bfunc(), and problem().

int root [static]

Definition at line 48 of file pgflow.c.

Referenced by problem().

Real S [static]

Definition at line 43 of file pgflow.c.

Referenced by Bfunc(), and problem().

Real sin_a [static]

Definition at line 44 of file pgflow.c.