Problem generator for particle code test, works for 2D or 3D. More...
Go to the source code of this file.
Functions | |
| static Vector | ParticleTroj (Real t) |
| Compute particle trajectory. | |
| static Vector | ParticleVel (Vector pos) |
| Compute particle velocity. | |
| static int | ParticleLocator (Real x1, Real x2, Real x3) |
| Judge if the particle is in this cpu. | |
| double | ran2 (long int *idum) |
| Extracted from the Numerical Recipes in C (version 2) code. | |
| Vector | Get_Term (Grid *pG, int type, Real x1, Real x2, Real x3, Vector cell1, Real *tstop) |
| Calculate the termination velocity of strongly coupled particles. | |
| void | problem (Grid *pGrid, Domain *pDomain) |
| void | problem_write_restart (Grid *pG, Domain *pD, FILE *fp) |
| void | problem_read_restart (Grid *pG, Domain *pD, FILE *fp) |
| Gasfun_t | get_usr_expr (const char *expr) |
| Sets pointer to expression for special output data. | |
| VGFunout_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 | Userwork_in_loop (Grid *pGrid, Domain *pDomain) |
| void | Userwork_after_loop (Grid *pGrid, Domain *pDomain) |
Variables | |
| Real | x1c |
| Real | x2c |
| Real | x3c |
| Real | x01 |
| Real | x02 |
| Real | x03 |
| Real | omg |
| Real | omgx1 |
| Real | omgx2 |
| Real | omgx3 |
| Real | r01 |
| Real | r02 |
| Real | r03 |
| Real | r0dn |
| Real | r0cn1 |
| Real | r0cn2 |
| Real | r0cn3 |
| Real | n1 |
| Real | n2 |
| Real | n3 |
| char | name [50] |
Problem generator for particle code test, works for 2D or 3D.
PURPOSE: Problem generator for particle code test, works for 2D or 3D. The gas is set tobe steady state, with a circular motion around the center of the domain. This is not done by playing with gas dynamics, but by setting the gas at rest, and properly treat gasvshift function. A particle with zero stopping is initiated and serve as Lagrangian particle to trace fluid element trajectories. This test is used to test particle integrator performance in strong coupling regime.
Configure --with-particle=passive --with-eos=isothermal
USERWORK_IN_LOOP function is used to output particle positions.
Definition in file par_circ.c.
Calculate the termination velocity of strongly coupled particles.
Used for the special integrator Force difference include pressure gradient and momentum feedback Input: pG: grid; type: particle type; x1,x2,x3: particle position; Return: termination velocity, and the stopping time.
Definition at line 867 of file integrators_particle.c.
References ath_perr(), gasvshift(), Get_ForceDiff(), get_ts, getvalues(), getweight, and rho.
Referenced by int_par_spec(), Integrate_Particles(), and problem().


| Gasfun_t get_usr_expr | ( | const char * | expr | ) |
Sets pointer to expression for special output data.
Definition at line 246 of file par_circ.c.
| VGFunout_t get_usr_out_fun | ( | const char * | name | ) |
Returns a user defined output function pointer.
Definition at line 251 of file par_circ.c.
| PropFun_t get_usr_par_prop | ( | const char * | name | ) |
Returns a user defined particle selection function.
Definition at line 256 of file par_circ.c.
| static Vector ParticleTroj | ( | Real | t | ) | [static] |
| static Vector ParticleVel | ( | Vector | pos | ) | [static] |
| void problem | ( | Grid * | pGrid, | |
| Domain * | pDomain | |||
| ) |
Definition at line 60 of file par_circ.c.
References ath_error(), Get_Term(), n1, n2, n3, name, omg, omgx1, omgx2, omgx3, par_getd(), par_getd_def(), par_geti(), par_geti_def(), particle_realloc(), ParticleLocator(), r01, r02, r03, r0cn1, r0cn2, r0cn3, r0dn, rad, ran2(), seed, theta, tstop0, x01, x02, x03, x1c, x1max, x1min, x2c, x2max, x2min, x3c, x3max, and x3min.

