Re: ordering of particles

From: Yves Revaz <>
Date: Thu, 23 Feb 2006 09:02:44 +0100

Pedro Colin wrote:

>I have simulated a galaxy (disk + dm halo) with multiple species. Disk and
>(first species) dm halo are located within the same type (1 in this case).
>So, initially the first 1 to Ndisk are disk particles and Ndisk+1,...,
>Nspecies(1) are dm particles. Later, this is not the case (gadget2
>parallel), they are mixed. I thought I could bring the particles back into
>original order by assuming that now id(1), ..., id(Ndisk) are the ids of
>disk particles; that is, for example, pos(1,id(i)), where i=1, Ndisk, are
>the position of the disk particles. Well, this is not the case, so I
No, this is not correct.
If, in your initial condition file, a certain particle i
as has its id = 7 (P.ID[i]=7), to find this same particle in another
you have to find the particle j with P.ID[j]=7.

Thus, in your case, when creating your initial conditions, you
first have to record the id for the DM (let's create the vector id_dm)
and for the disk (vector id_disk) independently.
Then in a certain snapshot, to find DM particles, you just have to
find all particles that have an id in id_dm.

I hope it will help.


>wonder what I need to do to identify, for example, the disk particles.
>If you wish to unsubscribe from this mailing, send mail to
> with a subject of: unsubscribe gadget-list
>A web-archive of this mailing list is available here:

                                                 (o o)
  Yves Revaz
  Geneva Observatory	       Tel : ++ 41 22 379 23 65
  51. Ch. des Maillettes       Fax : ++ 41 22 379 22 05
  1290 Sauverny 	           e-mail :
Received on 2006-02-23 09:02:54

This archive was generated by hypermail 2.3.0 : 2023-01-10 10:01:30 CET