Skip to content

mesh

Mesh loading and metadata extraction for FEM simulation data.

pvd_steps

pvd_steps(path)

Return the (timestep, absolute vtu_path) pairs of the PVD file at path, sorted by time.

vtk_series_steps

vtk_series_steps(ddir, pattern)

Return (step_index, path) pairs for the files matching pattern under ddir, in natural sort order.

lsdyna_steps

lsdyna_steps(ddir)

Return the timestep values of the d3plot database at ddir.

source_signature

source_signature(path)

Return a hash of the names, sizes and modification times of the source files of path; it changes when a mesh is exported again.

get_metadata

get_metadata(path)

Return the MeshMetadata of the mesh at path, cached as a .meta.json sidecar keyed on the schema hash and the source files.

metadata_for_series

metadata_for_series(paths)

Return MeshMetadata for the flat VTK series paths, the ordered list of per-step files, computed in memory.

metadata_for_d3plot

metadata_for_d3plot(ddir)

Return MeshMetadata for the LS-DYNA d3plot database at ddir, cached as <ddir>/d3plot.meta.json keyed on the schema hash and the database files.

load_mesh

load_mesh(path, step=0)

Return timestep step of the mesh at path (a file or a d3plot database directory) as a detached PyVista dataset.

as_surface

as_surface(mesh)

Return mesh as PolyData: a surface passes through, a volume is skinned with its point and cell arrays.

skin_with_ids

skin_with_ids(mesh)

Return (skin, volume point ids, volume cell ids) for mesh, the ids mapping per-volume arrays (a new time step, a region remap) onto the skin; both id arrays are None when mesh already is a surface.

load_skin

load_skin(path)

Return the skin of the static mesh file at path with its volume ids, cached per path.

preload_all_meshes

preload_all_meshes(project_metadata)

Fill the mesh cache from every dataset in project_metadata at server startup.

parse_labels_file

parse_labels_file(path)

Return {mesh: {material_id: [names]}} parsed from the LabelIDs.txt file at path.