PLUTO
4.4-patch2
|
Particle to grid deposition functions. More...
#include "pluto.h"
Functions | |
void | Particles_Deposit (particleNode *PHead, void(*Func)(Particle *, double *), Data_Arr Q, int nelem, Grid *grid) |
void | Particles_DepositBoundaryExchange (Data_Arr Q, int nelem, Grid *grid) |
void | Particles_Density (Particle *p, double *qd) |
Transfer particle quantities to the grid using deposition:
where qp
is a particle-related quantities (e.g. energy or mass). For deposition to be consistently done, particles can be everywhere in the domain, including ghost zones with the important exception of the very first and very last one. An error will occur in Particles_GetWeights() otherwise.
Alternatively, integer deposition can be used to verify the correctness of serial/parallel implementation:
where C
is a large number (1.e6
by default) while q_max
is the maximum value of qp
over all particles.
Deposition is always followed by a boundary condition call, since quantities deposited in the ghost zones must be exchanged with neighbour processors.
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.