(Deleted) Preserving accuracy then exporting solution values / dof


21
views
0
6 weeks ago by
medaka  
I'm trying to export the solution and testing on a simple Poisson circle problem. I have issues with preserving accuracy and get the tolerance withing 1e-7 but then its cut off. Is the following a poor way of doing it, as I don't see where the solution vector would be truncated?

import numpy as np
element = V.element()
dofmap  = V.dofmap()
coords  = np.empty([0, 2], dtype="float64")
cinds   = np.empty([0, 6], dtype="int32")
for cell in cells(mesh):
    coords = np.vstack((coords, element.tabulate_dof_coordinates(cell)))
    cinds  = np.vstack((cinds, dofmap.cell_dofs(cell.index())))
np.savetxt("coords.txt", coords)
np.savetxt("cinds.txt", cinds)
try:
    u_h = u.vector().get_local()
except:
    u_h = u.vector().array()
np.savetxt("sol.txt", np.column_stack((u_h)), fmt="%.18e")
​
Community: FEniCS Project
Please login to add an answer/comment or follow this question.
The thread is closed. No new answer/comment may be added.

Similar posts:
Search »
  • Nothing matches yet.