Functions

prob/field_loop.c File Reference

Problem generator for advection of a field loop test. 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 current (const GridS *pG, const int i, const int j, const int k)
 computes x3-component of current
static Real Bp2 (const GridS *pG, const int i, const int j, const int k)
 computes magnetic pressure (Bx2 + By2)
static Real divB (const GridS *pG, const int i, const int j, const int k)
 calculates div(B)
static Real Temperature (const GridS *pG, const int i, const int j, const int k)
 returns temperature for conduction tests
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 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.

Detailed Description

Problem generator for advection of a field loop test.

PURPOSE: Problem generator for advection of a field loop test. Can only be run in 2D or 3D. Input parameters are:

Various test cases are possible:

A sphere of passive scalar can be added to test advection of scalars.

The temperature in the loop can be changed using drat to test conduction.

REFERENCE: T. Gardiner & J.M. Stone, "An unsplit Godunov method for ideal MHD via constrined transport", JCP, 205, 509 (2005)

Definition in file field_loop.c.


Function Documentation

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

computes magnetic pressure (Bx2 + By2)

Definition at line 361 of file field_loop.c.

References ConsS::B1c, ConsS::B2c, and GridS::U.

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

computes x3-component of current

Definition at line 353 of file field_loop.c.

References GridS::B1i, GridS::B2i, GridS::dx1, and GridS::dx2.

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

calculates div(B)

Definition at line 369 of file field_loop.c.

References GridS::B1i, GridS::B2i, GridS::B3i, GridS::dx1, GridS::dx2, GridS::dx3, and GridS::Nx.

Referenced by problem().

Here is the caller graph for this function:

ConsFun_t get_usr_expr ( const char *  expr  ) 

Sets pointer to expression for special output data.

Definition at line 411 of file field_loop.c.

VOutFun_t get_usr_out_fun ( const char *  name  ) 

Returns a user defined output function pointer.

Definition at line 425 of file field_loop.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 343 of file field_loop.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 338 of file field_loop.c.

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

returns temperature for conduction tests

Definition at line 397 of file field_loop.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 433 of file field_loop.c.

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 429 of file field_loop.c.