[Top][All Lists]

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

Re: [ESPResSo] remove & change in bonded interactions

From: Axel Arnold
Subject: Re: [ESPResSo] remove & change in bonded interactions
Date: Thu, 8 Apr 2010 15:13:38 +0200
User-agent: KMail/1.10.3 (Linux/; KDE/4.1.3; x86_64; ; )

On Thursday 08 April 2010 14:56:34 samira jamalian wrote:
> Hi,
> Thanks a lot.
> Is there any command to understand whether or not two particles are bonded?

You can get the bonds attached to a particle by

part 10 print bond

which gives you a nested Tcl list of the bonds attached to particle 10. To 
check whether particle 10 and 11 are bonded by a bond of type 3, you would 

foreach b [part 10 print bond] { if {[lindex $b 0] == 3 && [lindex $b 1] == 
11} {set bonded true; break}}
foreach b [part 11 print bond] { if {[lindex $b 0] == 3 && [lindex $b 1] == 
10} {set bonded true; break}}

So you need to check both whether particle 10 is bonded to particle 11 and 
vice versa. However, normally you should know how you added the bonds, and the 
order never changes. So, if you know that you always stored the bond with the 
particle with the lower index, you just need to check for the bond there.


Dr. Axel Arnold Tel: +49 711 685 67609
ICP, Universit├Ąt Stuttgart      Email: address@hidden
Pfaffenwaldring 27
70569 Stuttgart, Germany

reply via email to

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