Use meshio to write a XDMF output
tianyikillua opened this issue · 3 comments
I suppose
p = FRDParser.Parse(self.file_name)
contains mesh nodes / elements as well as fields defined on nodes / elements. Instead of writing the legacy PVD / VTK files (one file per time step), a more modern format to use is XDMF which supports natively time-steps. Maybe meshio can be used to a generate an easy-to-use XDMF output.
with meshio.xdmf.TimeSeriesWriter(filename) as writer:
writer.write_points_cells(points, cells)
for t in [0.0, 0.1, 0.21]:
writer.write_data(t, point_data={"phi": data})
Yep, I have plans to get acquainted with meshio. But also it's not so difficult to write separate XMF writer. Anyway, thank you for the tip!
To me it's a surprise, that meshio deals not only with meshes, but also with data fields. In this case it would be good to merge/integrate this project with/into meshio. As I can see meshio has no FRD parser.
That's right...I suppose you could contribute a "read-only" FRD format into meshio...If you need any help please let me know!
A limitation with current meshio is that the Mesh
class doesn't consider properly data fields that vary in time...If you want to propose a FRD reader that parses FRD to a Mesh
class that would be tricky for time data. On the other hand, you can use meshio
to write a time-series data using its XDMF interface.