PLUTO  4.4-patch2
Functions
plist_tools.c File Reference

Tools for handling the particle linked list. More...

#include "pluto.h"

Functions

int Particles_Insert (Particle *dummy, Data *d, char mode, Grid *grid)
 
void Particles_Destroy (particleNode *curr, Data *d)
 
void Particles_Display (Particle *p)
 
int Particles_Number (particleNode *PNodeRef)
 
void Particles_ShowList (particleNode *PHead, int show_particles)
 

Detailed Description

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

Function Documentation

◆ Particles_Destroy()

void Particles_Destroy ( particleNode *  curr,
Data d 
)

Destroy the input node *curr and update linked list.

Parameters
[in]currpointer to concerned particleNode that has to be deleted from the list.
[in]dpointer to PLUTO Data structure

◆ Particles_Display()

void Particles_Display ( Particle *  p)

Prints the relevant quantities for particular particle.

Parameters
[in]ppointer 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]dummypointer to the particle structure to be added to the linked list.
[in,out]dpointer to the PLUTO Data structure.
[in]modespecifies the action (see table).
[in]gridpointer to an array of Grid structures.
Action Ownership CheckSet 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]PNodeRefpointer 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]PHeadpointer to headnode of the particle list.
[in]show_particlesAn integer value, if set to 1 this routine will also display relevant quantities for every particle in the list.