PLUTO
4.4-patch2
|
Particle module header file. More...
Go to the source code of this file.
Macros | |
#define | PARTICLES_CR_GC NO |
#define | PARTICLES_CR_C 1.0 |
#define | PARTICLES_CR_E_MC 1.0 |
#define | PARTICLES_CR_E_MC_GAS 1.0 |
#define | PARTICLES_CR_FEEDBACK YES |
#define | PARTICLES_CR_LARMOR_EPS 0.3 |
#define | PARTICLES_CR_NCELL_MAX 1.8 |
#define | PARTICLES_CR_NSUB 1 |
#define | PARTICLES_CR_PREDICTOR 2 |
#define | PARTICLES_CR_MAX_FILE_SIZE 1.9 /* In GB */ |
#define | PARTICLES_DUST_FEEDBACK YES |
#define | PARTICLES_DUST_TIME_STEPPING EXP_MIDPOINT |
#define | PARTICLES_DUST_STOPPING_TIME CONSTANT |
#define | PARTICLES_DUST_MAX_FILE_SIZE 1.9 /* In GB */ |
#define | PARTICLES_LP_MAX_FILE_SIZE 1.9 /* In GB */ |
Functions | |
void | Particles_Boundary (Data *, Grid *) |
void | Particles_BoundaryExchange (Data *, Grid *) |
int | Particles_BoundaryCheck (Particle *p, Grid *grid) |
long | Particles_CheckAll (particleNode *, int, Grid *) |
int | Particles_CheckSingle (Particle *, int, Grid *) |
void | Particles_CR_ComputeCurrent (const Data *, Grid *) |
void | Particles_CR_ComputeForce (Data_Arr, const Data *, Grid *) |
void | Particles_CR_ConservativeFeedback (Data_Arr, Data_Arr, double, RBox *) |
void | Particles_CR_Flux (const State *, int, int) |
void | Particles_CR_Predictor (Data *, double, Grid *) |
void | Particles_CR_States1DCopy (const Data *, const Sweep *, int, int) |
void | Particles_CR_StatesSource (const Sweep *, double, int, int, Grid *) |
void | Particles_CR_Update (Data *, timeStep *, double, Grid *) |
void | Particles_Density (Particle *, double *) |
void | Particles_Deposit (particleNode *, void(*Func)(Particle *, double *), Data_Arr, int, Grid *) |
void | Particles_DepositBoundaryExchange (Data_Arr, int, Grid *) |
void | Particles_Destroy (particleNode *, Data *) |
void | Particles_Display (Particle *) |
void | Particles_Dust_ConservativeFeedback (Data_Arr, Data_Arr, double, RBox *) |
void | Particles_Dust_StatesSource (Sweep *, Data_Arr, double, int, int, Grid *) |
void | Particles_Dust_Update (Data *, timeStep *, double, Grid *) |
void | Particles_GetWeights (Particle *, int *, double ***, Grid *) |
void | Particles_Init (Data *, Grid *) |
void | Particles_Inject (Data *d, Grid *grid) |
int | Particles_Insert (Particle *, Data *, char, Grid *) |
double | Particles_Interpolate (double ***, double ***, int *) |
void | Particles_InterpolateArr (Data_Arr, int, double ***, int *, double *) |
void | Particles_ListToArray (Data *d) |
void | Particles_LoadUniform (int, int, double *, double *, double *) |
int | Particles_LocateCell (double *, int *, Grid *) |
void | Particles_LP_Update (Data *, timeStep *, double, Grid *) |
void | Particles_LP_ComputeShockNormalSpeed (Particle *, double *, double *) |
void | Particles_LP_FixValue (Particle *, particleProbe *, Data *, Grid *) |
void | Particles_LP_FlagShock (Data *, char ***, Grid *) |
double | Particles_LP_GetEmaxAtShock (Particle *, particleProbe *, double, Grid *) |
void | Particles_LP_Get_4vel (double *, double *, double *) |
void | Particles_LP_Get_3mag (double *, double, double *) |
void | Particles_LP_IC_Emissivity (Particle *, double, double, double *) |
void | Particles_LP_InitSpectra (Particle *) |
void | Particles_LP_IntegrateSpectra (Particle *, double, double *) |
void | Particles_LP_SampleShock (Particle *, particleProbe *, Grid *) |
void | Particles_LP_UpdateSpectra (Data *, double, Grid *) |
void | Particles_LP_Sync_Emissivity (Particle *, double, double, double *, double *, double *) |
int | Particles_Number (particleNode *) |
void | Particles_Restart (Data *, int, Grid *) |
Particle * | Particles_Select (particleNode *, int) |
void | Particles_Set (Data *, Grid *) |
void | Particles_SetID (particleNode *) |
void | Particles_SetOutput (Data *, Runtime *) |
void | Particles_ShowList (particleNode *, int) |
void | Particles_WriteBinary (particleNode *, double, Output *, char *) |
void | Particles_WriteData (Data *d, Output *, Grid *) |
void | Particles_WriteTrajectory (Particle *, char) |
Contains basic macro definitions, structure definitions and global variable declarations used by the Particle module.
#define PARTICLES_CR_C 1.0 |
Sets the artificial value of the speed of light
#define PARTICLES_CR_E_MC 1.0 |
Charge to mass ratio for CR particles [CR particles].
#define PARTICLES_CR_E_MC_GAS 1.0 |
Charge to mass ratio for the fluid [CR Particles].
#define PARTICLES_CR_FEEDBACK YES |
Enable / disable CR particle feedback onto the gas [CR particles].
#define PARTICLES_CR_GC NO |
Set Guiding center approx to NO by default.
#define PARTICLES_CR_LARMOR_EPS 0.3 |
Fraction of Larmor time (1/OmegaL) covered during one hydro time step [CR particles]
#define PARTICLES_CR_MAX_FILE_SIZE 1.9 /* In GB */ |
Default size of particle binary files
#define PARTICLES_CR_NCELL_MAX 1.8 |
Maximum number of zones crossed during one sub-cycle [CR particles].
#define PARTICLES_CR_NSUB 1 |
Max number of particles time steps per hydro step. When set to a negative integer, force sub-stepping to be the same [CR particles].
#define PARTICLES_CR_PREDICTOR 2 |
Predictor step in mover. This makes the scheme 2nd order [CR particles].
#define PARTICLES_DUST_FEEDBACK YES |
Enable / disable dust particle feedback onto the gas [Dust particles].
#define PARTICLES_DUST_MAX_FILE_SIZE 1.9 /* In GB */ |
Default size of particle binary files
#define PARTICLES_DUST_STOPPING_TIME CONSTANT |
Set the particle stopping time to be consant (CONSTANT) or user-defined (USERDEF).
#define PARTICLES_DUST_TIME_STEPPING EXP_MIDPOINT |
Particles pusher (EXP_MIDPOINT
or SEMI_IMPLICIT
) [Dust particles].
#define PARTICLES_LP_MAX_FILE_SIZE 1.9 /* In GB */ |
Default size of particle binary files
Sets physical boundary conditions on particles.
[in] | d | Pointer to PLUTO data structure. |
[in] | grid | Pointer to PLUTO grid structure. |
int Particles_BoundaryCheck | ( | Particle * | p, |
Grid * | grid | ||
) |
Check if a particle is in the ghost zones or outside the whole computational domain.
<---------> <---------> | last | | .... Active Domain .... | | last |
xb2 xb1 xb0 xe0 xe1 xe2
Here 'last' marks the very last (or first) ghost zones. If a particle lies here, then deposition may not be done correctly.
In parallel mode, exchange/duplicate particles between neighbour processor. The function is done direction-wise: if a particle escapes from the left (right) boundary it is sent to the left (right) processor. The exchange is repeated direction by direction.
[in] | d | Pointer to PLUTO data structure. |
[in] | grid | Pointer to the PLUTO grid structure. |
long Particles_CheckAll | ( | particleNode * | PHead, |
int | nbuf, | ||
Grid * | grid | ||
) |
Count and return the number of particles inside a given region of the computational domain. By default (buf=0) the region is the active part of the domain (ghost zone excluded). This region may be enlarged by an additional buffer of nbuf zones in the ghost zones
int Particles_CheckSingle | ( | Particle * | p, |
int | nbuf, | ||
Grid * | grid | ||
) |
Check if the particle belongs to the local processor domain
[in] | p | pointer to Particle structure. |
[in] | nbuf | extra layer of ghost zones nbuf = 0 check if particle is in active domain; nbuf = 1 check if particle is in active zones + 1 layer of ghost zones, and so forth; |
Compute Fcr (Lorentz force felt by particles and fluid) at cell centers. Force is computed by depositing charge and current from individual particles to the grid.
[in] | V | 3D array of primitive variables, V[nv][k][j][i] |
[in,out] | d | PLUTO Data structure, containing d->Fcr[] |
[in] | grid | array of grid structures |
[in] | V | 3D array of primitive variables, V[nv][k][j][i] |
[in,out] | data | PLUTO Data structure, containing d->Fcr[] |
[in] | grid | array of grid structures |
void Particles_CR_ConservativeFeedback | ( | Data_Arr | U, |
Data_Arr | Fcr, | ||
double | dt, | ||
RBox * | box | ||
) |
Add source term to the right hand side of the conservative MHD equations.
[out] | U | An array of conserved quantities, U[k][j][i][nv] |
[in] | Fcr | An array containing the CR feedback, Fcr[4][k][j][i] |
[in] | dt | The time step increment |
[in] | box | A pointer to a RBox structure. |
void Particles_CR_Flux | ( | const State * | state, |
int | beg, | ||
int | end | ||
) |
Add CR flux contribution to MHD fluxes. On input, it requires state->Fcr
to be already computed. On output, it returns state->fluxCR
.
Advance particle velocity and speed by dt using an implicit-explicit 1st order scheme. Compute Fcr at F(t+dt), then restore particles into their original position.
data | [in/out] PLUTO data array |
dt | [in] Time step to be achieved |
grid | [in] pointer to Grid structure |
Load Fcr from 3D data into 1D state structures. This is needed later to compute the flux (Particles_CR_Flux).
Add CR flux-difference and source term contributions to L/R primitive states during the predictor step of CTU algorithm. Note that, although the update should be done in conservative variables, we choose to directly update primitive variables by performing, in place, a conservative-to-primitive recovery so that:
Note that curl and divergence operators are discretized using finite differences of fluxCR
computed in Particles_CR_Flux().
This step is done only for the primitive Hancock / Char. Trac. schemes since these are carried out in primitive variables. This step is not needed for the conservative Hancock scheme since these terms are included during the predictor.
For source terms not involving derivatives, we include ALL of the components here since no other partcles-related source term will be added during the transverse predictors. For source terms involving derivatives, we include only the normal components since the transverse predictor will add the other components through Riemann solver.
void Particles_Density | ( | Particle * | p, |
double * | qd | ||
) |
Simple deposition function used to compute particle density on the grid.
void Particles_Deposit | ( | particleNode * | PHead, |
void(*)(Particle *, double *) | Func, | ||
Data_Arr | Q, | ||
int | nelem, | ||
Grid * | grid | ||
) |
[in] | PHead | pointer to particle Node |
[in] | Func() | pointe to function containing the quantity to be deposited on the grid |
[out] | Q | The 4D data array on which func is deposited |
[in] | nelem | the number of elements |
[in] | Grid | Pointer to a grid structure |
void Particles_DepositBoundaryExchange | ( | Data_Arr | Q, |
int | nelem, | ||
Grid * | grid | ||
) |
Exchange boundary values between processors to complete the deposition process. If Q contains quantities in the boundaries, we first copy these values into auxiliary buffers snd_bufL
and snd_bufR
and then transfer them through an MPI Send/Recv call:
Seen from rank # 1, we have
A1
= snd_bufLD1
= snd_bufRD0
= rcv_bufLA2
= rcv_bufRHere 'L' or 'R' refer to the processor to the left (rank #0) and to the right (rank #2), respectively. In 2D or 3D we iterate over dimensions.
void Particles_Destroy | ( | particleNode * | curr, |
Data * | d | ||
) |
Destroy the input node *curr and update linked list.
[in] | curr | pointer to concerned particleNode that has to be deleted from the list. |
[in] | d | pointer to PLUTO Data structure |
void Particles_Display | ( | Particle * | p | ) |
Prints the relevant quantities for particular particle.
[in] | p | pointer to Particle structure whose values are to be printLoged. |
void Particles_Dust_ConservativeFeedback | ( | Data_Arr | U, |
Data_Arr | Fdust, | ||
double | dt, | ||
RBox * | box | ||
) |
Conservative feedback:
( v)_g -= dt*rho(dust)*F
Here F is the acceleration drag.
void Particles_Dust_StatesSource | ( | Sweep * | sweep, |
Data_Arr | Fdust, | ||
double | dt, | ||
int | beg, | ||
int | end, | ||
Grid * | grid | ||
) |
Add drag source term to L/R sweeps during the predictor step of CTU algorithm.
Position Verlet Algorithm for updating dust particles
With FARGO, we solve
dx/dt = v' dv'/dt = a'
A separate advection step is carried out to account for orbital advection (y -> y - q*Omega*dt)
void Particles_GetWeights | ( | Particle * | p, |
int * | cell, | ||
double *** | w, | ||
Grid * | grid | ||
) |
Compute particle weights such that
[in] | p | pointer to particle structure |
[out] | cell | a 3-element array containing the indices (i,j,k) of the grid cell that is closer and to the left of the particle. |
[out] | w | a 3x3x3 array containing the weights |
[in] | grid | a pointer to an array of Grid structures |
Sets initial conditions on particles.
[in] | d | Pointer to the PLUTO data structure. |
[in] | grid | Pointer to the PLUTO grid structure. |
Inject particles as you wish.
[in] | data | Pointer to the PLUTO data structure. |
[in] | grid | Pointer to the PLUTO grid structure. |
Insert a new particle in the linked list, if it lies on the local processor domain. Particle id is set to -1 by default.
[in] | dummy | pointer to the particle structure to be added to the linked list. |
[in,out] | d | pointer to the PLUTO Data structure. |
[in] | mode | specifies the action (see table). |
[in] | grid | pointer to an array of Grid structures. |
Action | Ownership Check | Set Id | Insert |
---|---|---|---|
PARTICLES_CREATE | Yes | No | Yes |
PARTICLES_CREATE_WITH_ID | Yes | Yes | Yes |
PARTICLES_RESTART | Yes | No | Yes |
PARTICLES_TRANSFER | No | No | Yes |
Note that when mode == PARTICLES_TRANSFER we do not check the ownership since a particle in a corner boundary has to be transferred twice and only after the second call to Particles_Insert will actually lie in the active domain.
double Particles_Interpolate | ( | double *** | V, |
double *** | w, | ||
int * | indx | ||
) |
Interpolate a grid quantity V to particle position x.
[in] | V | a 3D array defined on the fluid grid-> |
[in] | w | a 3x3x3 array containing the weights |
[in] | indx | a 3 element array giving the starting indices (i,j,k). |
void Particles_InterpolateArr | ( | double **** | V, |
int | nfield, | ||
double *** | w, | ||
int * | indx, | ||
double * | v | ||
) |
Similar to Particles_Interpolate, but performs the interpolation on n_field directly
[in] | V | a 4D array containing 3D arrays defined on the grid |
[in] | nfield | the number of arrays to be interpolated |
[in] | w | a 3x3x3 array containing the weights |
[in] | indx | a 3 element array giving the starting indices (i,j,k). |
[out] | v | a nfield element array containing interpolated values |
void Particles_ListToArray | ( | Data * | d | ) |
Convert a linked list into an array of pointers. This function must be called only after particles have been redistributed.
void Particles_LoadUniform | ( | int | i, |
int | ntot, | ||
double * | xbeg, | ||
double * | xend, | ||
double * | coor | ||
) |
Compute particles coordinate assuming a regular spacing given by l = 1/(n)^(1/d) where d is the number of spatial dimensions.
[in] | i | an integer giving the particle counter inside the region [xbeg, xend] |
[in] | ntot | the total number of particles inside the region [xbeg, xend] |
[in] | xbeg | an array specifying the coordinates of the lower bound in the domain to be filled |
[in] | xend | an array specifying the coordinates of the upper bound in the domain to be filled |
[out] | coor | an array containing the particle position |
int Particles_LocateCell | ( | double * | xp, |
int * | indx, | ||
Grid * | grid | ||
) |
Determine the index of the computational zone hosting the particle, . The search extends to the entire computational domain, including active and ghost zones.
This function works for both uniform and stretched grids and employs a binary search algorithm.
[in] | xp | a 3-element array specifying the particle position |
[out] | indx | a 3-element array giving the cell coordinate (i,j,k) |
[in] | grid | a pointer to an array of grid structures. |
Return 0 on success, 1 on error.
void Particles_LP_ComputeShockNormalSpeed | ( | Particle * | pl, |
double * | nhat, | ||
double * | vshk | ||
) |
Compute Shock speed and Normal Unit Vector using the Coplanarity theorem (See. Schwartz 1998 Chapter on Shocks).
[in] | pl | Pointer to the Particle Structure. |
[out] | nhat | 1D Vector for the Shock Normal. |
[out] | vshk | Shock Speed. |
This function finds the cell of the particles and fix all the phisical variables, interpolating them on the particle coordinates. Call this routine only after pl->coor have been correctly initialized or calculated.
[in] | pl | Pointer to the Particle. |
[in] | d | Pointer to the Data structure. |
[in] | grid | Pointer to the PLUTO grid structure. |
Flag cells that are shocked. The condition used is same as that used for the fluid. i.e., divV < 0.0, |GradP|/P > Threshold.
[in] | d | Pointer to the data structure |
[in] | grid | Pointer to the grid structure |
[out] | flag2 | 3D Array of the flagged zones. |
void Particles_LP_Get_3mag | ( | double * | b4, |
double | lf, | ||
double * | v3 | ||
) |
Computes the three components of magnetic field vector. from magnetic field four vector.
[in] | b4 | Output four magnetic field vector. |
[in] | lf | Lorentz factor. |
[out] | v3 | 1D Primitive vector with Magnetic field. |
void Particles_LP_Get_4vel | ( | double * | v3, |
double * | lf, | ||
double * | u4 | ||
) |
Compute Four velocity from three velocity.
[in] | v3 | 1D Array of primitive variables. |
[out] | lf | Lorentz factor. |
[out] | u4 | Output four velocity vector. |
double Particles_LP_GetEmaxAtShock | ( | Particle * | pl, |
particleProbe * | probe, | ||
double | AccEff, | ||
Grid * | grid | ||
) |
Compute the maximum energy of the injected energy spectrum that needs to be updated when the macro-particle crosses the shock. See Mimica 2009 & Fromm 2016.
[in] | pl | Pointer to the Particle Structure. |
[in] | AccEff | Acceleration Efficiency depends on Free Turbulence Parameter |
void Particles_LP_IC_Emissivity | ( | Particle * | pl, |
double | freq_GHz, | ||
double | ThObs, | ||
double * | JnuIC | ||
) |
Estimates the power emitted by an ensemble of electron N(E) with Isotropic radiation field of CMB photons. For non-relativistic flow approximations in the Thompson's limit are taken from Petruk et. al. 2009, typically used for Supernovae. For the relativistic flow approximations in the Thompson's limit used here are adopted from Dermer et. al. 1995. The relativistic implementation therefore account of beaming of incident CMB photon and also related relativistic effects. The output –> Total InverseCompton emissivity at the prescribed frequency is obtained in units of ergs/(s*cm^3*str)
[in] | pl | Pointer to the Particle Structure. |
[in] | freq_GHz | Observed frequency of InverseCompton radiation in GHz. |
[in] | ThObs | Line of Sight Angle subtended from the Z axis in degrees. |
[out] | JnuIC | Total InverseCompton emissivity at the prescribed frequency |
void Particles_LP_InitSpectra | ( | Particle * | pl | ) |
Initialize spectra for each particle (only for LAGRANGIAN). Specify here the initial distribution of N(E) with E for each particle
[in] | pl | Pointer to the Particle structure. |
void Particles_LP_IntegrateSpectra | ( | Particle * | pl, |
double | density, | ||
double * | totE | ||
) |
Integrate particle spectrum to give total energy.
[in] | d | Pointer to the Particle structure |
[in] | density | The fluid density interpolated on the particle. This must be provided even in pl->density is present, because IntegrateSpectra is called before LP_FIX at one time. |
[out] | totE | Integration of N(e)*e*de. |
void Particles_LP_SampleShock | ( | Particle * | pl, |
particleProbe * | probe, | ||
Grid * | grid | ||
) |
Compute upstream and downstream fluid quantites as the particles crosses the shock. The density and velocity values are required for estimating the shock normal and shock speed and finally therefore the compression ratio.
[in] | d | Pointer to the data structure. |
[in/out] | pl Pointer to the Particle structure. | |
[in] | grid | Pointer to the grid structure. |
void Particles_LP_Sync_Emissivity | ( | Particle * | pl, |
double | freq_GHz, | ||
double | ThObs, | ||
double * | JnuSync, | ||
double * | StkQ, | ||
double * | StkU | ||
) |
Routine that computes the total synchrotrn emissivity and polarised Stoke Parameters for a given observed frequency and line of sight angle. The output is obtained in cgs units : ergs/(s*cm^3*Hz*str)
[in] | pl | Pointer to the Particle Structure. |
[in] | freq_GHz | Observed frequency of synchrotron radiation in GHz. |
[in] | ThObs | Line of Sight Angle subtended from the Z axis in degrees. |
[out] | JnuSync | Total synchrotron emissivity at the prescribed frequency |
[out] | StkQ | Stoke Q Value from Linear Polarised Synchrotron emission. |
[out] | StkU | Stoke U Value from Linear Polarised Synchrotron emission. |
[in] | d | Pointer to PLUTO data structure. |
[in] | dt | Time step dt. |
[in] | grid | Pointer to the PLUTO grid structure. |
Computes the spectral evolution of the particle. It detects if the particle has crossed the shock or not. If it has then the spectra is updated based on the compression ratio value of the shock. Otherwise, particle spectra is just updated accounting for radiative losses.
[in] | d | Pointer to the data structure. |
[in] | pl | Pointer to the Particle structure. |
[in] | grid | Pointer to the grid structure. |
[in] | dt | Advection Time step. |
int Particles_Number | ( | particleNode * | PNodeRef | ) |
Count and return the number of particles owned by the current process rnk.
[in] | PNodeRef | pointer to headnode of the list whose count has to be estimated. |
Routine for restarting from particles files.
[in] | d | Pointer to the PLUTO data structure. |
[in] | nrestart | number of the restart data file given from command line |
[in] | grid | Pointer to the PLUTO grid structure. |
Particle* Particles_Select | ( | particleNode * | PHead, |
int | id | ||
) |
Loop over particle and return the one with specified id.
[in] | PHead | pointer to the head node of the particle linked list. |
[in] | id | the particle id |
Return the particle (if any), or NULL
Initialize particles on the grid and distribute them among processors.
[in] | d | Pointer to the PLUTO data structure. |
[in] | grid | Pointer to the PLUTO grid structure. |
void Particles_SetID | ( | particleNode * | PHead | ) |
Assign id to newly injected particles. The id is incrementally assigned starting from the global counter p_idCounter.
|--------------|--------------|--------------|--------------|
[A] 1,2,3 4,5 6 7,8 = N0
[B] +dn(0)=2 +dn(1)=5 +dn(2)=3 +dn(3)=4
The new id must take the value:
rank #0: 1,2,3, [N0+1, N0+dn(0)] rank #1: 4,5, [N0+dn(0)+1, N0+dn(0)+dn(1)+1] rank #2: 6, [N0+dn(0)+dn(1)+1, N0+dn(0)+dn(1)+dn(2)+1] ...
void Particles_ShowList | ( | particleNode * | PHead, |
int | show_particles | ||
) |
Prints the memory addresses (and relevant quantities of particles) of the linked list.
[in] | PHead | pointer to headnode of the particle list. |
[in] | show_particles | An integer value, if set to 1 this routine will also display relevant quantities for every particle in the list. |
void Particles_WriteBinary | ( | particleNode * | PHeadRef, |
double | dt_particles, | ||
Output * | output, | ||
char * | useless_fname | ||
) |
Write particle data in single or double precision binary format. The binary file structure is:
<Header (ASCII) section> {field1, field2, ...}_p All fields are mapped from the particle structure into an array and thus converted to either single or double precision, depending on the function that is being called. Fields can be scalars or array: for each particle nelem indicates the number of elements written for each particle. The field order does not have to match the structure member order but it must be consistent with the sequence declared in Particles_SetOutput() function. Individual fields may be excluded by calling SetOutputVar() from ChangeOutputVar ().
[in] | PheadRef | Pointer to the Head Node of Particle List. |
[in] | dt_particles | Particle time step |
[in] | output | Pointer to output structure |
Main driver of particles output data.
[in] | d | Pointer to the PLUTO data structure. |
[in] | output | Pointer to the PLUTO Output strcuture. |
void Particles_WriteTrajectory | ( | Particle * | p, |
char | mode | ||
) |
Write particle coordinates to an ASCII file, named "particle.<id>.dat" where <id> is the particle id. The file used a multiple column format,
<t> <x1> <x2> <x3> <vx1> <vx2> <vx3>
where <t> is the time column and the other contain coordinates and velocities.
[in] | p | A pointer to a particle structure |
[in] | mode | Either "w" or "a" to write or append to the file. |