espressomd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ESPResSo-users] Copy_particles and the right numeration


From: Axel Arnold
Subject: Re: [ESPResSo-users] Copy_particles and the right numeration
Date: Tue, 18 Feb 2014 23:53:47 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Hi Aleksei,

for technical reasons, I prefer copy_particles to use consecutive identities. Because the particle ids that you give the routine might very well not be consecutive, a simple "index + shift" would not work.

Now, if you add the parameter "-integer" to the lsort in copy_particles (scripts/auxiliary.tcl), then the particles are at least in order of increasing id. And in the special case you copy a single, consecutive range, the given ids will be consecutive as well, so that would give the behavior you desire.

For a general solution, I prefer to just return the mapping of the old ids to the new ones, which is the solution I put into the git. copy_particles then just returns a list of old-new pairs, which can be converted to an array, so that you can find the new identities simply by asking array(old id).

Best regards,
Axel

On 17.02.14 14:01, Aleksei Kabedev wrote:
Dear all,

I experience another problem with copy_particles procedure.
It seems to me, that if I copy a big structure with bonds between internal particles, the second molecule's particles won't have numbers "as originals + constant shift". Perhaps it happens when I copy set of particles once, then add some new particles, bond them and finally copy all the range once again. In all examples I experienced this problem, there were branched structures, where I mixed numbers, but they are not matches respectively anyway. I need numbers, for example, if there are few branches from one point and I have to know what are the id's of particles closest to the core particle and what are the id's of next level, so that I could use angle bonds after creating them. Here is a simple sample (sorry, it's not really good). As you can see, particles with different types should be at the same positions.

--

Kind regards,
Aleksei Kabedev


--
JP Dr. Axel Arnold
ICP, Universität Stuttgart
Allmandring 3
70569 Stuttgart, Germany
Email: address@hidden
Tel: +49 711 685 67609

Attachment: auxiliary.tcl
Description: Tcl script


reply via email to

[Prev in Thread] Current Thread [Next in Thread]