Go to the source code of this file.
Functions | |
int | athena_main (int argc, char *argv[]) |
void * | calloc_1d_array (size_t nc, size_t size) |
Construct 1D array = array[nc]. | |
void ** | calloc_2d_array (size_t nr, size_t nc, size_t size) |
Construct 2D array = array[nr][nc]. | |
void *** | calloc_3d_array (size_t nt, size_t nr, size_t nc, size_t size) |
Construct 3D array = array[nt][nr][nc]. | |
void | free_1d_array (void *array) |
Free memory used by 1D array. | |
void | free_2d_array (void *array) |
Free memory used by 2D array. | |
void | free_3d_array (void *array) |
Free memory used by 3D array. | |
void | ath_log_set_level (const int out, const int err) |
Sets "output level" and "error level" from input arguments, global parameters used by many functions in this file. | |
void | ath_log_open (const char *basename, const int lazy, const char *mode) |
Opens output and error log files if "lazy" flag is false (0). | |
void | ath_log_close (void) |
Closes output and error log files. | |
FILE * | athout_fp (void) |
Open output file if needed and return a pointer to file. | |
FILE * | atherr_fp (void) |
Open error file if needed and return a pointer to file. | |
void | ath_flush_out (void) |
Flush output file buffer. | |
void | ath_flush_err (void) |
Flush error file buffer. | |
int | ath_perr (const int level, const char *fmt,...) |
Foutput variable argument string to "error log file". | |
int | ath_pout (const int level, const char *fmt,...) |
Output variable argument string to "output log file". | |
char * | ath_fname (const char *path, const char *basename, const char *levstr, const char *domstr, const int dlen, const int idump, const char *id, const char *ext) |
Creates descriptive output filenames. | |
void | ath_sig_init (void) |
Defines the signal handler function. | |
int | ath_sig_act (int *piquit) |
Handles response to any received signals. | |
void | baton_start (const int Nb, const int tag) |
This function starts off a "Baton Passing" scheme for regulating the maximum number of processes active at a given moment. | |
void | baton_stop (const int Nb, const int tag) |
This function marks the end of a section of code which is regulated by "Baton Passing". | |
void | bvals_mhd_init (MeshS *pM) |
Sets function pointers for physical boundaries during initialization, allocates memory for send/receive buffers with MPI. | |
void | bvals_mhd_fun (DomainS *pD, enum BCDirection dir, VGFun_t prob_bc) |
Sets function ptrs for user-defined BCs. | |
void | bvals_mhd (DomainS *pDomain) |
Calls appropriate functions to set ghost zones. | |
void | ShearingSheet_ix1 (DomainS *pD) |
3D shearing-sheet BCs in x1. | |
void | ShearingSheet_ox1 (DomainS *pD) |
3D shearing-sheet BCs in x1. | |
void | RemapEy_ix1 (DomainS *pD, Real ***emfy, Real **remapEyiib) |
Remaps Ey at [is] due to background shear, and then averages remapped and original field. | |
void | RemapEy_ox1 (DomainS *pD, Real ***emfy, Real **remapEyoib) |
Remaps Ey at [ie+1] due to background shear, and then averages remapped and original field. | |
void | bvals_shear_init (MeshS *pM) |
void | bvals_shear_destruct (void) |
void | Fargo (DomainS *pD) |
Implements FARGO algorithm. | |
void | cc_pos (const GridS *pG, const int i, const int j, const int k, Real *px1, Real *px2, Real *px3) |
given i,j,k returns cell-centered x1,x2,x3 | |
void | fc_pos (const GridS *pG, const int i, const int j, const int k, Real *px1, Real *px2, Real *px3) |
given i,j,k returns face-centered x1,x2,x3 | |
Real | x1vc (const GridS *pG, const int i) |
int | celli (const GridS *pGrid, const Real x, const Real dx1_1, int *i, Real *a) |
given x, returns containing cell first index. | |
Real | x1cc (const GridS *pGrid, const int i) |
int | cellj (const GridS *pGrid, const Real y, const Real dx2_1, int *j, Real *b) |
Real | x2cc (const GridS *pGrid, const int j) |
int | cellk (const GridS *pGrid, const Real z, const Real dx3_1, int *k, Real *c) |
Real | x3cc (const GridS *pGrid, const int k) |
PrimS | Cons_to_Prim (const ConsS *pU) |
Wrapper for the Cons1D_to_Prim1D function, works for both NEWTONIAN and SPECIAL_RELATIVITY. | |
ConsS | Prim_to_Cons (const PrimS *pW) |
Wrapper for the Prim1D_to_Cons1D function, works for both NEWTONIAN and SPECIAL_RELATIVITY. | |
Prim1DS | Cons1D_to_Prim1D (const Cons1DS *pU, const Real *pBx) |
Cons1D_to_Prim1D: NEWTONIAN VERSION. | |
Cons1DS | Prim1D_to_Cons1D (const Prim1DS *pW, const Real *pBx) |
Prim1D_to_Cons1D: NEWTONIAN VERSION. | |
Real | cfast (const Cons1DS *U, const Real *Bx) |
Returns fast magnetosonic speed given input 1D vector of conserved variables and Bx -- NEWTONIAN PHYSICS ONLY. | |
PrimS | check_Prim (const ConsS *pU) |
Wrapper for the check_Prim1D function, works only for SPECIAL_RELATIVITY. | |
PrimS | fix_vsq (const ConsS *pU) |
Wrapper for the fix_vsq1D function, works only for SPECIAL_RELATIVITY && MHD only. | |
PrimS | entropy_fix (const ConsS *pU, const Real *ent) |
Wrapper for the entropy_fix1D function, works only for SPECIAL_RELATIVITY && MHD only. | |
Prim1DS | check_Prim1D (const Cons1DS *pU, const Real *pBx) |
void | init_grid (MeshS *pM) |
Initializes most variables in the Grid structure. | |
void | init_mesh (MeshS *pM) |
General initialization of the nested mesh hierarchy. | |
void | get_myGridIndex (DomainS *pD, const int my_id, int *pi, int *pj, int *pk) |
Searches GData[][][] array to find i,j,k components of block being updated on this processor. | |
void | new_dt (MeshS *pM) |
Computes timestep using CFL condition. | |
void | init_output (MeshS *pM) |
Initializes data output. | |
void | data_output (MeshS *pM, const int flag) |
Called by main(), tests whether time for output, and calls appropriate output functions. | |
void | add_rst_out (OutputS *new_out) |
void | data_output_destruct (void) |
Free all memory associated with Output, called by main() at end of run. | |
void | dump_history_enroll (const ConsFun_t pfun, const char *label) |
Adds new user-defined history variables. | |
Real *** | OutData3 (GridS *pGrid, OutputS *pOut, int *Nx1, int *Nx2, int *Nx3) |
Creates 3D array of output data with dimensions equal to Grid using output expression (function pointer) stored in Output structure. | |
Real ** | OutData2 (GridS *pGrid, OutputS *pOut, int *Nx1, int *Nx2) |
Creates 2D array of output data with two dimensions equal to Grid and one dimension reduced according to range stored in x1l/x1u, etc. | |
Real * | OutData1 (GridS *pGrid, OutputS *pOut, int *Nx1) |
Creates 1D array of output data with one dimensions equal to Grid and two dimensions reduced according to range stored in x1l/x1u, etc. | |
void | output_pdf (MeshS *pM, OutputS *pOut) |
Outputs PDFs. | |
void | output_pgm (MeshS *pM, OutputS *pOut) |
Output 2D PGM image. | |
void | output_ppm (MeshS *pM, OutputS *pOut) |
Output PPM image. | |
void | output_vtk (MeshS *pM, OutputS *pOut) |
Writes VTK file (single variable). | |
void | output_tab (MeshS *pM, OutputS *pOut) |
Open file, call 1D/2D/3D writer; called by data_ouput. | |
void | dump_binary (MeshS *pM, OutputS *pOut) |
Function to write an unformatted dump of the field variables. | |
void | dump_history (MeshS *pM, OutputS *pOut) |
Function to write dumps of scalar "history" variables in a formatted table. | |
void | dump_tab_cons (MeshS *pM, OutputS *pOut) |
Output CONSERVED variables. | |
void | dump_tab_prim (MeshS *pM, OutputS *pOut) |
Output PRIMITIVE variables. | |
void | dump_vtk (MeshS *pM, OutputS *pOut) |
Writes VTK dump (all variables). | |
void | par_open (char *filename) |
Open a parameter file for R/O access. | |
void | par_cmdline (int argc, char *argv[]) |
Parse a commandline, very forgiving (no warnings) when not in the right block/name=value format. | |
int | par_exist (char *block, char *name) |
Return 0 or 1 if a block/name exists. | |
char * | par_gets (char *block, char *name) |
Return a string. | |
int | par_geti (char *block, char *name) |
Return an integer. | |
double | par_getd (char *block, char *name) |
Return a Real value. | |
char * | par_gets_def (char *block, char *name, char *def) |
Return string *name in *block if it exists, else use the string *def as a default value. | |
int | par_geti_def (char *block, char *name, int def) |
Return integer *name in *block if it exists, else use the integer def as a default value. | |
double | par_getd_def (char *block, char *name, double def) |
Return double *name in *block if it exists, else use the double def as a default value. | |
void | par_sets (char *block, char *name, char *sval, char *comment) |
Set or add a string. | |
void | par_seti (char *block, char *name, char *fmt, int ival, char *comment) |
Set or add an integer. | |
void | par_setd (char *block, char *name, char *fmt, double dval, char *comment) |
Set or add a double. | |
void | par_dump (int mode, FILE *fp) |
Debugging aid: print out the current status of all Blocks/Pars. | |
void | par_close (void) |
Close up shop, free memory. | |
void | par_dist_mpi (const int mytid, MPI_Comm comm) |
Distribute the doubly linked list of parsed information to the children. | |
void | problem (DomainS *pD) |
Problem initial conditions, edited for each problem. | |
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. | |
void | problem_read_restart (MeshS *pM, FILE *fp) |
Problem specific subroutine for use with reading restart files, 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. | |
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. | |
PropFun_t | get_usr_par_prop (const char *name) |
Returns a user defined particle selection function. | |
void | gasvshift (const Real x1, const Real x2, const Real x3, Real *u1, Real *u2, Real *u3) |
Gas velocity shift. | |
void | Userforce_particle (Vector *ft, const Real x1, const Real x2, const Real x3, const Real v1, const Real v2, const Real v3) |
void | dump_restart (MeshS *pM, OutputS *pout) |
Writes a restart file, including problem-specific data from a user defined function. | |
void | restart_grids (char *res_file, MeshS *pM) |
Reads nstep, time, dt, and arrays of ConsS and interface B for each of the Grid structures in the restart file. | |
void | show_config (void) |
The packages and features reported on by this functin should be kept consistent with the optional packages and features added by the file configure.ac in the top-level directory. | |
void | show_config_par (void) |
Add the configure block to the parameter database used by the functions in par.c. | |
void | RestrictCorrect (MeshS *pM) |
Restricts (averages) fine Grid solution to coarse, and corrects cells at fine/coarse boundaries using restricted fine Grid fluxes. | |
void | Prolongate (MeshS *pM) |
Sets BC on fine Grid by prolongation (interpolation) of coarse Grid solution into fine grid ghost zones. | |
void | SMR_init (MeshS *pM) |
Allocates memory for send/receive buffers. | |
char * | ath_strdup (const char *in) |
This is really strdup(), but strdup is not available in ANSI (-pendantic or -ansi will leave it undefined in gcc) much like allocate. | |
int | ath_gcd (int a, int b) |
Calculate the Greatest Common Divisor by Euler's method. | |
int | ath_big_endian (void) |
Return 1 if the machine is big endian (e.g. | |
void | ath_bswap (void *vdat, int sizeof_len, int cnt) |
Swap bytes, code stolen from NEMO. | |
void | ath_error (char *fmt,...) |
Terminate execution and output error message Uses variable-length argument lists provided in <stdarg.h> | |
void | minmax1 (Real *data, int nx1, Real *dmin, Real *dmax) |
Return the min and max of a 1D array using registers Works on data of type float, not Real. | |
void | minmax2 (Real **data, int nx2, int nx1, Real *dmin, Real *dmax) |
Return the min and max of a 2D array using registers Works on data of type float, not Real. | |
void | minmax3 (Real ***data, int nx3, int nx2, int nx1, Real *dmin, Real *dmax) |
Return the min and max of a 3D array using registers Works on data of type float, not Real. | |
void | do_nothing_bc (GridS *pG) |
DOES ABSOLUTELY NOTHING! THUS, WHATEVER THE BOUNDARY ARE SET TO INITIALLY, THEY REMAIN FOR ALL TIME. | |
Real | compute_div_b (GridS *pG) |
COMPUTE THE DIVERGENCE OF THE MAGNETIC FIELD USING FACE-CENTERED FIELDS OVER THE ENTIRE ACTIVE GRID. | |
int | sign_change (Real(*func)(const Real, const Real), const Real a0, const Real b0, const Real x, Real *a, Real *b) |
SEARCH FOR A SIGN CHANGE. | |
int | bisection (Real(*func)(const Real, const Real), const Real a0, const Real b0, const Real x, Real *root) |
THIS FUNCTION IMPLEMENTS THE BISECTION METHOD FOR ROOT FINDING. | |
Real | trapzd (Real(*func)(Real), const Real a, const Real b, const int n, const Real s) |
THIS ROUTINE COMPUTES THE nTH STAGE OF REFINEMENT OF AN EXTENDED TRAPEZOIDAL RULE. | |
Real | qsimp (Real(*func)(Real), const Real a, const Real b) |
RETURNS THE INTEGRAL OF THE FUNCTION func FROM a TO b. | |
Real | avg1d (Real(*func)(Real, Real, Real), const GridS *pG, const int i, const int j, const int k) |
RETURNS THE INTEGRAL OF A USER-SUPPLIED FUNCTION func OVER THE ONE- DIMENSIONAL GRID CELL (i,j,k). | |
Real | avg2d (Real(*func)(Real, Real, Real), const GridS *pG, const int i, const int j, const int k) |
RETURNS THE INTEGRAL OF A USER-SUPPLIED FUNCTION func OVER THE TWO- DIMENSIONAL GRID CELL (i,j,k). | |
Real | avg3d (Real(*func)(Real, Real, Real), const GridS *pG, const int i, const int j, const int k) |
RETURNS THE INTEGRAL OF A USER-SUPPLIED FUNCTION func OVER THE THREE-DIMENSIONAL GRID CELL (i,j,k). | |
Real | avgXZ (Real(*func)(Real, Real, Real), const GridS *pG, const int i, const int j, const int k) |
Real | vecpot2b1i (Real(*A2)(Real, Real, Real), Real(*A3)(Real, Real, Real), const GridS *pG, const int i, const int j, const int k) |
Compute B-field components from a vector potential. | |
Real | vecpot2b2i (Real(*A1)(Real, Real, Real), Real(*A3)(Real, Real, Real), const GridS *pG, const int i, const int j, const int k) |
Compute B-field components from a vector potential. | |
Real | vecpot2b3i (Real(*A1)(Real, Real, Real), Real(*A2)(Real, Real, Real), const GridS *pG, const int i, const int j, const int k) |
Compute B-field components from a vector potential. | |
void | InverseMatrix (Real **a, int n, Real **b) |
Inverse matrix solver. | |
void | MatrixMult (Real **a, Real **b, int m, int n, int l, Real **c) |
Matrix multiplication: a(m*n) * b(n*l) = c(m*l). |
void add_rst_out | ( | OutputS * | new_out | ) |
int ath_big_endian | ( | void | ) |
Return 1 if the machine is big endian (e.g.
Sun, PowerPC) return 0 if not (e.g. Intel)
Definition at line 64 of file utils.c.
References n.
Referenced by dump_vtk(), dump_vtksub(), output_vtk_2d(), and output_vtk_3d().
void ath_bswap | ( | void * | vdat, | |
int | sizeof_len, | |||
int | cnt | |||
) |
Swap bytes, code stolen from NEMO.
Definition at line 77 of file utils.c.
Referenced by dump_vtk(), dump_vtksub(), output_vtk_2d(), and output_vtk_3d().
void ath_error | ( | char * | fmt, | |
... | ||||
) |
Terminate execution and output error message Uses variable-length argument lists provided in <stdarg.h>
Definition at line 118 of file utils.c.
References atherr_fp().
Referenced by add_par_line(), advect_particles(), allocate(), ath_2d_fft_create_plan(), ath_2d_fft_quick_plan(), ath_3d_fft_create_plan(), baton_start(), baton_stop(), bisection(), bvals_grav_init(), bvals_mhd_init(), calloc_1d_array(), calloc_2d_array(), calloc_3d_array(), change_rundir(), compute_l1_error(), conduction_init(), dump_binary(), dump_history_enroll(), dump_parhistory_enroll(), dump_particle_binary(), dump_restart(), dump_tab_cons(), dump_tab_prim(), dump_vtk(), dump_vtksub(), exchange_feedback(), exchange_feedback_init(), Fargo(), fluxes(), get_gasinfo(), get_myGridIndex(), getPC(), getShockVars(), grav_acc(), grav_pot(), init_grid(), init_mesh(), init_output(), init_particle(), initialize(), integrate_2d_vl(), integrate_3d_vl(), integrate_destruct(), integrate_diff_init(), integrate_init(), integrate_init_1d(), integrate_init_2d(), integrate_init_3d(), Integrate_Particles(), line_block_name(), lr_states_init(), ludcmp(), main(), multig_3d(), my_strdup(), out_ktab(), OutData1(), OutData2(), OutData3(), output_pdf(), output_pgm(), output_ppm(), output_tab_1d(), output_tab_2d(), output_tab_3d(), output_vtk(), output_vtk_2d(), output_vtk_3d(), OutputModeAmplitude(), par_cmdline(), par_dist_mpi(), par_exist(), par_getsl(), par_open(), parse_slice(), particle_realloc(), perturb(), problem(), Prolongate(), qsimp(), realloc_recvbuf(), realloc_sendbuf(), recv_ix1_feedback(), recv_ix2_feedback(), recv_ix3_feedback(), recv_ox1_feedback(), recv_ox2_feedback(), recv_ox3_feedback(), resistivity_init(), restart_grids(), RestrictCorrect(), selfg_fft_obc_3d(), selfg_init(), selfg_multig_1d(), selfg_multig_2d(), selfg_multig_3d(), selfg_multig_3d_init(), send_ix1_feedback(), send_ix2_feedback(), send_ix3_feedback(), send_ox1_feedback(), send_ox2_feedback(), send_ox3_feedback(), set_bvals_particle(), set_mg_bvals(), setFluxes(), shearingbox_ix1_particle(), shearingbox_ox1_particle(), SMR_init(), swap_mg_ix1(), swap_mg_ix2(), swap_mg_ix3(), swap_mg_ox1(), swap_mg_ox2(), swap_mg_ox3(), Userwork_after_loop(), Userwork_in_loop(), and viscosity_init().
void ath_flush_err | ( | void | ) |
Flush error file buffer.
Definition at line 233 of file ath_log.c.
References ath_fp_err, and open_err_flag.
Referenced by main().
void ath_flush_out | ( | void | ) |
Flush output file buffer.
Definition at line 218 of file ath_log.c.
References ath_fp_out, and open_out_flag.
Referenced by main().
char* ath_fname | ( | const char * | path, | |
const char * | basename, | |||
const char * | levstr, | |||
const char * | domstr, | |||
const int | dlen, | |||
const int | idump, | |||
const char * | id, | |||
const char * | ext | |||
) |
Creates descriptive output filenames.
Creates filenames with form
Used by most of the dump_*() and output_*() functions.
Definition at line 41 of file ath_files.c.
Referenced by compute_l1_error(), dump_binary(), dump_history(), dump_particle_binary(), dump_restart(), dump_tab_cons(), dump_tab_prim(), dump_vtk(), dump_vtksub(), out_ktab(), output_pdf(), output_pgm(), output_ppm(), output_tab_1d(), output_tab_2d(), output_tab_3d(), output_vtk_2d(), output_vtk_3d(), and Userwork_after_loop().
int ath_gcd | ( | int | a, | |
int | b | |||
) |
void ath_log_close | ( | void | ) |
Closes output and error log files.
Definition at line 172 of file ath_log.c.
References ath_fp_err, ath_fp_out, err_fname, open_err_flag, open_out_flag, and out_fname.
Referenced by main().
void ath_log_open | ( | const char * | basename, | |
const int | lazy, | |||
const char * | mode | |||
) |
Opens output and error log files if "lazy" flag is false (0).
If "lazy" is true, then the ath_log_open() call does not actually open the files, but rather prepares to open them on the first invocation of either ath_pout() ath_perr(), athout_fp() or atherr_fp(). This is useful for parallel jobs where the children, if made sufficiently quiet would otherwise generate a large number of empty files. -- T. A. Gardiner --
Definition at line 133 of file ath_log.c.
References ath_log_err_open(), ath_log_out_open(), err_fname, log_mode, open_err_flag, open_out_flag, and out_fname.
Referenced by main().
void ath_log_set_level | ( | const int | out, | |
const int | err | |||
) |
Sets "output level" and "error level" from input arguments, global parameters used by many functions in this file.
Called from main(), where the parameters are parsed from athinput.
Definition at line 114 of file ath_log.c.
References err_level, and out_level.
Referenced by main().
int ath_perr | ( | const int | level, | |
const char * | fmt, | |||
... | ||||
) |
Foutput variable argument string to "error log file".
Should be used in place of printf(stderr,...)
Definition at line 250 of file ath_log.c.
References ath_fp_err, ath_log_err_open(), err_level, and open_err_flag.
Referenced by ath_strdup(), bvals_grav_fun(), bvals_mhd_fun(), bvals_mhd_init(), change_rundir(), dump_history(), dump_particle_history(), dump_restart(), exchange_feedback_fun(), exchange_feedback_init(), fluxes(), Get_Drag(), Get_Term(), getexpr(), getRGB(), init_output(), OutData1(), OutData2(), output_pdf(), problem(), rtbis(), set_bvals_particle_fun(), set_bvals_particle_init(), usage(), and Userwork_after_loop().
int ath_pout | ( | const int | level, | |
const char * | fmt, | |||
... | ||||
) |
Output variable argument string to "output log file".
Should be used in place of printf(stdout,...)
Definition at line 277 of file ath_log.c.
References ath_fp_out, ath_log_out_open(), open_out_flag, and out_level.
Referenced by ath_sig_act(), data_output_destruct(), init_output(), Integrate_Particles(), main(), problem(), realloc_recvbuf(), realloc_sendbuf(), show_config(), and shuffle().
int ath_sig_act | ( | int * | piquit | ) |
Handles response to any received signals.
At the moment, only response to SIGTERM is implemented.
Definition at line 50 of file ath_signal.c.
References ath_pout(), and sig_caught.
Referenced by main().
void ath_sig_init | ( | void | ) |
Defines the signal handler function.
Definition at line 39 of file ath_signal.c.
References handler().
Referenced by main().
char * ath_strdup | ( | const char * | in | ) |
This is really strdup(), but strdup is not available in ANSI (-pendantic or -ansi will leave it undefined in gcc) much like allocate.
Definition at line 35 of file utils.c.
References ath_perr().
Referenced by dump_history_enroll(), dump_parhistory_enroll(), main(), and my_strdup().
int athena_main | ( | int | argc, | |
char * | argv[] | |||
) |
FILE* atherr_fp | ( | void | ) |
Open error file if needed and return a pointer to file.
Definition at line 205 of file ath_log.c.
References ath_fp_err, ath_log_err_open(), and open_err_flag.
Referenced by ath_error().
FILE* athout_fp | ( | void | ) |
Open output file if needed and return a pointer to file.
Definition at line 192 of file ath_log.c.
References ath_fp_out, ath_log_out_open(), and open_out_flag.
Referenced by main().
Real avg1d | ( | Real(*)(Real, Real, Real) | func, | |
const GridS * | pG, | |||
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
RETURNS THE INTEGRAL OF A USER-SUPPLIED FUNCTION func OVER THE ONE- DIMENSIONAL GRID CELL (i,j,k).
INTEGRATION IS PERFORMED USING qsimp. ADAPTED FROM NUMERICAL RECIPES BY AARON SKINNER
Definition at line 688 of file utils.c.
References cc_pos(), GridS::dx1, fx(), nrfunc, and qsimp().
Referenced by problem().
Real avg2d | ( | Real(*)(Real, Real, Real) | func, | |
const GridS * | pG, | |||
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
RETURNS THE INTEGRAL OF A USER-SUPPLIED FUNCTION func OVER THE TWO- DIMENSIONAL GRID CELL (i,j,k).
INTEGRATION IS PERFORMED USING qsimp. ADAPTED FROM NUMERICAL RECIPES BY AARON SKINNER
Definition at line 715 of file utils.c.
References cc_pos(), GridS::dx1, GridS::dx2, fy(), nrfunc, and qsimp().
Referenced by cyladvect_ix1(), cyladvect_ox1(), cylbr_ix1(), cylbr_ox1(), and problem().
Real avg3d | ( | Real(*)(Real, Real, Real) | func, | |
const GridS * | pG, | |||
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
RETURNS THE INTEGRAL OF A USER-SUPPLIED FUNCTION func OVER THE THREE-DIMENSIONAL GRID CELL (i,j,k).
INTEGRATION IS PERFORMED USING qsimp. ADAPTED FROM NUMERICAL RECIPES BY AARON SKINNER
Definition at line 742 of file utils.c.
References cc_pos(), GridS::dx1, GridS::dx2, GridS::dx3, fz(), nrfunc, and qsimp().
Real avgXZ | ( | Real(*)(Real, Real, Real) | func, | |
const GridS * | pG, | |||
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
Definition at line 761 of file utils.c.
References cc_pos(), GridS::dx1, GridS::dx3, fXZ(), nrfunc, and qsimp().
void baton_start | ( | const int | Nb, | |
const int | tag | |||
) |
This function starts off a "Baton Passing" scheme for regulating the maximum number of processes active at a given moment.
NOTES on baton_start() and baton_stop():
The values for Nb and tag MUST be the same in the call to baton_start() and in baton_stop().
This function starts off a "Baton Passing" scheme for regulating the maximum number of processes active at a given moment. It works by handing out Nb batons to the first (0 -> Nb-1) ranks. Then ranks (Nb -> 2Nb-1) wait for a signal from the ranks (0 -> Nb-1) which is sent by the baton_stop() function and so the process continues until all of the MPI ranks have completed.
Definition at line 46 of file baton.c.
References ath_error().
Referenced by change_rundir().
void baton_stop | ( | const int | Nb, | |
const int | tag | |||
) |
This function marks the end of a section of code which is regulated by "Baton Passing".
It signals the next process to start, i.e. it hands off the Baton.
Definition at line 76 of file baton.c.
References ath_error().
Referenced by change_rundir().
void bvals_mhd | ( | DomainS * | pD | ) |
Calls appropriate functions to set ghost zones.
The function pointers (*(pD->???_BCFun)) are set by bvals_init() to be either a user-defined function, or one of the functions corresponding to reflecting, periodic, or outflow. If the left- or right-Grid ID numbers are >= 1 (neighboring grids exist), then MPI calls are used.
Order for updating boundary conditions must always be x1-x2-x3 in order to fill the corner cells properly
Definition at line 174 of file bvals_mhd.c.
References DomainS::Comm_Domain, get_myGridIndex(), DomainS::Grid, DomainS::ix1_BCFun, DomainS::ix2_BCFun, DomainS::ix3_BCFun, GridS::lx1_id, GridS::lx2_id, GridS::lx3_id, myID_Comm_world, DomainS::NGrid, GridS::Nx, DomainS::ox1_BCFun, DomainS::ox2_BCFun, DomainS::ox3_BCFun, pack_ix1(), pack_ix2(), pack_ix3(), pack_ox1(), pack_ox2(), pack_ox3(), par_geti_def(), recv_buf, recv_rq, GridS::rx1_id, GridS::rx2_id, GridS::rx3_id, send_buf, send_rq, ShearingSheet_ix1(), ShearingSheet_ox1(), unpack_ix1(), unpack_ix2(), unpack_ix3(), unpack_ox1(), unpack_ox2(), and unpack_ox3().
Referenced by main().
void bvals_mhd_fun | ( | DomainS * | pD, | |
enum BCDirection | dir, | |||
VGFun_t | prob_bc | |||
) |
Sets function ptrs for user-defined BCs.
Definition at line 915 of file bvals_mhd.c.
References ath_perr(), DomainS::ix1_BCFun, DomainS::ix2_BCFun, DomainS::ix3_BCFun, left_x1, left_x2, left_x3, DomainS::ox1_BCFun, DomainS::ox2_BCFun, DomainS::ox3_BCFun, right_x1, right_x2, and right_x3.
Referenced by problem(), and problem_read_restart().
void bvals_mhd_init | ( | MeshS * | pM | ) |
Sets function pointers for physical boundaries during initialization, allocates memory for send/receive buffers with MPI.
Definition at line 514 of file bvals_mhd.c.
References ath_error(), ath_perr(), MeshS::BCFlag_ix1, MeshS::BCFlag_ix2, MeshS::BCFlag_ix3, MeshS::BCFlag_ox1, MeshS::BCFlag_ox2, MeshS::BCFlag_ox3, calloc_1d_array(), calloc_2d_array(), DomainS::Disp, MeshS::Domain, MeshS::DomainsPerLevel, DomainS::GData, get_myGridIndex(), DomainS::Grid, GridsDataS::ID_Comm_Domain, DomainS::ix1_BCFun, DomainS::ix2_BCFun, DomainS::ix3_BCFun, GridS::lx1_id, GridS::lx2_id, GridS::lx3_id, myID_Comm_world, n, DomainS::NGrid, MeshS::NLevels, GridsDataS::Nx, MeshS::Nx, DomainS::Nx, GridS::Nx, DomainS::ox1_BCFun, DomainS::ox2_BCFun, DomainS::ox3_BCFun, recv_buf, recv_rq, GridS::rx1_id, GridS::rx2_id, GridS::rx3_id, send_buf, and send_rq.
Referenced by main().
void bvals_shear_destruct | ( | void | ) |
void bvals_shear_init | ( | MeshS * | pM | ) |
void* calloc_1d_array | ( | size_t | nc, | |
size_t | size | |||
) |
Construct 1D array = array[nc].
Definition at line 36 of file ath_array.c.
References ath_error().
Referenced by bvals_grav_init(), bvals_mhd_init(), dump_particle_history(), dump_restart(), init_grid(), init_mesh(), init_particle(), integrate_init_1d(), InverseMatrix(), ludcmp(), MultiNSH(), OutData1(), problem(), problem_read_restart(), set_bvals_particle_init(), and SMR_init().
void** calloc_2d_array | ( | size_t | nr, | |
size_t | nc, | |||
size_t | size | |||
) |
Construct 2D array = array[nr][nc].
Definition at line 51 of file ath_array.c.
References ath_error().
Referenced by bvals_grav_init(), bvals_mhd_init(), dump_particle_history(), Fargo(), init_grid(), integrate_init_2d(), integrate_init_3d(), lr_states_init(), MultiNSH(), OutData2(), problem(), and SMR_init().
void*** calloc_3d_array | ( | size_t | nt, | |
size_t | nr, | |||
size_t | nc, | |||
size_t | size | |||
) |
Construct 3D array = array[nt][nr][nc].
Definition at line 78 of file ath_array.c.
References ath_error().
Referenced by conduction_init(), dump_binary(), dump_vtk(), Fargo(), init_grid(), init_mesh(), init_particle(), initialize(), integrate_init_3d(), multig_3d(), OutData3(), problem(), resistivity_init(), selfg_fft_obc_3d(), selfg_multig_3d(), selfg_multig_3d_init(), SMR_init(), and viscosity_init().
void cc_pos | ( | const GridS * | pG, | |
const int | i, | |||
const int | j, | |||
const int | k, | |||
Real * | px1, | |||
Real * | px2, | |||
Real * | px3 | |||
) |
given i,j,k returns cell-centered x1,x2,x3
Definition at line 36 of file cc_pos.c.
References GridS::dx1, GridS::dx2, GridS::dx3, GridS::is, GridS::js, GridS::ks, and GridS::MinX.
Referenced by avg1d(), avg2d(), avg3d(), avgXZ(), compute_div_b(), compute_l1_error(), constant_iib(), constant_oib(), cylbr_ix1(), cylbr_ox1(), disk_ir(), disk_or(), dmrbv_ijb(), dmrbv_ojb(), dump_binary(), dump_history(), dump_tab_cons(), dump_tab_prim(), dump_vtksub(), expr_beta(), expr_dV2(), expr_dV3(), expr_dV3par(), expr_dVx(), expr_dVxpar(), expr_dVy(), expr_dVypar(), expr_KE(), expr_ME(), expr_rhodif(), expr_rhopardif(), Fargo(), hst_dBy(), hst_dEw2(), hst_E_total(), hst_rho_dVy2(), hst_rho_Vx_dVy(), integrate_1d_ctu(), integrate_1d_vl(), integrate_2d_ctu(), integrate_2d_vl(), integrate_3d_ctu(), integrate_3d_vl(), jet_iib(), MdotR1(), MdotR2(), MdotR3(), MdotR4(), new_dt(), noh3d_oib(), noh3d_ojb(), noh3d_okb(), outflow_ix1(), outflow_ix3(), outflow_ox1(), outflow_ox2(), outflow_ox3(), problem(), selfg_multig_3d(), Userwork_after_loop(), Userwork_in_loop(), vecpot2b1i(), vecpot2b2i(), vecpot2b3i(), viscosity(), and Volume().
given x, returns containing cell first index.
Definition at line 86 of file cc_pos.c.
Referenced by getwei_linear(), getwei_QP(), and getwei_TSC().
Returns fast magnetosonic speed given input 1D vector of conserved variables and Bx -- NEWTONIAN PHYSICS ONLY.
Definition at line 470 of file convert_var.c.
References Cons1DS::By, Cons1DS::Bz, Cons1DS::d, Cons1DS::E, Gamma, Gamma_1, Iso_csound2, Cons1DS::Mx, Cons1DS::My, and Cons1DS::Mz.
Referenced by integrate_2d_ctu(), integrate_2d_vl(), integrate_3d_ctu(), and integrate_3d_vl().
Wrapper for the check_Prim1D function, works only for SPECIAL_RELATIVITY.
Definition at line 327 of file convert_var.c.
References PrimS::B1c, ConsS::B1c, PrimS::B2c, ConsS::B2c, PrimS::B3c, ConsS::B3c, Prim1DS::By, Cons1DS::By, Prim1DS::Bz, Cons1DS::Bz, check_Prim1D(), Cons1D_to_Prim1D(), Prim1DS::d, PrimS::d, ConsS::d, Cons1DS::d, ConsS::E, Cons1DS::E, ConsS::M1, ConsS::M2, ConsS::M3, Cons1DS::Mx, Cons1DS::My, Cons1DS::Mz, n, Prim1DS::P, PrimS::P, Prim1DS::r, PrimS::r, ConsS::s, Cons1DS::s, U, PrimS::V1, PrimS::V2, PrimS::V3, Prim1DS::Vx, Prim1DS::Vy, Prim1DS::Vz, and W.
Referenced by integrate_1d_vl(), integrate_2d_vl(), integrate_3d_vl(), and ProCon().
COMPUTE THE DIVERGENCE OF THE MAGNETIC FIELD USING FACE-CENTERED FIELDS OVER THE ENTIRE ACTIVE GRID.
RETURNS THE MAXIMUM OF |DIV B|.
Definition at line 218 of file utils.c.
References GridS::B1i, GridS::B2i, GridS::B3i, cc_pos(), GridS::dx1, GridS::dx2, GridS::dx3, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, and GridS::ks.
Referenced by problem(), and Userwork_in_loop().
Cons1D_to_Prim1D: NEWTONIAN VERSION.
Cons1D_to_Prim1D: SPECIAL RELATIVISTIC HYDRODYNAMICS VERSION.
Definition at line 512 of file convert_var.c.
References Prim1DS::d, Cons1DS::d, Cons1DS::E, Gamma, Gamma_1, Cons1DS::Mx, Cons1DS::My, Cons1DS::Mz, Prim1DS::P, Prim1DS::Vx, Prim1DS::Vy, and Prim1DS::Vz.
Referenced by check_Prim(), Cons_to_Prim(), fluxes(), integrate_1d_ctu(), integrate_1d_vl(), integrate_2d_ctu(), integrate_2d_vl(), integrate_3d_ctu(), and integrate_3d_vl().
Wrapper for the Cons1D_to_Prim1D function, works for both NEWTONIAN and SPECIAL_RELATIVITY.
Definition at line 104 of file convert_var.c.
References PrimS::B1c, ConsS::B1c, PrimS::B2c, ConsS::B2c, PrimS::B3c, ConsS::B3c, Prim1DS::By, Cons1DS::By, Prim1DS::Bz, Cons1DS::Bz, Cons1D_to_Prim1D(), Prim1DS::d, PrimS::d, ConsS::d, Cons1DS::d, ConsS::E, Cons1DS::E, ConsS::M1, ConsS::M2, ConsS::M3, Cons1DS::Mx, Cons1DS::My, Cons1DS::Mz, n, Prim1DS::P, PrimS::P, Prim1DS::r, PrimS::r, ConsS::s, Cons1DS::s, U, PrimS::V1, PrimS::V2, PrimS::V3, Prim1DS::Vx, Prim1DS::Vy, Prim1DS::Vz, and W.
Referenced by dump_binary(), dump_history(), dump_tab_prim(), dump_vtk(), expr_G(), integrate_1d_vl(), integrate_2d_vl(), and integrate_3d_vl().
void data_output | ( | MeshS * | pM, | |
const int | flag | |||
) |
Called by main(), tests whether time for output, and calls appropriate output functions.
Setting the input argument flag=1 forces a write of all output's. If the input argument flag=0, then only those output's whose next output time has passed will be written.
Definition at line 498 of file output.c.
References OutputS::dt, OutputS::n, n, OutputS::num, out_count, OutputS::out_fun, par_setd(), par_seti(), particle_to_grid(), OutputS::res_fun, rst_flag, OutputS::t, and MeshS::time.
Referenced by main().
void data_output_destruct | ( | void | ) |
Free all memory associated with Output, called by main() at end of run.
Definition at line 576 of file output.c.
References ath_pout(), OutputS::dat_fmt, OutputS::gmax, OutputS::gmin, OutputS::id, OutputS::out, out_count, OutputS::out_fmt, and rst_flag.
Referenced by main().
void do_nothing_bc | ( | GridS * | pG | ) |
DOES ABSOLUTELY NOTHING! THUS, WHATEVER THE BOUNDARY ARE SET TO INITIALLY, THEY REMAIN FOR ALL TIME.
Definition at line 205 of file utils.c.
Referenced by problem(), and problem_read_restart().
Function to write an unformatted dump of the field variables.
Definition at line 30 of file dump_binary.c.
References ath_error(), ath_fname(), calloc_3d_array(), cc_pos(), Cons_to_Prim(), GridS::Coup, MeshS::Domain, MeshS::DomainsPerLevel, GridS::dt, free_3d_array(), Gamma_1, DomainS::Grid, GPCouple::grid_d, GPCouple::grid_v1, GPCouple::grid_v2, GPCouple::grid_v3, GridS::ie, il, GridS::is, Iso_csound, iu, GridS::je, jl, GridS::js, ju, GridS::ke, kl, GridS::ks, ku, n, OutputS::ndomain, OutputS::nlevel, MeshS::NLevels, OutputS::num, GridS::Nx, OutputS::out, OutputS::out_pargrid, MeshS::outfilename, GridS::Phi, GridS::time, GridS::U, and W.
Function to write dumps of scalar "history" variables in a formatted table.
Definition at line 94 of file dump_history.c.
References ath_fname(), ath_perr(), ConsS::B1c, ConsS::B2c, ConsS::B3c, cc_pos(), DomainS::Comm_Domain, Cons_to_Prim(), ConsS::d, d1, OutputS::dat_fmt, MeshS::Domain, MeshS::DomainsPerLevel, MeshS::dt, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, DomainS::Grid, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, ConsS::M1, ConsS::M2, ConsS::M3, DomainS::MaxX, DomainS::MinX, myID_Comm_world, n, MeshS::NLevels, OutputS::num, DomainS::Nx, MeshS::outfilename, GridS::Phi, phst_fun, ConsS::s, MeshS::time, GridS::U, usr_hst_cnt, usr_label, and W.
void dump_history_enroll | ( | const ConsFun_t | pfun, | |
const char * | label | |||
) |
Adds new user-defined history variables.
Definition at line 475 of file dump_history.c.
References ath_error(), ath_strdup(), phst_fun, usr_hst_cnt, and usr_label.
Referenced by initialize(), problem(), and problem_read_restart().
Writes a restart file, including problem-specific data from a user defined function.
Definition at line 430 of file restart.c.
References alamcoeff, ath_error(), ath_fname(), ath_perr(), GridS::B1i, GridS::B2i, GridS::B3i, calloc_1d_array(), ConsS::d, MeshS::Domain, MeshS::DomainsPerLevel, MeshS::dt, ConsS::E, free_1d_array(), DomainS::Grid, GridS::grproperty, grrhoa, GridS::ie, Grain_Property::integrator, GridS::is, GridS::je, GridS::js, kb, GridS::ke, GridS::ks, Grain_Property::m, ConsS::M1, ConsS::M2, ConsS::M3, n, MeshS::NLevels, GridS::nparticle, MeshS::nstep, OutputS::num, MeshS::outfilename, par_dump(), par_setd(), par_seti(), GridS::particle, GridS::partypes, problem_write_restart(), Grain_Property::rad, Grain_Property::rho, ConsS::s, MeshS::time, tstop0, and GridS::U.
Output CONSERVED variables.
Definition at line 36 of file dump_tab.c.
References ath_error(), ath_fname(), ConsS::B1c, ConsS::B2c, ConsS::B3c, cc_pos(), GridS::Coup, ConsS::d, OutputS::dat_fmt, MeshS::Domain, MeshS::DomainsPerLevel, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, DomainS::Grid, GPCouple::grid_d, GPCouple::grid_v1, GPCouple::grid_v2, GPCouple::grid_v3, GridS::ie, il, GridS::is, iu, GridS::je, jl, GridS::js, ju, GridS::ke, kl, GridS::ks, ku, ConsS::M1, ConsS::M2, ConsS::M3, n, OutputS::ndomain, OutputS::nlevel, MeshS::NLevels, OutputS::num, GridS::Nx, OutputS::out_pargrid, MeshS::outfilename, GridS::Phi, ConsS::s, MeshS::time, and GridS::U.
Output PRIMITIVE variables.
Definition at line 281 of file dump_tab.c.
References ath_error(), ath_fname(), PrimS::B1c, PrimS::B2c, PrimS::B3c, cc_pos(), Cons_to_Prim(), GridS::Coup, PrimS::d, d1, OutputS::dat_fmt, MeshS::Domain, MeshS::DomainsPerLevel, GridS::dx1, GridS::dx2, GridS::dx3, DomainS::Grid, GPCouple::grid_d, GPCouple::grid_v1, GPCouple::grid_v2, GPCouple::grid_v3, GridS::ie, il, GridS::is, iu, GridS::je, jl, GridS::js, ju, GridS::ke, kl, GridS::ks, ku, n, OutputS::ndomain, OutputS::nlevel, MeshS::NLevels, OutputS::num, GridS::Nx, OutputS::out_pargrid, MeshS::outfilename, PrimS::P, GridS::Phi, PrimS::r, MeshS::time, GridS::U, PrimS::V1, PrimS::V2, PrimS::V3, and W.
Writes VTK dump (all variables).
Definition at line 28 of file dump_vtk.c.
References ath_big_endian(), ath_bswap(), ath_error(), ath_fname(), ConsS::B1c, ConsS::B2c, ConsS::B3c, calloc_3d_array(), Cons_to_Prim(), GridS::Coup, d(), ConsS::d, data, MeshS::Domain, MeshS::DomainsPerLevel, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, free_3d_array(), DomainS::Grid, GPCouple::grid_d, GPCouple::grid_v1, GPCouple::grid_v2, GPCouple::grid_v3, GridS::ie, il, GridS::is, iu, GridS::je, jl, GridS::js, ju, GridS::ke, kl, GridS::ks, ku, ConsS::M1, ConsS::M2, ConsS::M3, GridS::MinX, n, OutputS::ndomain, OutputS::nlevel, MeshS::NLevels, OutputS::num, GridS::Nx, OutputS::out, OutputS::out_pargrid, MeshS::outfilename, GridS::Phi, r, ConsS::s, GridS::time, GridS::U, PrimS::V1, PrimS::V2, PrimS::V3, and W.
Wrapper for the entropy_fix1D function, works only for SPECIAL_RELATIVITY && MHD only.
Definition at line 271 of file convert_var.c.
References PrimS::B1c, ConsS::B1c, PrimS::B2c, ConsS::B2c, PrimS::B3c, ConsS::B3c, Prim1DS::By, Cons1DS::By, Prim1DS::Bz, Cons1DS::Bz, Prim1DS::d, PrimS::d, ConsS::d, Cons1DS::d, ConsS::E, Cons1DS::E, entropy_fix1D(), ConsS::M1, ConsS::M2, ConsS::M3, Cons1DS::Mx, Cons1DS::My, Cons1DS::Mz, n, Prim1DS::P, PrimS::P, Prim1DS::r, PrimS::r, ConsS::s, Cons1DS::s, U, PrimS::V1, PrimS::V2, PrimS::V3, Prim1DS::Vx, Prim1DS::Vy, Prim1DS::Vz, and W.
Referenced by integrate_2d_vl(), and integrate_3d_vl().
void Fargo | ( | DomainS * | pD | ) |
Implements FARGO algorithm.
Only works in 3D or 2D xy. Called in the main loop after the integrator (and before bvals_mhd). Written in Munich 24-27.4.2008
Allocates memory for temporary arrays/buffers
Definition at line 1973 of file bvals_shear.c.
References ath_error(), ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, bvals_shear_destruct(), bvals_shear_init(), calloc_2d_array(), calloc_3d_array(), cc_pos(), DomainS::Comm_Domain, CourNo, ConsS::d, MeshS::Domain, MeshS::DomainsPerLevel, GridS::dt, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, FargoFlx, Flx, free_2d_array(), free_3d_array(), GhstZnsBuf, DomainS::Grid, GridS::ie, GridS::is, Iso_csound, GridS::je, jl, GridS::js, ju, GridS::ke, GridS::ks, ku, GridS::lx2_id, ConsS::M1, ConsS::M2, ConsS::M3, n, NFARGO, nfghost, DomainS::NGrid, MeshS::NLevels, NREMAP, GridS::Nx, nx1, nx2, nx3, Omega_0, OrbitalProfile, qshear, GridS::r, r, recv_buf, RemapFlux(), GridS::ri, ri, MeshS::RootMaxX, MeshS::RootMinX, GridS::rx2_id, FConsS::s, ConsS::s, s, send_buf, tEyBuf, U, GridS::U, FConsS::U, Uhalf, xmax, and xmin.
Referenced by main().
void fc_pos | ( | const GridS * | pG, | |
const int | i, | |||
const int | j, | |||
const int | k, | |||
Real * | px1, | |||
Real * | px2, | |||
Real * | px3 | |||
) |
given i,j,k returns face-centered x1,x2,x3
Definition at line 51 of file cc_pos.c.
References GridS::dx1, GridS::dx2, GridS::dx3, GridS::is, GridS::js, GridS::ks, and GridS::MinX.
Referenced by OutData1(), and OutData2().
Wrapper for the fix_vsq1D function, works only for SPECIAL_RELATIVITY && MHD only.
Definition at line 216 of file convert_var.c.
References PrimS::B1c, ConsS::B1c, PrimS::B2c, ConsS::B2c, PrimS::B3c, ConsS::B3c, Prim1DS::By, Cons1DS::By, Prim1DS::Bz, Cons1DS::Bz, Prim1DS::d, PrimS::d, ConsS::d, Cons1DS::d, ConsS::E, Cons1DS::E, ConsS::M1, ConsS::M2, ConsS::M3, Cons1DS::Mx, Cons1DS::My, Cons1DS::Mz, n, Prim1DS::P, PrimS::P, Prim1DS::r, PrimS::r, ConsS::s, Cons1DS::s, U, PrimS::V1, PrimS::V2, PrimS::V3, vsq1D_fix(), Prim1DS::Vx, Prim1DS::Vy, Prim1DS::Vz, and W.
Referenced by integrate_1d_vl(), integrate_2d_vl(), and integrate_3d_vl().
void free_1d_array | ( | void * | array | ) |
Free memory used by 1D array.
Definition at line 125 of file ath_array.c.
Referenced by dump_restart(), init_grid(), init_mesh(), integrate_destruct_1d(), out_ktab(), output_tab_1d(), particle_destruct(), and problem().
void free_2d_array | ( | void * | array | ) |
Free memory used by 2D array.
Definition at line 133 of file ath_array.c.
Referenced by dump_particle_history(), Fargo(), integrate_destruct_2d(), integrate_destruct_3d(), lr_states_destruct(), MultiNSH(), output_pgm(), output_ppm(), output_tab_2d(), output_vtk_2d(), and problem().
void free_3d_array | ( | void * | array | ) |
Free memory used by 3D array.
Definition at line 144 of file ath_array.c.
Referenced by conduction_destruct(), dump_binary(), dump_vtk(), Fargo(), init_grid(), integrate_destruct_3d(), multig_3d(), output_tab_3d(), output_vtk_3d(), particle_destruct(), problem(), resistivity_destruct(), selfg_multig_3d(), and viscosity_destruct().
Gas velocity shift.
Definition at line 195 of file firehose.c.
References omgx1, omgx2, omgx3, x1c, x2c, and x3c.
Referenced by feedback_predictor(), Get_Drag(), and Get_Term().
void get_myGridIndex | ( | DomainS * | pD, | |
const int | myID, | |||
int * | pi, | |||
int * | pj, | |||
int * | pk | |||
) |
Searches GData[][][] array to find i,j,k components of block being updated on this processor.
Definition at line 861 of file init_mesh.c.
References ath_error(), DomainS::GData, GridsDataS::ID_Comm_world, and DomainS::NGrid.
Referenced by bvals_grav(), bvals_grav_init(), bvals_mhd(), bvals_mhd_init(), exchange_feedback_init(), grid_limit(), init_grid(), integrate_3d_ctu(), RemapEy_ix1(), RemapEy_ox1(), set_bvals_particle_init(), ShearingSheet_ix1(), and ShearingSheet_ox1().
ConsFun_t get_usr_expr | ( | const char * | expr | ) |
Sets pointer to expression for special output data.
Definition at line 115 of file blast.c.
Referenced by init_output().
VOutFun_t get_usr_out_fun | ( | const char * | name | ) |
Returns a user defined output function pointer.
Definition at line 120 of file blast.c.
Referenced by init_output().
PropFun_t get_usr_par_prop | ( | const char * | name | ) |
Returns a user defined particle selection function.
Definition at line 190 of file firehose.c.
Referenced by init_output().
void init_grid | ( | MeshS * | pM | ) |
Initializes most variables in the Grid structure.
PURPOSE: Initializes most variables in the Grid structure. Allocates memory for 3D arrays of Cons, interface B, etc. With SMR, finds all overlaps between child and parent Grids, and initializes data needed for restriction flux-correction, and prolongation steps.
Definition at line 50 of file init_grid.c.
References ath_error(), GridS::B1i, GridS::B2i, GridS::B3i, calloc_1d_array(), calloc_2d_array(), calloc_3d_array(), GridS::CGrid, checkOverlap(), dim, GridsDataS::Disp, DomainS::Disp, GridS::Disp, MeshS::Domain, MeshS::DomainsPerLevel, GridOvrlpS::DomN, DomainS::dx, GridS::dx1, GridS::dx2, GridS::dx3, GridS::eta_AD, GridS::eta_Hall, GridS::eta_Ohm, free_1d_array(), free_3d_array(), DomainS::GData, get_myGridIndex(), DomainS::Grid, GridOvrlpS::ID, GridsDataS::ID_Comm_Children, GridsDataS::ID_Comm_Domain, GridsDataS::ID_Comm_Parent, GridsDataS::ID_Comm_world, GridS::ie, GridOvrlpS::ijke, SideS::ijkl, SideS::ijkr, GridOvrlpS::ijks, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, GridS::lx1_id, GridS::lx2_id, GridS::lx3_id, GridS::MaxX, DomainS::MinX, GridS::MinX, GridOvrlpS::myEMF1, GridOvrlpS::myEMF2, GridOvrlpS::myEMF3, GridOvrlpS::myFlx, myID_Comm_world, n, GridS::NCGrid, DomainS::NGrid, MeshS::NLevels, GridS::NmyCGrid, GridS::NmyPGrid, GridS::NPGrid, GridOvrlpS::nWordsP, GridOvrlpS::nWordsRC, DomainS::Nx, GridsDataS::Nx, GridS::Nx, MeshS::Nx, GridS::PGrid, GridS::Phi, GridS::Phi_old, GridS::r, GridS::ri, GridS::rx1_id, GridS::rx2_id, GridS::rx3_id, MeshS::time, GridS::time, GridS::U, GridS::x1MassFlux, GridS::x2MassFlux, and GridS::x3MassFlux.
Referenced by main().
void init_mesh | ( | MeshS * | pM | ) |
General initialization of the nested mesh hierarchy.
Definition at line 84 of file init_mesh.c.
References ath_error(), MeshS::BCFlag_ix1, MeshS::BCFlag_ix2, MeshS::BCFlag_ix3, MeshS::BCFlag_ox1, MeshS::BCFlag_ox2, MeshS::BCFlag_ox3, calloc_1d_array(), calloc_3d_array(), DomainS::Comm_Children, DomainS::Comm_Domain, DomainS::Comm_Parent, dim, GridsDataS::Disp, DomainS::Disp, dom_decomp(), MeshS::Domain, MeshS::DomainsPerLevel, DomainS::DomNumber, DomainS::dx, MeshS::dx, free_1d_array(), DomainS::GData, DomainS::Grid, DomainS::Group_Children, DomainS::Group_Domain, GridsDataS::ID_Comm_Children, GridsDataS::ID_Comm_Domain, GridsDataS::ID_Comm_Parent, GridsDataS::ID_Comm_world, SideS::ijkl, SideS::ijkr, DomainS::InputBlock, DomainS::Level, DomainS::MaxX, DomainS::MinX, myID_Comm_world, n, DomainS::NGrid, MeshS::NLevels, MeshS::nstep, GridsDataS::Nx, DomainS::Nx, MeshS::Nx, Nx, MeshS::outfilename, par_exist(), par_getd(), par_geti(), par_geti_def(), par_gets(), par_seti(), DomainS::RootMaxX, MeshS::RootMaxX, DomainS::RootMinX, MeshS::RootMinX, and MeshS::time.
Referenced by main().
void init_output | ( | MeshS * | pM | ) |
Initializes data output.
Definition at line 171 of file output.c.
References ath_error(), ath_perr(), ath_pout(), check_particle_binning(), OutputS::dat_fmt, OutputS::der, OutputS::dmax, OutputS::dmin, OutputS::dt, OutputS::expr, free_output(), get_usr_expr(), get_usr_out_fun(), get_usr_par_prop(), getexpr(), getRGB(), OutputS::gmax, OutputS::gmin, OutputS::id, OutputS::n, name, OutputS::ndim, OutputS::ndomain, OutputS::nlevel, OutputS::num, MeshS::Nx, OutputS::out, out_count, OutputS::out_fmt, OutputS::out_fun, OutputS::out_pargrid, OutputS::palette, par_exist(), par_getd(), par_getd_def(), par_geti(), par_geti_def(), par_gets(), par_gets_def(), OutputS::par_prop, parse_slice(), OutputS::reduce_x1, OutputS::reduce_x2, OutputS::reduce_x3, OutputS::res_fun, OutputS::rgb, MeshS::RootMaxX, MeshS::RootMinX, rst_flag, OutputS::sdmax, OutputS::sdmin, OutputS::t, MeshS::time, OutputS::x1l, OutputS::x1u, OutputS::x2l, OutputS::x2u, OutputS::x3l, and OutputS::x3u.
Referenced by main().
Inverse matrix solver.
a: input matrix; n: matrix size, b: return matrix Note: the input matrix will be DESTROYED
Definition at line 1106 of file utils.c.
References calloc_1d_array(), lubksb(), and ludcmp().
Referenced by MultiNSH().
Matrix multiplication: a(m*n) * b(n*l) = c(m*l).
Definition at line 1129 of file utils.c.
Referenced by MultiNSH().
Return the min and max of a 1D array using registers Works on data of type float, not Real.
Definition at line 142 of file utils.c.
Referenced by out_ktab(), and output_tab_1d().
Return the min and max of a 2D array using registers Works on data of type float, not Real.
Definition at line 160 of file utils.c.
Referenced by output_pgm(), output_ppm(), output_tab_2d(), and output_vtk_2d().
Return the min and max of a 3D array using registers Works on data of type float, not Real.
Definition at line 181 of file utils.c.
Referenced by output_tab_3d(), and output_vtk_3d().
void new_dt | ( | MeshS * | pM | ) |
Computes timestep using CFL condition.
Definition at line 32 of file new_dt.c.
References ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, cc_pos(), CourNo, ConsS::d, MeshS::Domain, MeshS::DomainsPerLevel, GridS::dt, MeshS::dt, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, Gamma, Gamma_1, DomainS::Grid, GridS::is, Iso_csound2, GridS::js, GridS::ks, ConsS::M1, ConsS::M2, ConsS::M3, MeshS::NLevels, GridS::nparticle, MeshS::nstep, GridS::Nx, par_getd(), GridS::particle, q, MeshS::time, and GridS::U.
Referenced by main().
Creates 1D array of output data with one dimensions equal to Grid and two dimensions reduced according to range stored in x1l/x1u, etc.
Data is computed using output expression (function pointer) stored in Output structure. If slice range lies outside of coordinate range in Grid, the NULL pointer is returned. Dimension of array created is also returned in arguments.
Definition at line 881 of file output.c.
References ath_error(), ath_perr(), calloc_1d_array(), data, OutputS::expr, fc_pos(), GridS::ie, il, GridS::is, iu, GridS::je, jl, GridS::js, ju, GridS::ke, kl, GridS::ks, ku, GridS::MaxX, GridS::MinX, OutputS::n, OutputS::ndim, GridS::Nx, OutputS::out, OutputS::reduce_x1, OutputS::reduce_x2, OutputS::reduce_x3, OutputS::x1l, OutputS::x1u, OutputS::x2l, OutputS::x2u, OutputS::x3l, and OutputS::x3u.
Referenced by out_ktab(), and output_tab_1d().
Creates 2D array of output data with two dimensions equal to Grid and one dimension reduced according to range stored in x1l/x1u, etc.
Data is computed using output expression (function pointer) stored in Output structure. If slice range lies outside of coordinate range in Grid, the NULL pointer is returned. Dimensions of array created are also returned in arguments
Definition at line 699 of file output.c.
References ath_error(), ath_perr(), calloc_2d_array(), data, OutputS::expr, fc_pos(), GridS::ie, il, GridS::is, iu, GridS::je, jl, GridS::js, ju, GridS::ke, kl, GridS::ks, ku, GridS::MaxX, GridS::MinX, OutputS::n, OutputS::ndim, GridS::Nx, OutputS::out, OutputS::reduce_x1, OutputS::reduce_x2, OutputS::reduce_x3, OutputS::x1l, OutputS::x1u, OutputS::x2l, OutputS::x2u, OutputS::x3l, and OutputS::x3u.
Referenced by output_pgm(), output_ppm(), output_tab_2d(), and output_vtk_2d().
Creates 3D array of output data with dimensions equal to Grid using output expression (function pointer) stored in Output structure.
Dimensions of array created also returned in arguments.
Definition at line 636 of file output.c.
References ath_error(), calloc_3d_array(), data, OutputS::expr, GridS::ie, il, GridS::is, iu, GridS::je, jl, GridS::js, ju, GridS::ke, kl, GridS::ks, ku, OutputS::n, OutputS::ndim, GridS::Nx, and OutputS::out.
Referenced by output_tab_3d(), and output_vtk_3d().
Outputs PDFs.
Definition at line 40 of file output_pdf.c.
References ath_error(), ath_fname(), ath_perr(), cd_pdf, DomainS::Comm_Domain, OutputS::dat_fmt, data, def_fmt, MeshS::Domain, MeshS::DomainsPerLevel, OutputS::expr, OutputS::gmax, OutputS::gmin, DomainS::Grid, OutputS::id, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, n, OutputS::ndomain, OutputS::nlevel, MeshS::NLevels, OutputS::num, DomainS::Nx, OutputS::out, MeshS::outfilename, pdf, r, s, size_dat, size_pdf, and GridS::time.
Output 2D PGM image.
Definition at line 27 of file output_pgm.c.
References ath_error(), ath_fname(), data, OutputS::dmax, OutputS::dmin, MeshS::Domain, MeshS::DomainsPerLevel, free_2d_array(), OutputS::gmax, OutputS::gmin, DomainS::Grid, OutputS::id, minmax2(), OutputS::ndim, OutputS::ndomain, OutputS::nlevel, MeshS::NLevels, OutputS::num, nx1, nx2, OutData2(), MeshS::outfilename, OutputS::sdmax, and OutputS::sdmin.
Output PPM image.
Definition at line 39 of file output_ppm.c.
References ath_error(), ath_fname(), compute_rgb(), data, OutputS::dmax, OutputS::dmin, MeshS::Domain, MeshS::DomainsPerLevel, free_2d_array(), OutputS::gmax, OutputS::gmin, DomainS::Grid, OutputS::id, minmax2(), OutputS::ndim, OutputS::ndomain, OutputS::nlevel, MeshS::NLevels, OutputS::num, nx1, nx2, OutData2(), MeshS::outfilename, OutputS::sdmax, and OutputS::sdmin.
Open file, call 1D/2D/3D writer; called by data_ouput.
Definition at line 43 of file output_tab.c.
References MeshS::Domain, MeshS::DomainsPerLevel, DomainS::Grid, OutputS::ndim, OutputS::ndomain, OutputS::nlevel, MeshS::NLevels, output_tab_1d(), output_tab_2d(), and output_tab_3d().
Writes VTK file (single variable).
Definition at line 38 of file output_vtk.c.
References ath_error(), MeshS::Domain, MeshS::DomainsPerLevel, DomainS::Grid, OutputS::ndim, OutputS::ndomain, OutputS::nlevel, MeshS::NLevels, output_vtk_2d(), and output_vtk_3d().
void par_close | ( | void | ) |
Close up shop, free memory.
Definition at line 418 of file par.c.
References free_all(), and now_open.
Referenced by main().
void par_cmdline | ( | int | argc, | |
char * | argv[] | |||
) |
Parse a commandline, very forgiving (no warnings) when not in the right block/name=value format.
Definition at line 194 of file par.c.
References ath_error(), debug, find_block(), find_par(), Block::max_value_len, my_strdup(), name, and Par::value.
Referenced by main().
void par_dist_mpi | ( | const int | mytid, | |
MPI_Comm | comm | |||
) |
Distribute the doubly linked list of parsed information to the children.
Definition at line 435 of file par.c.
References add_block(), add_par_line(), ath_error(), Par::comment, debug, line_block_name(), my_strdup(), Par::name, Block::name, Par::next, Block::next, now_filename, now_open, Block::p, and Par::value.
Referenced by main().
void par_dump | ( | int | mode, | |
FILE * | fp | |||
) |
Debugging aid: print out the current status of all Blocks/Pars.
Definition at line 377 of file par.c.
References Par::comment, Block::max_name_len, Block::max_value_len, Par::name, Block::name, Par::next, Block::next, Block::p, and Par::value.
Referenced by dump_restart(), and main().
int par_exist | ( | char * | block, | |
char * | name | |||
) |
Return 0 or 1 if a block/name exists.
Definition at line 239 of file par.c.
References ath_error(), find_block(), find_par(), and now_open.
Referenced by init_mesh(), init_output(), init_particle(), par_getd_def(), par_geti_def(), par_gets_def(), and parse_slice().
double par_getd | ( | char * | block, | |
char * | name | |||
) |
Return a Real value.
Definition at line 277 of file par.c.
References par_getsl().
Referenced by dump_particle_binary(), exchange_feedback_init(), init_mesh(), init_output(), initialize(), integrate_init(), main(), new_dt(), pbc_ix1(), pbc_ox1(), problem(), problem_read_restart(), set_bvals_particle_init(), and Userwork_after_loop().
double par_getd_def | ( | char * | block, | |
char * | name, | |||
double | def | |||
) |
Return double *name in *block if it exists, else use the double def as a default value.
Definition at line 320 of file par.c.
References par_exist(), par_getsl(), and par_setd().
Referenced by init_output(), problem(), problem_read_restart(), and Userwork_after_loop().
int par_geti | ( | char * | block, | |
char * | name | |||
) |
Return an integer.
Definition at line 267 of file par.c.
References par_getsl().
Referenced by exchange_feedback_init(), init_mesh(), init_output(), init_particle(), initialize(), main(), problem(), problem_read_restart(), selfg_multig_3d_init(), set_bvals_particle_init(), and Userwork_after_loop().
int par_geti_def | ( | char * | block, | |
char * | name, | |||
int | def | |||
) |
Return integer *name in *block if it exists, else use the integer def as a default value.
Definition at line 304 of file par.c.
References par_exist(), par_getsl(), and par_seti().
Referenced by bvals_mhd(), grid_limit(), init_mesh(), init_output(), init_particle(), main(), problem(), problem_read_restart(), resistivity_init(), and set_bvals_particle_init().
char* par_gets | ( | char * | block, | |
char * | name | |||
) |
Return a string.
Definition at line 257 of file par.c.
References my_strdup(), and par_getsl().
Referenced by init_mesh(), init_output(), main(), and parse_slice().
char* par_gets_def | ( | char * | block, | |
char * | name, | |||
char * | def | |||
) |
Return string *name in *block if it exists, else use the string *def as a default value.
Definition at line 288 of file par.c.
References my_strdup(), par_exist(), par_getsl(), and par_sets().
Referenced by init_output().
void par_open | ( | char * | filename | ) |
Open a parameter file for R/O access.
Lines read from the file are locally patched; all names, values and comments are allocated and put into a linked list of Block's and Par's.
Definition at line 156 of file par.c.
References add_block(), add_par_line(), ath_error(), debug, line_block_name(), my_strdup(), now_filename, now_open, and skipwhite().
Referenced by main().
void par_setd | ( | char * | block, | |
char * | name, | |||
char * | fmt, | |||
double | dval, | |||
char * | comment | |||
) |
Set or add a double.
Definition at line 363 of file par.c.
References add_block(), and add_par().
Referenced by data_output(), dump_restart(), and par_getd_def().
void par_seti | ( | char * | block, | |
char * | name, | |||
char * | fmt, | |||
int | ival, | |||
char * | comment | |||
) |
Set or add an integer.
Definition at line 348 of file par.c.
References add_block(), and add_par().
Referenced by data_output(), dump_restart(), init_mesh(), par_geti_def(), and show_config_par().
void par_sets | ( | char * | block, | |
char * | name, | |||
char * | sval, | |||
char * | comment | |||
) |
Set or add a string.
Definition at line 335 of file par.c.
References add_block(), and add_par().
Referenced by main(), par_gets_def(), and show_config_par().
Prim1D_to_Cons1D: NEWTONIAN VERSION.
Definition at line 432 of file convert_var.c.
References Cons1DS::By, Prim1DS::By, Cons1DS::Bz, Prim1DS::Bz, Prim1DS::d, Cons1DS::d, Cons1DS::E, Gamma_1, Cons1DS::Mx, Cons1DS::My, Cons1DS::Mz, Prim1DS::P, Prim1DS::r, Cons1DS::s, Prim1DS::Vx, Prim1DS::Vy, and Prim1DS::Vz.
Referenced by integrate_1d_ctu(), integrate_1d_vl(), integrate_2d_ctu(), integrate_2d_vl(), integrate_3d_ctu(), integrate_3d_vl(), Prim_to_Cons(), problem(), and problem_read_restart().
Wrapper for the Prim1D_to_Cons1D function, works for both NEWTONIAN and SPECIAL_RELATIVITY.
Definition at line 159 of file convert_var.c.
References ConsS::B1c, PrimS::B1c, ConsS::B2c, PrimS::B2c, ConsS::B3c, PrimS::B3c, Cons1DS::By, Prim1DS::By, Cons1DS::Bz, Prim1DS::Bz, Cons1DS::d, ConsS::d, PrimS::d, Prim1DS::d, Cons1DS::E, ConsS::E, ConsS::M1, ConsS::M2, ConsS::M3, Cons1DS::Mx, Cons1DS::My, Cons1DS::Mz, n, PrimS::P, Prim1DS::P, Prim1D_to_Cons1D(), PrimS::r, Prim1DS::r, Cons1DS::s, ConsS::s, U, PrimS::V1, PrimS::V2, PrimS::V3, Prim1DS::Vx, Prim1DS::Vy, Prim1DS::Vz, and W.
Referenced by integrate_1d_vl(), integrate_2d_vl(), and integrate_3d_vl().
void problem | ( | DomainS * | pD | ) |
Problem initial conditions, edited for each problem.
Definition at line 23 of file blast.c.
References a, A1(), A2(), A3(), alpha, Amp, amp, ang_2, ang_3, ang_mom, ath_error(), ath_gcd(), ath_perr(), ath_pout(), avg1d(), avg2d(), Ax(), Ay(), Az(), B0, b0, B1(), ConsS::B1c, B1i(), GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, b_par, b_perp, Beta, beta, bisection(), Bp(), BpNet(), Bpsub(), Br(), br0, bvals_mhd_fun(), bx0, Bxjet, Bxl, bxl, Bxr, Cons1DS::By, Prim1DS::By, by0, Byl, byl, Byr, Bz(), Cons1DS::Bz, Prim1DS::Bz, bz0, Bzl, bzl, BzNet(), Bzr, Bzsub(), BzZero(), c_infty, calloc_1d_array(), calloc_2d_array(), calloc_3d_array(), cc_pos(), ChiMag(), compute_div_b(), constant_iib(), constant_oib(), cos_a, cos_a2, cos_a3, cyladvect_ix1(), cyladvect_ox1(), cylbr_ix1(), cylbr_ox1(), d(), Cons1DS::d, ConsS::d, Prim1DS::d, d0, d1, d_ind, dby, dbz, disk_ir(), disk_or(), GridS::Disp, DomainS::Disp, dl, dmrbv_iib(), dmrbv_ijb(), dmrbv_ojb(), do_nothing_bc(), dr, dump_history_enroll(), GridS::dx1, GridS::dx2, GridS::dx3, E, Cons1DS::E, ConsS::E, e0, esys_roe_adb_hyd(), esys_roe_adb_mhd(), esys_roe_iso_hyd(), esys_roe_iso_mhd(), eta, eta_Ohm, fac, Field, four_pi_G, free_1d_array(), free_2d_array(), free_3d_array(), Gamma, Gamma_1, GM, grav_mean_rho, DomainS::Grid, Hbc, hst_Bx(), hst_BxBy(), hst_By(), hst_Bz(), hst_dBy(), hst_dEk(), hst_dEw2(), hst_E_total(), hst_rho_dVy2(), hst_rho_Vx_dVy(), GridS::ie, il, initialize_states(), insert_time, ipert, iprob, GridS::is, Iso_csound, Iso_csound2, iu, GridS::je, jet_iib(), jl, GridS::js, ju, k_par, GridS::ke, kl, GridS::ks, ku, kx, kz, lambda, lambda_s, left_x1, left_x2, left_x3, DomainS::Level, Lx, lx_bc(), Ly, ly_bc(), Lz, lz_bc(), ConsS::M1, M2(), ConsS::M2, ConsS::M3, Mach, DomainS::MaxX, Mbc, Mc, MdotR1(), MdotR2(), MdotR3(), MdotR4(), GridS::MinX, Mp, Mrp(), Mrpsub(), Msub(), Cons1DS::Mx, Cons1DS::My, myfunc(), myID_Comm_world, Cons1DS::Mz, n, noh3d_oib(), noh3d_ojb(), noh3d_okb(), nu_aniso, nu_iso, DomainS::Nx, GridS::Nx, nx1, nx2, nx3, omega, omega0, Omega_0, OrbitalProfile, Prim1DS::P, p0, par_getd(), par_getd_def(), par_geti(), par_geti_def(), Pbsub(), pgas, Pgas(), pgas0, Pgas0, phi0, Pl, pl, Pr, pr, Prim1D_to_Cons1D(), q, Q_AD, Q_Hall, qshear, qsimp(), Prim1DS::r, r, r0, R0, r1, r2, R_A, rad, radius, ramp_time, ran2(), reflect_ix2(), reflect_ix3(), reflect_ox2(), reflect_ox3(), rho, rho0, rho_A, rhomin, right_x1, right_x2, right_x3, rjet, RK4(), DomainS::RootMaxX, DomainS::RootMinX, Rsoft, rx, rx_bc(), ry, ry_bc(), rz, rz_bc(), Cons1DS::s, ConsS::s, s, ScaleToBeta(), ShBoxCoord, ShearingBoxPot, ShearProfile, shk_cloud_iib(), shkset2d_iib(), shkset2d_ijb(), shkset2d_oib(), shkset2d_ojb(), sign_change(), sin_a, sin_a2, sin_a3, Soln, StaticGravPot, theta, GridS::time, Trp(), U, GridS::U, U1d, Ul, ul, Ur, ur, vecpot2b1i(), vecpot2b2i(), vphi(), Prim1DS::Vx, vx0, vxl, vxr, Prim1DS::Vy, vy0, vyl, vyr, vz, Prim1DS::Vz, vz0, vzl, vzr, W, wave_flag, Wl, Wr, x0, x01, x02, x1_mid, x1c, x1GravAcc, x1max, x1min, x1save, x1vc(), x2_mid, x2c, x2max, x2min, x3_mid, x3c, x3max, x3min, x3save, xmax, xmin, Xplanet, ymax, ymin, Yplanet, z0, zbtm, Zplanet, and ztop.
Referenced by main().
void problem_read_restart | ( | MeshS * | pM, | |
FILE * | fp | |||
) |
Problem specific subroutine for use with reading restart files, Edited for each problem.
Definition at line 110 of file blast.c.
References Bp(), Bpsub(), Br(), bvals_mhd_fun(), Bxjet, Prim1DS::By, Prim1DS::Bz, Bz(), Bzsub(), constant_iib(), constant_oib(), Prim1DS::d, d0, d_ind, disk_ir(), disk_or(), DomainS::Disp, do_nothing_bc(), MeshS::Domain, MeshS::DomainsPerLevel, dump_history_enroll(), eta_Ohm, four_pi_G, grav_mean_rho, DomainS::Grid, Hbc, hst_Bx(), hst_BxBy(), hst_By(), hst_Bz(), hst_E_total(), hst_rho_dVy2(), hst_rho_Vx_dVy(), insert_time, jet_iib(), left_x1, left_x2, left_x3, Lx, DomainS::MaxX, Mbc, MdotR1(), MdotR2(), MdotR3(), MdotR4(), Mp, Mrp(), Mrpsub(), Msub(), MeshS::NLevels, nu_aniso, nu_iso, MeshS::Nx, omega0, Omega_0, OrbitalProfile, Prim1DS::P, par_getd(), par_getd_def(), par_geti_def(), Pbsub(), Prim1D_to_Cons1D(), q, Q_AD, Q_Hall, qshear, R0, ramp_time, reflect_ix2(), reflect_ix3(), reflect_ox2(), reflect_ox3(), rho0, right_x1, right_x2, right_x3, rjet, DomainS::RootMaxX, MeshS::RootMaxX, MeshS::RootMinX, Rsoft, ShearingBoxPot, ShearProfile, StaticGravPot, Trp(), Prim1DS::Vx, Prim1DS::Vy, Prim1DS::Vz, x1GravAcc, x1max, x1min, Xplanet, Yplanet, and Zplanet.
Referenced by restart_grids().
void problem_write_restart | ( | MeshS * | pM, | |
FILE * | fp | |||
) |
Problem specific subroutine for use with writing restart files, Edited for each problem.
Definition at line 105 of file blast.c.
Referenced by dump_restart().
void Prolongate | ( | MeshS * | pM | ) |
Sets BC on fine Grid by prolongation (interpolation) of coarse Grid solution into fine grid ghost zones.
Definition at line 1227 of file smr.c.
References ath_error(), ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, GridS::CGrid, DomainS::Comm_Children, DomainS::Comm_Parent, ConsS::d, dim, MeshS::Domain, MeshS::DomainsPerLevel, GridOvrlpS::DomN, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, DomainS::Grid, GridOvrlpS::ID, GridOvrlpS::ijke, GridOvrlpS::ijks, ConsS::M1, ConsS::M2, ConsS::M3, maxND, GridOvrlpS::myFlx, n, GridS::NCGrid, MeshS::NLevels, GridS::NmyCGrid, GridS::NmyPGrid, GridS::NPGrid, GridOvrlpS::nWordsP, GridS::Nx, MeshS::Nx, GridS::PGrid, ProCon(), ProFld(), recv_bufP, recv_rq, ConsS::s, send_bufP, send_rq, start_addrP, GridS::U, Real3Vect::x, Real3Vect::y, and Real3Vect::z.
Referenced by main().
RETURNS THE INTEGRAL OF THE FUNCTION func FROM a TO b.
THE PARAMETER EPS CAN BE SET TO THE DESIRED FRACTIONAL ACCURACY AND JMAX SO THAT 2^(JMAX-1) IS THE MAXIMUM ALLOWED NUMBER OF STEPS. INTEGRATION IS PERFORMED BY SIMPSON'S RULE. ADAPTED FROM NUMERICAL RECIPES BY AARON SKINNER
Definition at line 650 of file utils.c.
References ath_error(), s, and trapzd().
Referenced by avg1d(), avg2d(), avg3d(), avgXZ(), cylbr_ix1(), cylbr_ox1(), fXZ(), fy(), fz(), problem(), vecpot2b1i(), vecpot2b2i(), and vecpot2b3i().
Remaps Ey at [is] due to background shear, and then averages remapped and original field.
This guarantees the sums of Ey along the x1 boundaries at [is] and [ie+1] are identical -- thus net Bz is conserved
This is a public function which is called by integrator (inside a SHEARING_BOX macro).
Definition at line 1318 of file bvals_shear.c.
References DomainS::Comm_Domain, GridS::dx2, Flx, DomainS::GData, get_myGridIndex(), DomainS::Grid, GridsDataS::ID_Comm_Domain, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, Lx, GridS::lx1_id, GridS::lx2_id, Ly, my_iproc, my_jproc, my_kproc, myID_Comm_world, DomainS::NGrid, GridS::Nx, Omega_0, qshear, recv_buf, RemapFlux(), DomainS::RootMaxX, DomainS::RootMinX, GridS::rx2_id, send_buf, tEyBuf, GridS::time, xmax, and xmin.
Referenced by integrate_3d_ctu().
Remaps Ey at [ie+1] due to background shear, and then averages remapped and original field.
This guarantees the sums of Ey along the x1 boundaries at [is] and [ie+1] are identical -- thus net Bz is conserved
This is a public function which is called by integrator (inside a SHEARING_BOX macro).
Definition at line 1647 of file bvals_shear.c.
References DomainS::Comm_Domain, GridS::dx2, Flx, DomainS::GData, get_myGridIndex(), DomainS::Grid, GridsDataS::ID_Comm_Domain, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, Lx, GridS::lx2_id, Ly, my_iproc, my_jproc, my_kproc, myID_Comm_world, DomainS::NGrid, GridS::Nx, Omega_0, qshear, recv_buf, RemapFlux(), DomainS::RootMaxX, DomainS::RootMinX, GridS::rx1_id, GridS::rx2_id, send_buf, tEyBuf, GridS::time, xmax, and xmin.
Referenced by integrate_3d_ctu().
void restart_grids | ( | char * | res_file, | |
MeshS * | pM | |||
) |
Reads nstep, time, dt, and arrays of ConsS and interface B for each of the Grid structures in the restart file.
By the time this function is called (in Step 6 of main()), the Mesh hierarchy has already been re-initialized by init_mesh() and init_grid() in Step 4 of main() using parameters in the athinput file at the start of this restart file, the command line, or from a new input file.
Definition at line 56 of file restart.c.
References alamcoeff, ath_error(), ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, ConsS::d, MeshS::Domain, MeshS::DomainsPerLevel, GridS::dt, MeshS::dt, ConsS::E, DomainS::Grid, GridS::grproperty, grrhoa, GridS::ie, Grain_Property::integrator, GridS::is, GridS::je, GridS::js, kb, GridS::ke, GridS::ks, Grain_Property::m, ConsS::M1, ConsS::M2, ConsS::M3, n, MeshS::NLevels, GridS::nparticle, MeshS::nstep, Grain_Property::num, GridS::particle, GridS::partypes, problem_read_restart(), Grain_Property::rad, Grain_Property::rho, ConsS::s, GridS::time, MeshS::time, tstop0, and GridS::U.
Referenced by main().
void RestrictCorrect | ( | MeshS * | pM | ) |
Restricts (averages) fine Grid solution to coarse, and corrects cells at fine/coarse boundaries using restricted fine Grid fluxes.
Definition at line 77 of file smr.c.
References ath_error(), ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, GridS::CGrid, DomainS::Comm_Children, DomainS::Comm_Parent, ConsS::d, dim, MeshS::Domain, MeshS::DomainsPerLevel, GridOvrlpS::DomN, GridS::dt, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, DomainS::Grid, GridOvrlpS::ID, GridS::ie, GridOvrlpS::ijke, GridOvrlpS::ijks, GridS::je, kb, GridS::ke, ConsS::M1, ConsS::M2, ConsS::M3, GridOvrlpS::myEMF1, GridOvrlpS::myEMF2, GridOvrlpS::myEMF3, GridOvrlpS::myFlx, n, GridS::NCGrid, MeshS::NLevels, GridS::NmyCGrid, GridS::NmyPGrid, GridS::NPGrid, GridOvrlpS::nWordsRC, GridS::Nx, MeshS::Nx, GridS::PGrid, recv_bufRC, recv_rq, ConsS::s, send_bufRC, send_rq, SMRemf1, SMRemf2, SMRemf3, and GridS::U.
Referenced by main().
void ShearingSheet_ix1 | ( | DomainS * | pD | ) |
3D shearing-sheet BCs in x1.
It applies a remap in Y after the ghost cells have been set by the usual periodic BCs in X and Y implemented in bvals_mhd.c
This is a public function which is called by bvals_mhd() inside a SHEARING_BOX macro.
Definition at line 130 of file bvals_shear.c.
References ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, DomainS::Comm_Domain, ConsS::d, GridS::dx2, ConsS::E, Flx, DomainS::GData, get_myGridIndex(), GhstZnsBuf, DomainS::Grid, GridsDataS::ID_Comm_Domain, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, ku, Lx, GridS::lx2_id, Ly, ConsS::M1, ConsS::M2, ConsS::M3, my_iproc, my_jproc, my_kproc, myID_Comm_world, n, DomainS::NGrid, NREMAP, GridS::Nx, Omega_0, qshear, recv_buf, RemapFlux(), DomainS::RootMaxX, DomainS::RootMinX, GridS::rx2_id, Remap::s, ConsS::s, s, send_buf, ShBoxCoord, GridS::time, U, GridS::U, Remap::U, xmax, and xmin.
Referenced by bvals_mhd().
void ShearingSheet_ox1 | ( | DomainS * | pD | ) |
3D shearing-sheet BCs in x1.
It applies a remap in Y after the ghost cells have been set by the usual periodic BCs in X and Y implemented in bvals_mhd.c
This is a public function which is called by bvals_mhd() inside a SHEARING_BOX macro.
Definition at line 724 of file bvals_shear.c.
References ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, DomainS::Comm_Domain, ConsS::d, GridS::dx2, ConsS::E, Flx, DomainS::GData, get_myGridIndex(), GhstZnsBuf, DomainS::Grid, GridsDataS::ID_Comm_Domain, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, ku, Lx, GridS::lx2_id, Ly, ConsS::M1, ConsS::M2, ConsS::M3, my_iproc, my_jproc, my_kproc, myID_Comm_world, n, DomainS::NGrid, NREMAP, GridS::Nx, Omega_0, qshear, recv_buf, RemapFlux(), DomainS::RootMaxX, DomainS::RootMinX, GridS::rx2_id, Remap::s, ConsS::s, s, send_buf, ShBoxCoord, GridS::time, U, GridS::U, Remap::U, xmax, and xmin.
Referenced by bvals_mhd().
void show_config | ( | void | ) |
The packages and features reported on by this functin should be kept consistent with the optional packages and features added by the file configure.ac in the top-level directory.
Definition at line 23 of file show_config.c.
References ath_pout().
Referenced by main(), and usage().
void show_config_par | ( | void | ) |
Add the configure block to the parameter database used by the functions in par.c.
Definition at line 190 of file show_config.c.
References par_seti(), and par_sets().
Referenced by main().
int sign_change | ( | Real(*)(const Real, const Real) | func, | |
const Real | a0, | |||
const Real | b0, | |||
const Real | x, | |||
Real * | a, | |||
Real * | b | |||
) |
SEARCH FOR A SIGN CHANGE.
THIS FUNCTION PARTITIONS THE INTERVAL (a0,b0) INTO 2^k EQUALLY SPACED GRID POINTS, EVALUATES THE FUNCTION f AT THOSE POINTS, AND THEN SEARCHES FOR A SIGN CHANGE IN f BETWEEN ADJACENT GRID POINTS. THE FIRST SUCH INTERVAL FOUND, (a,b), IS RETURNED.
Definition at line 511 of file utils.c.
References n.
Referenced by problem().
void SMR_init | ( | MeshS * | pM | ) |
Allocates memory for send/receive buffers.
Definition at line 1799 of file smr.c.
References ath_error(), calloc_1d_array(), calloc_2d_array(), calloc_3d_array(), GridS::CGrid, MeshS::Domain, MeshS::DomainsPerLevel, DomainS::Grid, maxND, GridS::NCGrid, MeshS::NLevels, GridS::NPGrid, GridOvrlpS::nWordsP, GridOvrlpS::nWordsRC, GridS::Nx, GridS::PGrid, recv_bufP, recv_bufRC, recv_rq, send_bufP, send_bufRC, send_rq, SMRemf1, SMRemf2, SMRemf3, and start_addrP.
Referenced by main().
THIS ROUTINE COMPUTES THE nTH STAGE OF REFINEMENT OF AN EXTENDED TRAPEZOIDAL RULE.
func IS INPUT AS A POINTER TO THE FUNCTION TO BE INTEGRATED BETWEEN LIMITS a AND b, ALSO INPUT. WHEN CALLED WITH n=1, THE ROUTINE RETURNS THE CRUDEST ESTIMATE OF ^b f(R) R dR. SUBSEQUENT CALLS WITH n=2,3,... (IN THAT SEQUENTIAL ORDER) WILL IMPROVE THE ACCURACY BY ADDING 2n-2 ADDITIONAL INTERIOR POINTS. ADAPTED FROM NUMERICAL RECIPES BY AARON SKINNER
Definition at line 617 of file utils.c.
Referenced by qsimp().
void Userwork_after_loop | ( | MeshS * | pM | ) |
Problem work executed after the main Athena loop, see main.c Edited for each problem.
Definition at line 128 of file blast.c.
References ath_error(), ath_fname(), ath_perr(), ConsS::B1c, ConsS::B2c, ConsS::B3c, DomainS::Comm_Domain, compute_l1_error(), 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.
Referenced by main().
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 124 of file blast.c.
References compute_div_b(), MeshS::Domain, DomainS::Grid, ramp_time, and MeshS::time.
Referenced by main().
Real vecpot2b1i | ( | Real(*)(Real, Real, Real) | A2, | |
Real(*)(Real, Real, Real) | A3, | |||
const GridS * | pG, | |||
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
Compute B-field components from a vector potential.
THESE FUNCTIONS COMPUTE MAGNETIC FIELD COMPONENTS FROM COMPONENTS OF A SPECIFIED VECTOR POTENTIAL USING STOKES' THEOREM AND SIMPSON'S QUADRATURE. NOTE: THIS IS ONLY GUARANTEED TO WORK IF THE POTENTIAL IS OF CLASS C^1. WRITTEN BY AARON SKINNER.
Definition at line 831 of file utils.c.
References A2(), a2func, A3(), a3func, cc_pos(), GridS::dx1, GridS::dx2, GridS::dx3, f2(), f3(), and qsimp().
Referenced by problem().
Real vecpot2b2i | ( | Real(*)(Real, Real, Real) | A1, | |
Real(*)(Real, Real, Real) | A3, | |||
const GridS * | pG, | |||
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
Compute B-field components from a vector potential.
THESE FUNCTIONS COMPUTE MAGNETIC FIELD COMPONENTS FROM COMPONENTS OF A SPECIFIED VECTOR POTENTIAL USING STOKES' THEOREM AND SIMPSON'S QUADRATURE. NOTE: THIS IS ONLY GUARANTEED TO WORK IF THE POTENTIAL IS OF CLASS C^1. WRITTEN BY AARON SKINNER.
Definition at line 887 of file utils.c.
References A1(), a1func, A3(), a3func, cc_pos(), GridS::dx1, GridS::dx2, GridS::dx3, f1(), f3(), and qsimp().
Referenced by problem().
Real vecpot2b3i | ( | Real(*)(Real, Real, Real) | A1, | |
Real(*)(Real, Real, Real) | A2, | |||
const GridS * | pG, | |||
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
Compute B-field components from a vector potential.
THESE FUNCTIONS COMPUTE MAGNETIC FIELD COMPONENTS FROM COMPONENTS OF A SPECIFIED VECTOR POTENTIAL USING STOKES' THEOREM AND SIMPSON'S QUADRATURE. NOTE: THIS IS ONLY GUARANTEED TO WORK IF THE POTENTIAL IS OF CLASS C^1. WRITTEN BY AARON SKINNER.
Definition at line 939 of file utils.c.
References A1(), a1func, A2(), a2func, cc_pos(), GridS::dx1, GridS::dx2, GridS::dx3, f1(), f2(), and qsimp().
Definition at line 61 of file cc_pos.c.
References GridS::dx1, GridS::is, GridS::MinX, and x1cc().
Referenced by Bpsub(), Bzsub(), integrate_1d_ctu(), integrate_2d_ctu(), integrate_3d_ctu(), Mrpsub(), Msub(), Pbsub(), and problem().