Verify stress of a run
verify_runVerifies a finished run's final STL by meshing with quadratic tets and solving von Mises stress per load case, with optional stress-limit gate and mesh/memory estimates.
Instructions
Check the final STL of a finished run with quadratic tets (P2): von Mises stress per load case.
It is independent of the voxel optimizer: it meshes result/final.stl (part_only.stl with part_only) with tets (gmsh), clamps each fixed region (a joint or spring holds the part too), loads each load region with a traction (uniform per area, the resultant is the YAML force), and solves each load case alone (no case weights). Units: mm, N, MPa.
estimate_only: default True. It returns the estimates for each mesh size (memory in bytes, time in s per measured solver), the solver that would run, the extras and the RAM, and meshes nothing. Tell the user the numbers, then call again with estimate_only=false.
A real run starts in the background and returns at once; verify_status shows it and gives the result. One verify job or optimizer run at a time: a second start is refused.
allowable_mpa, percentile: your allowable stress, no default (ranges: topopt://materials/reference). It adds a limit block. exit_code is 3 if the percentile value (by volume, default 99.9) of a case is above it. With gate it replaces the YAML stress limits (a larger value loosens them: the user's consent).
run_dir: the run folder (default: the last run that this server started). It needs run.json and result/final.stl.
gate: true adds the key gate (met per check and case; exit_code 3 if it fails); limits: the YAML's, see topopt://levers/verify_run:gate
max_gb: refuse above this memory estimate in GB; it also refuses above the available RAM. force: run anyway.
On a wrong input or a run that cannot go on: {"ok": false, "error": ..., "exit_code": 1 or 2, "facts": ...} (exit_code 1: bad input, an unsolvable part, no usable solver; exit_code 2: a missing gmsh or scikit-fem, a meshing failure, a memory refusal, an empty region).
p99.9 is the main number; the peak can move with the mesh at sharp features. A load patch can hold a large part of the top volume: read near_regions and load_band_sensitivity.
mesh_size_mm: one mesh size. Default: the tet mesher size, about 1.3 to 2.2 voxels for an sdf STL.
levels_mm: several sizes; the finest is the reference level; the result gets a levels block.
region_band_mm: a mesh node belongs to a region when it is inside the region STL or within this band of its surface. Default: 0.5 voxel (counts_by_band: the counts at 0, 0.5 and 1 band).
solver: auto (default: cholesky on macOS arm64, pardiso, cholespy, superlu) or a factor name. The result names the one that ran and those auto passed.
yaml_path: the problem YAML, if the one that run.json names is gone (moved folder).
near_region_mm: distance from a fixed or load region for the stress numbers without the region patches.
load_sensitivity: also solve the load at bands of 0 and 2 times the band.
part_only: mesh result/part_only.stl (the run needs regions.not_printed); a removed body becomes a boundary condition at its contact face, see topopt://levers/verify_run:part_only. Key: part_only.
Result keys (verify_status, when done): ok, exit_code (0 done, 3 limit failed), cases..von_mises.p99_9_by_volume_MPa. All other keys, and the keys that YAML blocks add (buckling.check, limits rows, bore_checks): topopt://levers/verify_run
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gate | No | ||
| force | No | ||
| max_gb | No | ||
| solver | No | ||
| run_dir | No | ||
| levels_mm | No | ||
| part_only | No | ||
| yaml_path | No | ||
| percentile | No | ||
| mesh_size_mm | No | ||
| allowable_mpa | No | ||
| estimate_only | No | ||
| near_region_mm | No | ||
| region_band_mm | No | ||
| load_sensitivity | No |