Command line: md_002.py Total duration: 1662.48s File: md_002.py File duration: 1661.74s (99.96%) Line #| Hits| Time| Time per hit| %|Source code ------+----------+-------------+-------------+-------+----------- 1| 0| 0| 0| 0.00%|# md test code 2| 0| 0| 0| 0.00%| 3| 2| 3.50475e-05| 1.75238e-05| 0.00%|import platform 4| 1| 2.19345e-05| 2.19345e-05| 0.00%|from time import clock (call)| 1| 2.67029e-05| 2.67029e-05| 0.00%|# :1009 _handle_fromlist 5| 1| 2.55108e-05| 2.55108e-05| 0.00%|import numpy as np (call)| 1| 0.745732| 0.745732| 0.04%|# :978 _find_and_load 6| 1| 2.57492e-05| 2.57492e-05| 0.00%|from sys import exit (call)| 1| 1.7643e-05| 1.7643e-05| 0.00%|# :1009 _handle_fromlist 7| 1| 7.86781e-06| 7.86781e-06| 0.00%|import time ... 234| 0| 0| 0| 0.00%| # Compute the potential energy and forces 235| 12525000| 51.0831| 4.07849e-06| 3.07%| for j in range(0, p_num): 236| 12500000| 51.6473| 4.13179e-06| 3.11%| if (i != j): 237| 0| 0| 0| 0.00%| # Compute RIJ, the displacement vector 238| 49900000| 210.704| 4.22253e-06| 12.67%| for k in range(0, d_num): 239| 37425000| 177.055| 4.73093e-06| 10.65%| rij[k] = pos[k,i] - pos[k,j] 240| 0| 0| 0| 0.00%| # end for 241| 0| 0| 0| 0.00%| 242| 0| 0| 0| 0.00%| # Compute D and D2, a distance and a truncated distance 243| 12475000| 50.5158| 4.04936e-06| 3.04%| d = 0.0 244| 49900000| 209.465| 4.1977e-06| 12.60%| for k in range(0, d_num): 245| 37425000| 175.823| 4.69801e-06| 10.58%| d = d + rij[k] ** 2 246| 0| 0| 0| 0.00%| # end for 247| 12475000| 78.9422| 6.32803e-06| 4.75%| d = np.sqrt(d) 248| 12475000| 64.7463| 5.19008e-06| 3.89%| d2 = min(d, np.pi / 2.0) 249| 0| 0| 0| 0.00%| 250| 0| 0| 0| 0.00%| # Attribute half of the total potential energy to particle J 251| 12475000| 84.7846| 6.79636e-06| 5.10%| potential = potential + 0.5 * np.sin(d2) * np.sin(d2) 252| 0| 0| 0| 0.00%| 253| 0| 0| 0| 0.00%| # Add particle J's contribution to the force on particle I. 254| 49900000| 227.88| 4.56674e-06| 13.71%| for k in range(0, d_num): 255| 37425000| 244.374| 6.52971e-06| 14.70%| force[k,i] = force[k,i] - rij[k] * np.sin(2.0 * d2) / d 256| 0| 0| 0| 0.00%| # end for 257| 0| 0| 0| 0.00%| # end if 258| 0| 0| 0| 0.00%| 259| 0| 0| 0| 0.00%| # end for ...