espressomd-devel
[Top][All Lists]
Advanced

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

[ESPResSo-devel] bugs in polymer.c


From: Peter Kosovan
Subject: [ESPResSo-devel] bugs in polymer.c
Date: Mon, 29 Oct 2007 15:10:53 +0100 (CET)

Though I am a member of the user mailing list, I think this better fits into the developers' list.

I found out that a call to polymer command with a fixed angle produces very different results in the version 1.9.7h and 2.0.2n even though I have taken care of the change of the angle definition. Examining polymer.c (version 2.0.2n), on the line 440 I found

phi = 2.0*d_random();

where should be

phi = 2.0*PI*d_random();

Using the polymer command with angle but without angle2 thus produces wierd helix-like structures with prefered absolute orientation in space. When both angle and angle2 are used, everything is correct.

Also there is another minor bug repeated several times in the same file. Using

theta  = PI*d_random();
phi    = 2.0*PI*d_random();
pos[0] = poz[0]+bond_length*sin(theta)*cos(phi);
pos[1] = poz[1]+bond_length*sin(theta)*sin(phi);
pos[2] = poz[2]+bond_length*cos(theta);

does not place a new monomer uniformly on the surface of a unit sphere around the previous one, as it is supposed to. Since the surface of 2*PI*sin(theta)*dtheta corresponds to each dtheta, this code actually prefers the new monomer to be placed around the poles (theta=0).

With regards

Peter

Peter Kosovan
Department of Physical and Macromolecular Chemistry
Faculty of Science
Charles University in Prague
Czech Republic
address@hidden
http://lynette.natur.cuni.cz
Tel. +420 221 951 290
Currently on a stay at the Wageningen University, the Netherlands




reply via email to

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