Problem generator for 2-D circularly polarized Alfven wave (CPAW) test. More...
Go to the source code of this file.
Functions | |
static Real | A3 (const Real x1, const Real x2) |
Define a scalar potential A3 such that:
| |
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. | |
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 |
Real | fac |
Real | sin_a |
Real | cos_a |
Real | b_par |
Real | b_perp |
Real | k_par |
Problem generator for 2-D circularly polarized Alfven wave (CPAW) test.
PURPOSE: Problem generator for 2-D circularly polarized Alfven wave (CPAW) test. Works for any arbitrary wavevector in the x1-x2 plane. The wave is defined with reference to a coordinate system (x,y,z) with transformation rules to the code coordinate system (x1,x2,x3)
Can be used for either standing (problem/v_par=1.0) or travelling (problem/v_par=0.0) waves.
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.
REFERENCE: G. Toth, "The div(B)=0 constraint in shock capturing MHD codes", JCP, 161, 605 (2000)
Definition in file cpaw2d.c.
ConsFun_t get_usr_expr | ( | const char * | expr | ) |
VOutFun_t get_usr_out_fun | ( | const char * | name | ) |
void problem | ( | DomainS * | pDomain | ) |
Problem initial conditions, edited for each problem.
Definition at line 55 of file cpaw2d.c.
References A3(), ath_error(), ath_pout(), ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, b_par, b_perp, calloc_2d_array(), cc_pos(), cos_a, ConsS::d, d_ind, GridS::dx1, GridS::dx2, ConsS::E, fac, Gamma_1, DomainS::Grid, GridS::ie, GridS::is, GridS::je, GridS::js, k_par, GridS::ke, GridS::ks, lambda, DomainS::Level, ConsS::M1, ConsS::M2, ConsS::M3, n, GridS::Nx, nx1, nx2, par_getd(), par_geti_def(), Q_Hall, DomainS::RootMaxX, DomainS::RootMinX, s, sin_a, Soln, and GridS::U.
void problem_read_restart | ( | MeshS * | pM, | |
FILE * | fp | |||
) |
void problem_write_restart | ( | MeshS * | pM, | |
FILE * | fp | |||
) |
void Userwork_after_loop | ( | MeshS * | pM | ) |
Problem work executed after the main Athena loop, see main.c Edited for each problem.
Definition at line 317 of file cpaw2d.c.
References ath_error(), ConsS::B1c, ConsS::B2c, ConsS::B3c, ConsS::d, MeshS::Domain, ConsS::E, error, DomainS::Grid, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ks, ConsS::M1, ConsS::M2, ConsS::M3, and GridS::U.
void Userwork_in_loop | ( | MeshS * | pM | ) |
Definition at line 49 of file cpaw2d.c.
Referenced by A1(), A2(), A3(), diff_dt(), hyper_diffusion6(), problem(), and Userforce_particle().