Commit db710ffb authored by Matthieu Constant's avatar Matthieu Constant
Browse files

time.time

parent 46d4ebaa
......@@ -94,7 +94,7 @@ for i in range(len(x[:,0])):
fluid.export_vtk(outputdir,0,0)
ii = 0
tic = time.clock()
tic = time.time()
while t < tEnd :
#Fluid solver
fluid.implicit_euler(dt)
......@@ -106,4 +106,4 @@ while t < tEnd :
ioutput = int(ii/outf) + 1
fluid.export_vtk(outputdir, t, ioutput)
ii += 1
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.clock() - tic))
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.time() - tic))
......@@ -93,7 +93,7 @@ fluid = fluid.fluid_problem("mesh.msh",g,nu*rho,rho,epsilon,strong_boundaries)
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
fluid.export(outputdir,0,0)
tic = time.clock()
tic = time.time()
#Computation loop
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
while t < tEnd :
......@@ -119,5 +119,5 @@ while t < tEnd :
p.write_vtk(outputdir, ioutput, t)
fluid.export_vtk(outputdir, t, ioutput)
ii += 1
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.clock() - tic))
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.time() - tic))
......@@ -98,7 +98,7 @@ fluid = fluid.fluid_problem("mesh.msh",g,nu*rho,rho,epsilon,strong_boundaries)
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
fluid.export(outputdir,0,0)
tic = time.clock()
tic = time.time()
#Computation loop
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
while t < tEnd :
......@@ -124,4 +124,4 @@ while t < tEnd :
p.write_vtk(outputdir, ioutput, t)
fluid.export_vtk(outputdir, t, ioutput)
ii += 1
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.clock() - tic))
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.time() - tic))
......@@ -106,7 +106,7 @@ fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
fluid.export_vtk(outputdir,0,0)
ii = 0
tic = time.clock()
tic = time.time()
while t < tEnd :
#Adaptation of the mesh. Args are minimal mesh radius, maximal mesh radius and number of elements
if (ii%5==0 and ii != 0):
......@@ -133,4 +133,4 @@ while t < tEnd :
p.write_vtk(outputdir, ioutput, t)
fluid.export_vtk(outputdir, t, ioutput)
ii += 1
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.clock() - tic))
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.time() - tic))
......@@ -96,7 +96,7 @@ class Poiseuille(unittest.TestCase) :
fluid.export_vtk(outputdir,0,0)
ii = 0
tic = time.clock()
tic = time.time()
while ii < 100 :
#Fluid solver
fluid.implicit_euler(dt)
......@@ -106,7 +106,7 @@ class Poiseuille(unittest.TestCase) :
ioutput = int(ii/outf) + 1
fluid.export_vtk(outputdir, t, ioutput)
ii += 1
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.clock() - tic))
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.time() - tic))
s = fluid.solution()
x = fluid.coordinates()
......
......@@ -91,7 +91,7 @@ class Poiseuille(unittest.TestCase) :
fluid.export_vtk(outputdir,0,0)
ii = 0
tic = time.clock()
tic = time.time()
while ii < 100 :
#Fluid solver
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
......@@ -110,7 +110,7 @@ class Poiseuille(unittest.TestCase) :
fluid.export_vtk(outputdir, t, ioutput)
p.write_vtk(outputdir, ioutput, t)
ii += 1
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.clock() - tic))
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.time() - tic))
V.append(abs(p.velocity()[0,1]))
V = np.array(V)
......
......@@ -110,7 +110,7 @@ class Poiseuille(unittest.TestCase) :
fluid.export_vtk(outputdir,0,0)
ii = 0
tic = time.clock()
tic = time.time()
while ii < 100:
#Fluid solver
fluid.implicit_euler(dt)
......@@ -120,7 +120,7 @@ class Poiseuille(unittest.TestCase) :
ioutput = int(ii/outf) + 1
fluid.export_vtk(outputdir, t, ioutput)
ii += 1
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.clock() - tic))
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.time() - tic))
s = fluid.solution()
x = fluid.coordinates()
......
......@@ -93,7 +93,7 @@ class Poiseuille(unittest.TestCase) :
fluid.export_vtk(outputdir,0,0)
ii = 0
tic = time.clock()
tic = time.time()
while ii < 100 :
#Fluid solver
fluid.implicit_euler(dt)
......@@ -103,7 +103,7 @@ class Poiseuille(unittest.TestCase) :
ioutput = int(ii/outf) + 1
fluid.export_vtk(outputdir, t, ioutput)
ii += 1
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.clock() - tic))
print("%i : %.2g/%.2g (cpu %.6g)" % (ii, t, tEnd, time.time() - tic))
s = fluid.solution()
x = fluid.coordinates()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment