Tools required to define the Particle MPI struct and Interpolating quantities from grid to particles.
More...
|
long | Particles_CheckAll (particleNode *PHead, int nbuf, Grid *grid) |
|
int | Particles_CheckSingle (Particle *p, int nbuf, Grid *grid) |
|
double | Particles_Interpolate (double ***V, double ***w, int *indx) |
|
void | Particles_InterpolateArr (double ****V, int nfield, double ***w, int *indx, double *v) |
|
int | Particles_LocateCell (double *xp, int *indx, Grid *grid) |
|
Particle * | Particles_Select (particleNode *PHead, int id) |
|
◆ Particles_CheckAll()
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
◆ Particles_CheckSingle()
int Particles_CheckSingle |
( |
Particle * |
p, |
|
|
int |
nbuf, |
|
|
Grid * |
grid |
|
) |
| |
Check if the particle belongs to the local processor domain
- Parameters
-
[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; |
- Returns
- TRUE if the particle is inside the specified region. FALSE otherwise.
◆ Particles_Interpolate()
double Particles_Interpolate |
( |
double *** |
V, |
|
|
double *** |
w, |
|
|
int * |
indx |
|
) |
| |
Interpolate a grid quantity V to particle position x.
- Parameters
-
[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). |
- Returns
- The interpolated value of V at the desired location.
◆ Particles_InterpolateArr()
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
- Parameters
-
[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 |
◆ Particles_LocateCell()
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.
- Parameters
-
[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.
◆ Particles_Select()
Particle* Particles_Select |
( |
particleNode * |
PHead, |
|
|
int |
id |
|
) |
| |
Loop over particle and return the one with specified id.
- Parameters
-
[in] | PHead | pointer to the head node of the particle linked list. |
[in] | id | the particle id |
Return the particle (if any), or NULL