From 520b77015da0cde6bc11aae2c05835c734a99dda Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 9 Aug 2016 13:25:49 +0100 Subject: [PATCH] Write forces dat file --- bin/plotForces.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/plotForces.py b/bin/plotForces.py index ff59ca41a..fd8ff938d 100755 --- a/bin/plotForces.py +++ b/bin/plotForces.py @@ -35,7 +35,6 @@ for line in lines: mvy.append(float(match.group(12))) mvz.append(float(match.group(13))) - # combine pressure and viscous forces and moments fx = fpx fy = fpy @@ -53,6 +52,12 @@ for i in range(1,len(t)): my[i] += mvy[i] mz[i] += mvz[i] +# write clean data file +outfile=open('forces.dat','w') + +for data in zip(t,fx,fy,fz): + outfile.write(' '.join([str(d) for d in data])+'\n') + # plot forces import pylab pylab.xlabel('iteration')