Functions | Variables

prob/linear_wave2d.c File Reference

Problem generator for linear wave convergence tests in 2D. More...

Go to the source code of this file.

Functions

void problem (DomainS *pDomain)
 Problem initial conditions, edited for each problem.
void problem_write_restart (MeshS *pM, FILE *fp)
 Problem specific subroutine for use with writing restart files, Edited for each problem.
void problem_read_restart (MeshS *pM, FILE *fp)
 Problem specific subroutine for use with reading restart files, Edited for each problem.
static Real color (const GridS *pG, const int i, const int j, const int k)
 returns first passively advected scalar s[0]
ConsFun_t get_usr_expr (const char *expr)
 Sets pointer to expression for special output data.
VOutFun_t get_usr_out_fun (const char *name)
 Returns a user defined output function pointer.
void get_eta_user (GridS *pG, int i, int j, int k, Real *eta_O, Real *eta_H, Real *eta_A)
void Userwork_in_loop (MeshS *pM)
 Problem work executed during each step in the main Athena loop, see main.c.
void Userwork_after_loop (MeshS *pM)
 Problem work executed after the main Athena loop, see main.c Edited for each problem.

Variables

static ConsS *** RootSoln = NULL
static int wave_flag

Detailed Description

Problem generator for linear wave convergence tests in 2D.

PURPOSE: Problem generator for linear wave convergence tests in 2D. In 2D, the angle the wave propagates to the grid is automatically computed to be tan^{-1} (X/Y), so that periodic boundary conditions can be used, and the size of the box is automatically rescaled so that the fast wave crossing time (across a diagonal) is one-half, the Alfven wave crossing time is one, and the slow wave crossing time is two.

Note angle=0 or 90 [grid aligned waves] is not allowed in this routine. Use linear_wave1d for grid aligned wave on 1D/2D/3D grids.

Can be used for either standing (problem/vflow=1.0) or travelling (problem/vflow=0.0) waves.

Configure --with-gravity=fft to check Jeans stability of plane waves propagating at an angle to the grid.

Configure --enable-resistivity and/or --with-viscosity=ns to check damping of linear waves by resistivity/ambipolar diffusion and/or viscosity

USERWORK_AFTER_LOOP function computes L1 error norm in solution by comparing to initial conditions. Problem must be evolved for an integer number of wave periods for this to work (only works for ideal MHD). ============================================================================

Definition in file linear_wave2d.c.


Function Documentation

static Real color ( const GridS pG,
const int  i,
const int  j,
const int  k 
) [static]

returns first passively advected scalar s[0]

Definition at line 363 of file linear_wave2d.c.

References ConsS::d, ConsS::s, and GridS::U.

void get_eta_user ( GridS pG,
int  i,
int  j,
int  k,
Real eta_O,
Real eta_H,
Real eta_A 
)

Definition at line 382 of file linear_wave2d.c.

ConsFun_t get_usr_expr ( const char *  expr  ) 

Sets pointer to expression for special output data.

Definition at line 369 of file linear_wave2d.c.

VOutFun_t get_usr_out_fun ( const char *  name  ) 

Returns a user defined output function pointer.

Definition at line 377 of file linear_wave2d.c.

void problem ( DomainS pDomain  ) 
void problem_read_restart ( MeshS pM,
FILE *  fp 
)

Problem specific subroutine for use with reading restart files, Edited for each problem.

Definition at line 354 of file linear_wave2d.c.

void problem_write_restart ( MeshS pM,
FILE *  fp 
)

Problem specific subroutine for use with writing restart files, Edited for each problem.

Definition at line 349 of file linear_wave2d.c.

void Userwork_after_loop ( MeshS pM  ) 

Problem work executed after the main Athena loop, see main.c Edited for each problem.

Definition at line 403 of file linear_wave2d.c.

References ath_error(), ath_fname(), ConsS::B1c, ConsS::B2c, ConsS::B3c, DomainS::Comm_Domain, ConsS::d, MeshS::Domain, ConsS::E, error, DomainS::Grid, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, ConsS::M1, ConsS::M2, ConsS::M3, n, DomainS::Nx, ConsS::s, GridS::U, and wave_flag.

Here is the call graph for this function:

void Userwork_in_loop ( MeshS pM  ) 

Problem work executed during each step in the main Athena loop, see main.c.

Edited for each problem.

Definition at line 393 of file linear_wave2d.c.


Variable Documentation

ConsS*** RootSoln = NULL [static]

Definition at line 39 of file linear_wave2d.c.

int wave_flag [static]

Definition at line 40 of file linear_wave2d.c.

Referenced by problem(), and Userwork_after_loop().