AKEngels / CAST

Conformational Analysis and Search Tool
GNU Lesser General Public License v3.0
1 stars 5 forks source link

Sometimes umbrella.txt file contains only zeroes #17

Closed S0S-90 closed 5 years ago

S0S-90 commented 5 years ago

When doing an umbrella calculation sometimes the umbrella.txt file is filled with a lot of zeroes, either right from the beginning or after a while (e. g. several 100000 steps). The simulation seems to run normally in these cases. The problem is not reproducible, i. e. if running the same calculation with the same inputfile it doesn't happen again. In a scan with around 5000 windows this happens 10 - 20 times.

S0S-90 commented 5 years ago

The cause of this seems to be that first the kinetic energy is NaN, then also the coordinates and thus the potential energy. For an umbrella torsion of 0° this happens when the torsion is exactly at 0° and so the unbrella bias has nearly no effect on the gradients. Still strange...

S0S-90 commented 5 years ago

This issue is fixed in branch "umbrella_fix". The problem was in calculating an angle between two vectors for the torsional angles. If this angle is very close to zero sometimes the cosinus becomes bigger than 1 because of numerical problems. Then the arccos gave back NaN as torsional angle and so all the forces and velocities also were NaN. Now there is an error catching in that function that returns the arccos of 1 when the input is bigger than 1, and the arccos of -1 when the input is smaller than -1.