| void problem_read_restart | ( | Grid * | pG, | |
| Domain * | pD, | |||
| FILE * | fp | |||
| ) |
| void problem_write_restart | ( | Grid * | pG, | |
| Domain * | pD, | |||
| FILE * | fp | |||
| ) |
Definition at line 209 of file par_circ.c.
References name.
| double ran2 | ( | long int * | idum | ) |
Extracted from the Numerical Recipes in C (version 2) code.
The routine ran2() is extracted from the Numerical Recipes in C.
Modified to use doubles instead of floats. -- T. A. Gardiner -- Aug. 12, 2003
Long period (> 2 x 10^{18}) random number generator of L'Ecuyer with Bays-Durham shuffle and added safeguards. Returns a uniform random deviate between 0.0 and 1.0 (exclusive of the endpoint values). Call with idum = a negative integer to initialize; thereafter, do not alter idum between successive deviates in a sequence. RNMX should appriximate the largest floating point value that is less than 1.
Modified to use doubles instead of floats. - T. A. Gardiner - Aug. 12, 2003
Long period (> 2 x 10^{18}) random number generator of L'Ecuyer with Bays-Durham shuffle and added safeguards. Returns a uniform random deviate between 0.0 and 1.0 (exclusive of the endpoint values). Call with idum = a negative integer to initialize; thereafter, do not alter idum between successive deviates in a sequence. RNMX should appriximate the largest floating point value that is less than 1.
The routine ran2() is extracted from the Numerical Recipes in C (version 2) code. I've modified it to use doubles instead of floats. -- T. A. Gardiner -- Aug. 12, 2003
Long period (> 2 x 10^{18}) random number generator of L'Ecuyer with Bays-Durham shuffle and added safeguards. Returns a uniform random deviate between 0.0 and 1.0 (exclusive of the endpoint values). Call with idum = a negative integer to initialize; thereafter, do not alter idum between successive deviates in a sequence. RNMX should appriximate the largest floating point value that is less than 1.
Definition at line 408 of file par_circ.c.
| void Userforce_particle | ( | Vector * | ft, | |
| const Real | x1, | |||
| const Real | x2, | |||
| const Real | x3, | |||
| const Real | v1, | |||
| const Real | v2, | |||
| const Real | v3 | |||
| ) |
Definition at line 279 of file par_circ.c.
| void Userwork_after_loop | ( | Grid * | pGrid, | |
| Domain * | pDomain | |||
| ) |
Definition at line 328 of file par_circ.c.
| void Userwork_in_loop | ( | Grid * | pGrid, | |
| Domain * | pDomain | |||
| ) |
Definition at line 286 of file par_circ.c.
References dr, name, ParticleTroj(), ParticleVel(), r0, r1, x1c, x2c, and x3c.

Definition at line 52 of file par_circ.c.
Referenced by ParticleTroj(), problem(), problem_read_restart(), shearingbox_ix1_particle(), and shearingbox_ox1_particle().
Definition at line 52 of file par_circ.c.
Referenced by ParticleTroj(), problem(), problem_read_restart(), shearingbox_ix1_particle(), and shearingbox_ox1_particle().
Definition at line 52 of file par_circ.c.
Referenced by ParticleTroj(), problem(), and problem_read_restart().
| char name[50] |
Definition at line 53 of file par_circ.c.
Referenced by add_par_line(), init_output(), main(), OutputModeAmplitude(), par_cmdline(), problem(), problem_read_restart(), problem_write_restart(), and Userwork_in_loop().
Definition at line 51 of file par_circ.c.
Referenced by lr_states(), ParticlePosition(), ParticleTroj(), ParticleVelocity(), pert_even(), pert_odd(), problem(), problem_read_restart(), problem_write_restart(), and Userwork_after_loop().
Definition at line 51 of file par_circ.c.
Referenced by gasvshift(), ParticleVel(), problem(), and problem_read_restart().
Definition at line 51 of file par_circ.c.
Referenced by gasvshift(), ParticleVel(), problem(), and problem_read_restart().
Definition at line 51 of file par_circ.c.
Referenced by gasvshift(), ParticleVel(), problem(), and problem_read_restart().
Definition at line 52 of file par_circ.c.
Referenced by ParticleTroj(), problem(), and problem_read_restart().
Definition at line 52 of file par_circ.c.
Referenced by ParticleTroj(), problem(), and problem_read_restart().
Definition at line 52 of file par_circ.c.
Referenced by ParticleTroj(), problem(), and problem_read_restart().
Definition at line 52 of file par_circ.c.
Referenced by ParticleTroj(), problem(), and problem_read_restart().
Definition at line 52 of file par_circ.c.
Referenced by ParticleTroj(), problem(), and problem_read_restart().
Definition at line 52 of file par_circ.c.
Referenced by ParticleTroj(), problem(), and problem_read_restart().
Definition at line 52 of file par_circ.c.
Referenced by ParticleTroj(), problem(), and problem_read_restart().
Definition at line 50 of file par_circ.c.
Referenced by problem(), and problem_read_restart().
Definition at line 50 of file par_circ.c.
Referenced by problem(), and problem_read_restart().
Definition at line 50 of file par_circ.c.
Referenced by problem(), and problem_read_restart().
Definition at line 49 of file par_circ.c.
Referenced by gasvshift(), ParticleTroj(), ParticleVel(), problem(), problem_read_restart(), and Userwork_in_loop().
Definition at line 49 of file par_circ.c.
Referenced by gasvshift(), packing_ix1_particle_shear(), packing_ox1_particle_shear(), ParticleTroj(), ParticleVel(), problem(), problem_read_restart(), and Userwork_in_loop().
Definition at line 49 of file par_circ.c.
Referenced by gasvshift(), ParticleTroj(), ParticleVel(), problem(), problem_read_restart(), and Userwork_in_loop().
1.7.1