Expand description
CarapaceInputV1 — the pysees ↔ Carapace wire format and its decoder,
(see docs/input-format.md). Header/table DTOs, the hand-written per-table
decoder into a carapace-core Domain/Analysis, and the stepped
Session/advance API. Every type here derives serde’s
Serialize/Deserialize so ../boundary.rs can hand them across
wasm_bindgen via serde-wasm-bindgen — but that boundary today
accepts plain JS objects/arrays, not the structured-clone-plus-
transferable-typed-array shapes postMessage will eventually carry.
That optimization is deferred until pysees’s compiler exists to
actually produce CarapaceInputV1 bytes; see each table’s doc comment
for the exact correspondence once it does.
Re-exports§
pub use error::DecodeError;pub use materials::MaterialSpec;
Modules§
- error
DecodeError— decode’s own diagnostic type, inAnalysisError’s style (tagged variants carrying context, not sentinel codes. This is defense in depth against whatpysees’s compiler can’t see (engine/schema version skew, a stale snapshot run against a newer/older wasm build) — the compiler is expected to catch entity-level problems (missing tags, unsupported materials, …) first.- materials
- Wire-format material arena and its resolution into
core::Materialvalues. Composite materials reference other arena entries by index rather than duplicating them inline, mirroringcore’s own arena-of-indices philosophy. - sequence
- Wire-format
AnalysisSequence— mirrors the PySeesAnalysisStagediscriminated union:Static(pushover-style),Modal(eigenvalue), andTransient(Newmark time-history, optionally driven byGroundMotionSpec). - tables
- Bulk per-(entity-kind) tables of the wire format (
docs/input-format.md), one set for both profiles (header.ndm2 or 3). Dimension-agnostic entities (nodes, trusses, zero-lengths, fibers, constraints, loads) have one table; formulations that differ between 2D and 3D (beam-columns) have one table each, suffixed2d/3d, and the table of the other profile must be empty (DecodeError::TableNotInProfile).
Structs§
- Carapace
Input V1 - The full wire payload: header plus one table per entity kind, mirroring
core’s closed-enum element/material catalog. - Continuation
Detail core::ArcStepInfofor the last accepted arc-length step of anadvance()call (StepOutcome::continuation).- Continuation
Stop Detail - Header
- Small structured-clone header fields — everything else in
CarapaceInputV1is a bulk table. - Modal
Results Report Session::modal_results’s payload: everyModalstage that has finished so far, in order.- Modal
Stage Result - Everything a finished
Modalstage computed. - Mode
Result - One computed mode of a finished
Modalstage.shapeis node-major over every node in the input’s node-table order (shape[node * ndf + dof], fixed DOFs0.0), M-normalized and sign-fixed so its largest-magnitude entry is positive.participation[d]is the modal participation factorphi^T M r_dfor global translation directiond, andmass_ratio[d]the effective modal massparticipation^2as a fraction ofModalStageResult::total_mass[d]. - Recorder
Batch - One recorder’s new samples from a single
advance()call.first_sampleplussamples.len()gives the sample range this batch covers, so a caller can retry a failed persist without renumbering — the “eachadvance()batch deterministic and identifies its first sample/count” contract from results-storage-indexeddb.md’s “Failure and cancellation contract”. Scalar-only ((pseudo_time, value)pairs, one channel) until a vector recorder needs more. - Step
Outcome advance’s result —{ done, stageComplete, stepsTaken, progressSnapshot, recorderBatch? }, minus the parts that are the worker/JS boundary’s job (progressSnapshot’s throttling,recorderBatch’sresponse_blocksbyte layout):load_factorhere is the raw signal those would be built from — for aStaticstage the integrator’s load factor, for aTransientstage the elapsed time (TransientAnalysis::time), and for aModalstage always0.0(a single eigensolve has no comparable incremental progress scalar; readMode::frequencyfrom aModeShaperecorder’s batch instead).error, once set, is sticky — later stages are not attempted, matching “a stage’sAnalysisErrorstops the sequence”.
Enums§
- Analysis
Error Detail AnalysisError’s fields, restated soadvance’s result doesn’t need to namecarapace_core’s error type directly — kept in the same tagged- variant style.- ArcFailure
Detail core::ArcFailure, restated for the wire.- Session
- One opaque handle exposed to the caller, chosen once from
ndmat decode time. - Stop
Reason Detail