mirror of
https://github.com/ParticulateFlow/LPP.git
synced 2025-12-08 06:37:46 +00:00
convert tabs to spaces, remove extra spaces, fix comments
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# Script: distance.py
|
||||
# Script: distance.py
|
||||
# Purpose: check if any atom pairs are closer than specified distance
|
||||
# Syntax: distance.py maxcut dump.file1 dump.file2 ...
|
||||
# maxcut = flag atoms which are less than this distance apart
|
||||
@ -13,11 +13,11 @@ from math import sqrt
|
||||
|
||||
if len(argv) < 3:
|
||||
raise StandardError,"distance.py maxcut dump.file1 dump.file2 ..."
|
||||
|
||||
|
||||
maxcut = float(argv[1])
|
||||
maxcut_sq = maxcut*maxcut
|
||||
|
||||
files = ' '.join(argv[2:]) # dump files
|
||||
|
||||
files = ' '.join(argv[2:]) # dump files
|
||||
d = dump(files,0)
|
||||
d.map(1,"id",2,"type",3,"x",4,"y",5,"z")
|
||||
|
||||
@ -35,10 +35,10 @@ while 1:
|
||||
xprd = box[3] - box[0]
|
||||
yprd = box[4] - box[1]
|
||||
zprd = box[5] - box[2]
|
||||
|
||||
|
||||
for i in xrange(n):
|
||||
for j in xrange(i+1,n):
|
||||
|
||||
|
||||
delx = x[j] - x[i]
|
||||
if abs(delx) > 0.5*xprd:
|
||||
if delx < 0.0:
|
||||
@ -46,7 +46,7 @@ while 1:
|
||||
else:
|
||||
delx -= xprd
|
||||
if (delx*delx < maxcut_sq):
|
||||
|
||||
|
||||
dely = y[j] - y[i]
|
||||
if abs(dely) > 0.5*yprd:
|
||||
if dely < 0.0:
|
||||
@ -54,17 +54,17 @@ while 1:
|
||||
else:
|
||||
dely -= yprd
|
||||
if ((dely*dely + delx*delx) < maxcut_sq):
|
||||
|
||||
|
||||
delz = z[j] - z[i]
|
||||
if abs(delz) > 0.5*zprd:
|
||||
if delz < 0.0:
|
||||
delz += zprd
|
||||
else:
|
||||
delz -= zprd
|
||||
|
||||
|
||||
rsq = delx*delx + dely*dely + delz*delz
|
||||
|
||||
if rsq < maxcut_sq:
|
||||
|
||||
if rsq < maxcut_sq:
|
||||
print "time = %d, id[i] = %d, id[j] = %d," \
|
||||
" type[i] = %d, type[j] = %d, distance = %g" % \
|
||||
(time, id[i], id[j], type[i], type[j], sqrt(rsq))
|
||||
|
||||
Reference in New Issue
Block a user