Commit 98a7e04a authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

fluidsolver : fix porosity vtk output

parent 5cc7ccf3
...@@ -148,10 +148,11 @@ class FluidSolver : ...@@ -148,10 +148,11 @@ class FluidSolver :
output.write("</Cells>\n") output.write("</Cells>\n")
output.write("<PointData Scalars=\"Pressure Porosity\" Vectors=\"Velocity\">\n") output.write("<PointData Scalars=\"Pressure Porosity\" Vectors=\"Velocity\">\n")
output.write("<DataArray Name=\"Porosity\" NumberOfComponents = \"1\" type=\"Float64\" format=\"ascii\">") output.write("<DataArray Name=\"Porosity\" NumberOfComponents = \"1\" type=\"Float64\" format=\"ascii\">")
np.savetxt(output, self._pf.porosity) p = np.ndarray((vertices.shape[0]))
p[np.transpose(elements)] = self._jac.dofManager.getField(0, self._pf.porosity)
np.savetxt(output, p)
output.write("</DataArray>\n") output.write("</DataArray>\n")
output.write("<DataArray Name=\"Pressure\" NumberOfComponents = \"1\" type=\"Float64\" format=\"ascii\">") output.write("<DataArray Name=\"Pressure\" NumberOfComponents = \"1\" type=\"Float64\" format=\"ascii\">")
p = np.ndarray((vertices.shape[0]))
p[np.transpose(elements)] = self._dof.getField(dim, self._sol) p[np.transpose(elements)] = self._dof.getField(dim, self._sol)
np.savetxt(output, p) np.savetxt(output, p)
output.write("</DataArray>\n") output.write("</DataArray>\n")
......
...@@ -97,7 +97,7 @@ while t < tEnd : ...@@ -97,7 +97,7 @@ while t < tEnd :
#p.write_vtk(outputdir, ioutput, t) #p.write_vtk(outputdir, ioutput, t)
p.write(outputdir, ioutput, t) p.write(outputdir, ioutput, t)
#p.write_boundary_vtk(outputdir, ioutput, t) #p.write_boundary_vtk(outputdir, ioutput, t)
fluid.write_solution(outputdir, ioutput, t, "msh") fluid.write_solution(outputdir, ioutput, t, "vtk")
#fluid.write_solution(outputdir, ioutput, t, "vtk") #fluid.write_solution(outputdir, ioutput, t, "vtk")
ii += 1 ii += 1
print("%i : %.2g/%.2g (cpu %.2g)" % (ii, t, tEnd, time.clock() - tic)) print("%i : %.2g/%.2g (cpu %.2g)" % (ii, t, tEnd, time.clock() - tic))
......
Markdown is supported
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