Functions | Variables

prob/cpaw2d.c File Reference

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:

  • B_x = - $ A3 / y$
  • B_y = $ A3 / x$ Then A3 is given in the function below.

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

Detailed Description

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.


Function Documentation

static Real A3 ( const Real  x1,
const Real  x2 
) [static]

Define a scalar potential A3 such that:

  • B_x = - $ A3 / y$
  • B_y = $ A3 / x$ Then A3 is given in the function below.

Definition at line 424 of file cpaw2d.c.

References b_par, b_perp, cos_a, fac, k_par, and sin_a.

Referenced by problem().

Here is the caller graph for this function:

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

Definition at line 296 of file cpaw2d.c.

ConsFun_t get_usr_expr ( const char *  expr  ) 

Sets pointer to expression for special output data.

Definition at line 286 of file cpaw2d.c.

VOutFun_t get_usr_out_fun ( const char *  name  ) 

Returns a user defined output function pointer.

Definition at line 291 of file cpaw2d.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 281 of file cpaw2d.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 276 of file cpaw2d.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 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.

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 307 of file cpaw2d.c.


Variable Documentation

Definition at line 49 of file cpaw2d.c.

Referenced by A1(), A2(), A3(), and problem().

Definition at line 49 of file cpaw2d.c.

Referenced by A1(), A2(), A3(), and problem().

Definition at line 49 of file cpaw2d.c.

Referenced by A3(), grav_pot(), and problem().

Definition at line 49 of file cpaw2d.c.

Referenced by A1(), A2(), A3(), diff_dt(), hyper_diffusion6(), problem(), and Userforce_particle().

Definition at line 50 of file cpaw2d.c.

Referenced by A1(), A2(), A3(), grav_pot(), and problem().

ConsS** RootSoln = NULL [static]

Definition at line 47 of file cpaw2d.c.

Definition at line 49 of file cpaw2d.c.

Referenced by A3(), grav_pot(), and problem().