|
From: | Florian Weik |
Subject: | Re: [ESPResSo-devel] Bond-deleting strangeness |
Date: | Wed, 7 Jan 2015 15:52:46 +0100 |
Hi,
On Wed, Jan 07, 2015 at 02:42:27PM +0100, Rudolf Weeber wrote:
> I encountered very strange behaviour when deleting individual bonds from particles which have more than one bond.
> In some cases, the code works correctly, in some cases, the wrong bond seems to be deleted and in some cases, the bond list gets screwed up completely.
> The code, which is supposed to delete the bond is in particle_data.cpp:try_delete_bond()
And here is a case, where the bond list is screwed up entirely:
{0 FENE 47.396 2.5 1.0} {1 angle_harmonic 473.96000000000004 1.0471975512} {2 FENE 473960.0 2.0 1.0} {3 FENE 473960.0 0.1 0.0} {1 1 lennard-jones 1000.0 2.672696154421018 3.0 0.25 0.0 0.0 0.0 } {magnetic 1.0 dawaanr }
I.e., bond 0 and 2 have one partner, bond 1 has two partners
Initial bond configurations
{ {0 21746} {0 21747} {0 22047} {1 22047 21746} {1 22049 21747} {1 22348 22047} {1 22349 22049} }
Del: 0 21746
{ {0 21747} {0 22047} {1 22047 21746} {1 22049 21747} {22047 1} {22047 1} {22349 22049} }
---------------------------------
The relevant code is
proc makeBondRigid { id bond} {
global bondMeshPairSoft 0
global bondMeshAngleSoft 1
global bondMeshPairStiff 2
global bondParticleMesh 3
puts "$id: Making bond rigid: $bond"
# First delete the old bond
puts "[part $id print bond]"
puts " Del: $bond"
eval "part $id bond delete $bond"
puts "[part $id print bond]"
# Make new bond with changed type
lset bond 0 $bondMeshPairStiff
# Add
puts " Add: $bond"
eval "part $id bond $bond"
puts "[part $id print bond]"
}
Regards, Rudolf
[Prev in Thread] | Current Thread | [Next in Thread] |