Tools for handling the particle linked list.
More...
Collect various functions for adding / destroying particles.
- Authors
- A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it)
- Date
- Jul 25, 2019
◆ Particles_Destroy()
void Particles_Destroy |
( |
particleNode * |
curr, |
|
|
Data * |
d |
|
) |
| |
Destroy the input node *curr and update linked list.
- Parameters
-
[in] | curr | pointer to concerned particleNode that has to be deleted from the list. |
[in] | d | pointer to PLUTO Data structure |
◆ Particles_Display()
void Particles_Display |
( |
Particle * |
p | ) |
|
Prints the relevant quantities for particular particle.
- Parameters
-
[in] | p | pointer to Particle structure whose values are to be printLoged. |
◆ Particles_Insert()
int Particles_Insert |
( |
Particle * |
dummy, |
|
|
Data * |
d, |
|
|
char |
mode, |
|
|
Grid * |
grid |
|
) |
| |
Insert a new particle in the linked list, if it lies on the local processor domain. Particle id is set to -1 by default.
- Parameters
-
[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.
- Returns
- Return TRUE if particle was added to the list. FALSE otherwise.
◆ Particles_Number()
int Particles_Number |
( |
particleNode * |
PNodeRef | ) |
|
Count and return the number of particles owned by the current process rnk.
- Parameters
-
[in] | PNodeRef | pointer to headnode of the list whose count has to be estimated. |
◆ Particles_ShowList()
void Particles_ShowList |
( |
particleNode * |
PHead, |
|
|
int |
show_particles |
|
) |
| |
Prints the memory addresses (and relevant quantities of particles) of the linked list.
- Parameters
-
[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. |