Expand description
Simulation results (FEA/CFD) for the 3D preview – pure Rust, no ParaView.
Readers for the open result formats most solvers can write:
- legacy VTK (
.vtk): ASCII and BINARY (big endian),DATASET UNSTRUCTURED_GRIDandPOLYDATA, the classicCELLSlayout and theOFFSETS/CONNECTIVITYlayout of file version 5; - VTK XML
UnstructuredGrid(.vtu) andPolyData(.vtp):ascii, inlinebinary(base64) and appended data (raworbase64), optional zlib compression,UInt32/UInt64headers, every integer and float type; - CalculiX results (
.frd, ASCII): nodes (2C), elements (3C) and the nodal result blocks (-4 DISP,-4 STRESS, …).
Every reader fills one Grid (points, cells, point and cell data);
Grid::into_mesh turns it into the preview Mesh: volume cells
(tetrahedra, hexahedra, wedges, pyramids – quadratic ones by their corner
nodes) contribute only their outer faces (faces used by exactly one cell),
surface cells are drawn as they are, and interior points are dropped.
Result values become scalar Fields on the vertices: one-component
data as is, six- or nine-component tensors as von Mises equivalent,
other vectors as magnitude. Cell data is averaged to the points. At most
MAX_FIELDS fields are kept – the viewer offers them in a selector.
Like the mesh readers, everything is defensive: counts are limited and checked against the data before anything is allocated, decompression is bounded by the sizes the arrays need, indices are checked – a hostile file is an error, never a panic, an endless loop or an unbounded allocation.
Constants§
- MAX_
CELLS - Cells (elements) of one result file.
- MAX_
CONNECTIVITY - Node references of all cells together.
- MAX_
NODES - Points of one result file.
- MAX_
RESULT_ TRIANGLES - Surfaces with more triangles are thinned out evenly (gaps are visible, the viewer stays fast).
Functions§
- frd
- CalculiX result files (
.frd, ASCII). Nodes, elements and every nodal result block are read; a block that occurs several times (one per increment) shows its last increment. - vtk_
legacy - Legacy
.vtkfiles (UNSTRUCTURED_GRID and POLYDATA). - vtk_xml
- VTK XML
UnstructuredGrid(.vtu) andPolyData(.vtp) files.