Particle methods discretize the Lagrangian form of convection diffusion equations. This means that particles positions follow the local flow map, and thus the particle positions eventually become distorted and the particle function representation ceases to be well sampled. To ascertain convergence it is then necessary to "remesh" the particles, by interpolating the properties they carry (vorticity, momentum, charge) onto a regular grid. A new set of particles is then created on those regular grid locations.

PPM implementation

Remeshing is implemented in PPM in the two steps:

  1. interpolate particle quantities onto a field
  2. spawn new particles on grid locations using values from a field
We assume that you have the following at hand:
REAL(MK), DIMENSION(:,:),   POINTER :: xp     ! particle positions
REAL(MK), DIMENSION([:,]:), POINTER :: up     ! particle quantities
INTEGER                             :: topoid ! topology on which the particles live
INTEGER                             :: meshid ! mesh on which your field lives
You now have to interpolate your particle values up onto the field field_up. You do this using the following a call to ppm_interp_p2m.
CALL ppm_interp_p2m (xp,np,up[,lda],topoid,meshid,ghostsize,field_up,info)
Note: after this step the ghost layers do not have valid values and you need to do a ghost get to update the ghosts.