Feature: filename update
This commit is contained in:
parent
c1155dd9af
commit
67ea19f57f
1 changed files with 10 additions and 1 deletions
|
@ -1,5 +1,12 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
forcesfilename = 'forces/0/forces.dat'
|
||||||
|
|
||||||
|
import sys
|
||||||
|
if len(sys.argv) != 1:
|
||||||
|
print 'script assumes forces file ', forcesfilename
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
import re
|
import re
|
||||||
forceRegex=r"([0-9.Ee\-+]+)\s+\(+([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\)\s\(([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\s([0-9 .Ee\-+]+)\)+\s\(+([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\)\s\(([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\)+"
|
forceRegex=r"([0-9.Ee\-+]+)\s+\(+([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\)\s\(([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\s([0-9 .Ee\-+]+)\)+\s\(+([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\)\s\(([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\s([0-9.Ee\-+]+)\)+"
|
||||||
t = []
|
t = []
|
||||||
|
@ -7,8 +14,10 @@ fpx = []; fpy = []; fpz = []
|
||||||
fvx = []; fvy = []; fvz = []
|
fvx = []; fvy = []; fvz = []
|
||||||
mpx = []; mpy = []; mpz = []
|
mpx = []; mpy = []; mpz = []
|
||||||
mvx = []; mvy = []; mvz = []
|
mvx = []; mvy = []; mvz = []
|
||||||
pipefile=open('forces/0/forces.dat','r')
|
|
||||||
|
pipefile=open(forcesfilename,'r')
|
||||||
lines = pipefile.readlines()
|
lines = pipefile.readlines()
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
match=re.search(forceRegex,line)
|
match=re.search(forceRegex,line)
|
||||||
if match:
|
if match:
|
||||||
|
|
Reference in a new issue