2D iovtk Files corrupted

Dear FF+±Users & Developers,
I’m facing an issue with iovtk 2d where both binary and ASCII files are corrupted. Paraview is unable to read correctly the files.
I have used version ff++3.36 ff+±4.0 on Ubuntu and MacOS and still having the same issue.
Please if you have any alternatives or patching of the bug please share it.
mk.

Hi,

Are you sure that your solution is correct (no NaN or Inf) using plot in FreeFEM ?
If there is some NaN of Inf in the .vtu or .vtk file, Paraview is unable to open the file.

Hi Simon,
I double checked and I don’t find any NAN in my ascii .vtk . I think I realize what is the issue: Actually, if I want to plot a vector field let’s say, [u,v] I should not put the any other fem function beside like for instance in the Navier stokes equation (even take the example that ff++ gives)
when I try to savevtk( [u,v,],p,…) the file will become corrupted and paraview pops errors while loading the files. I had to do savevtk( [u,v,],…) without the pressure p.
This only occurs for me in the 2d calculation case. The 3d case is fine.
Thank you again and best wishes,
mk.

Some important remarks:

  • you must save in P1
  • you can save multiple data, for example here velocity and pressure

What I do:

fespace PV(Th, P1);
PV uu=u, vv=v; // interpolate in P1
string dataname = "u p"; // variable name in Paraview
int[int] order = [1, 1]; // order (default in 0)
savevtk("res.vtu", Th, [uu, vv], p, dataname=dataname, order=order);

Does it works for you?