Functions that construct and destruct 1D, 2D and 3D arrays of any type. More...
Go to the source code of this file.
Functions | |
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. |
Functions that construct and destruct 1D, 2D and 3D arrays of any type.
PURPOSE: Functions that construct and destruct 1D, 2D and 3D arrays of any type. Elements in these arrays can be accessed in the standard fashion of array[in][im] (where in = 0 -> nr-1 and im = 0 -> nc-1) as if it were an array of fixed size at compile time with the statement:
Equally so for 3D arrys: array[nt][nr][nc]
TAG -- 8/2/2001
EXAMPLE usage of 3D construct/destruct functions for arrays of type Real:
CONTAINS PUBLIC FUNCTIONS:
Definition in file ath_array.c.
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 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().