本文整理汇总了Python中MMTK.Trajectory.Trajectory.variables方法的典型用法代码示例。如果您正苦于以下问题:Python Trajectory.variables方法的具体用法?Python Trajectory.variables怎么用?Python Trajectory.variables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MMTK.Trajectory.Trajectory
的用法示例。
在下文中一共展示了Trajectory.variables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sqrt
# 需要导入模块: from MMTK.Trajectory import Trajectory [as 别名]
# 或者: from MMTK.Trajectory.Trajectory import variables [as 别名]
x2 += a2.beadPositions()[bead][x] * a2.mass()
y2 += a2.beadPositions()[bead][y] * a2.mass()
z2 += a2.beadPositions()[bead][z] * a2.mass()
return sqrt(((x1/m1) - (x2/m2))**2 + ((y1/m1) - (y2/m2))**2 + ((z1/m1) - (z2/m2))**2)
####################################################################################################################################################################
print '.....Performing Analysis........................................................'
#Read in trajectory from file
trajectory = Trajectory(None, dir + '//' + dir + '_prod.nc')
#Output the variables stored in the trajectory
print 'The available variables in the trajectory are:', trajectory.variables()
universe = trajectory.universe
natoms = universe.numberOfAtoms()
P = universe[0].atomList()[0].numberOfPoints()
print 'There are', natoms, 'atoms and', P, 'beads per atom present in the trajectory'
#Output files to write centre of masses to.
com_out = open(dir + '//' + dir + '_centroid_com_distance.txt','w')
bead_com_out = open(dir + '//' + dir + '_bead_com_distance.txt','w')
for step in trajectory:
#set the configuration to each new step
universe.setConfiguration(step['configuration'])
for object1 in universe.objectList():
for object2 in universe.objectList():