diff --git a/HySoP/hysop/physics/compute_forces.py b/HySoP/hysop/physics/compute_forces.py index 8d421bec1c31f56f309c6c3c8e1822a285a07189..685ba683b56803dc984b114e06de639ea7145e2d 100644 --- a/HySoP/hysop/physics/compute_forces.py +++ b/HySoP/hysop/physics/compute_forces.py @@ -204,7 +204,7 @@ class Compute_forces(object): self.coef = 2. / (uinf ** 2 * PI * self.obstacle.radius ** 2) - def apply(self, dt, velo, vort, Re): + def apply(self, t, dt, velo, vort, Re): """ Computation of the drag according to the "impulsion" formula presented by Noca et. al in Journal of Fluids and Structures, 1999 @@ -239,10 +239,10 @@ class Compute_forces(object): comm = MPI.COMM_WORLD comm.Reduce([localForce, MPI.DOUBLE], [force, MPI.DOUBLE], op=MPI.SUM, root=0) - f = open('NocaForces.dat', 'w') - f.write(force, force / self.coef \n) - f.close() - + if (self.topo.rank == 0): + f = open('NocaForces.dat', '+w') + f.write(t, force, force / self.coef '\n') + f.close() def integrateOnBox(self, force, vort, chi, dvol, dt): """