From 67ea19f57fa536498f3755b027e4dfa3f18033e9 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 1 May 2015 13:22:08 +0100 Subject: [PATCH] Feature: filename update --- bin/plotForces.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/plotForces.py b/bin/plotForces.py index 910f367c1..ff59ca41a 100755 --- a/bin/plotForces.py +++ b/bin/plotForces.py @@ -1,5 +1,12 @@ #!/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 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 = [] @@ -7,8 +14,10 @@ fpx = []; fpy = []; fpz = [] fvx = []; fvy = []; fvz = [] mpx = []; mpy = []; mpz = [] mvx = []; mvy = []; mvz = [] -pipefile=open('forces/0/forces.dat','r') + +pipefile=open(forcesfilename,'r') lines = pipefile.readlines() + for line in lines: match=re.search(forceRegex,line) if match: