Solution export to VTK drops small values

Issue #482 resolved
Andreas Hellander created an issue

If a dolfin.Function vector contains small values, e.g. 1e-19, they appear to be set to zero in

$func = dolfin.Function(self.model.mesh.get_function_space())
$... (set small values in func)
$fd = dolfin.File("trajectory.pvd")
$fd << func

In the resulting vtk-file, all values are 0.

I have the same problem when assembling matrices (small values dropped). If this is per design there should be a way to change the default behavior to not drop any small elements.

Comments (6)

  1. Prof Garth Wells

    We had reports a long time back that the small number were causing ParaView problems for some users. It would be better to not mess with the solution vector when writing to file.

    As a work-around, try using the XDMF format rather than PVD.

  2. Andreas Hellander reporter

    Yes, that is the usecase. I export the solutions for visualization in ParaView. The issue is not in the solution vector, it is in the export. I am not using the Function to solve a PDE, I use it as a container for data from my spatial stochastic solvers, so I do need to set the data manually. The XDMF format export does not seem to have this problem. Thanks.

  3. Log in to comment