Functions

particles/init_particle.c File Reference

Initialize particle related structures and functions. More...

Go to the source code of this file.

Functions

void grid_limit (Grid *pG, Domain *pD)
 Calculate the left and right grid limit.
void init_particle (Grid *pG, Domain *pD)
 Initialization for particles.
void particle_destruct (Grid *pG)
 Finalization for particles.
void particle_realloc (Grid *pG, long n)
 Enlarge the particle array.

Detailed Description

Initialize particle related structures and functions.

PURPOSE: Initialize particle related structures and functions. Particle integrator is enrolled by calling integrate_particle_init(int type). In init_particle(Grid *pG, Domain *pD), all the particle related arrays are allocated, interpolation and stopping time calculation functions are enrolled, most global variables for particles are evaluated. Also contains functions for particle array reallocation and destruction.

CONTAINS PUBLIC FUNCTIONS:

History:

Definition in file init_particle.c.


Function Documentation

void grid_limit ( Grid *  pG,
Domain *  pD 
)

Calculate the left and right grid limit.

Input: pG: grid; Output: ilp,iup,jlp,jup,klp,kup: grid limit indices; x1lpar,x1upar,x2lpar,x2upar,x3lpar,x3upar: grid boundary coordinates

Definition at line 217 of file init_particle.c.

References get_myGridIndex(), ilp, iup, jlp, jup, klp, kup, my_iproc, my_jproc, my_kproc, par_geti_def(), x1lpar, x1upar, x2lpar, x2upar, x3lpar, and x3upar.

Referenced by init_particle().

Here is the call graph for this function:

Here is the caller graph for this function:

void init_particle ( Grid *  pG,
Domain *  pD 
)

Initialization for particles.

Allocate memory for the gas velocity/sound speed array, feedback array. Note we enforce that each type has equal number of particles to ensure equal resolution.

Definition at line 52 of file init_particle.c.

References alamcoeff, ath_error(), calloc_1d_array(), calloc_3d_array(), get_ts, getweight, grid_limit(), grrhoa, ilp, iup, jlp, jup, klp, kup, ncell, par_exist(), par_geti(), par_geti_def(), and tstop0.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void particle_destruct ( Grid *  pG  ) 

Finalization for particles.

Definition at line 165 of file init_particle.c.

References free_1d_array(), free_3d_array(), and grrhoa.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void particle_realloc ( Grid *  pG,
long  n 
)

Enlarge the particle array.

Definition at line 183 of file init_particle.c.

References ath_error().

Referenced by problem(), and unpack_particle().

Here is the call graph for this function:

Here is the caller graph for this function: