calculix / ccx2paraview

CalculiX to Paraview converter (frd to vtk/vtu). Makes possible to view and postprocess CalculiX analysis results in Paraview. Generates Mises and Principal components for stress and strain tensors.
GNU General Public License v3.0
91 stars 18 forks source link

Use meshio to write a XDMF output #6

Open tianyikillua opened 4 years ago

tianyikillua commented 4 years ago

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})
imirzov commented 4 years ago

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.

tianyikillua commented 4 years ago

That's right...I suppose you could contribute a "read-only" FRD format into meshio...If you need any help please let me know!

tianyikillua commented 4 years ago

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.