Skip to main content

Simulation handoff API

cadflow.simulation describes distributed face contact and material assignments for an assembly. CadFlow validates and packages geometry evidence; meshing, loads, boundary conditions, stepping, nonlinear solution, and convergence remain responsibilities of the downstream solver adapter.

Model contents

ContactSimulationModel contains:

CollectionIdentityRole
surfacessurface_idComponent-local face regions and roles
contact_lawslaw_idNormal and tangential constitutive declaration
contact_pairspair_idTwo surfaces, law, search and sliding settings
surface_propertiesproperty_idThickness or other region properties
materialsmaterial_idMechanical material values
component_materialscomponent IDMaterial assignment

The model also records explicit length, force, time, and temperature units. Derived pressure, penalty, damping, density, and thermal-expansion units are included in serialized data.

Surface references

make_surface_region_rsurfaceregion accepts compatibility faces or replayable GeometryRef values. geometry_ref_from_face(face, flip=False) creates a stable selector from a public face. flip reverses the intended surface orientation in simulation evidence.

Surface resolution checks that the component exists, resolves each selector, and records stable face evidence. Current packaging expects target parts to be directly resolvable from the assembly structure.

Constitutive declarations

SurfaceContactLaw supports the documented NormalContactModel, FrictionModel, and related penalty/cohesive parameters. SurfaceContactPair connects two distinct surfaces and specifies clearance or interference, search tolerance, opposed-normal threshold, sliding formulation, and optional activation step.

MechanicalMaterial stores explicit elastic, density, yield, thermal, and metadata fields. CadFlow never derives engineering constants from a material name.

Validate, analyze, export

report = cad.validate_contact_simulation_model_rcontactsimulationvalidationreport(
simulation, assembly
)
report.raise_for_errors()
analysis = cad.analyze_contact_simulation_model_rcontactsimulationanalysis(
simulation, assembly
)
manifest = cad.export_contact_simulation_package_rpath(
simulation, assembly, "out/contact-package"
)

Validation checks schema and cross-references. Analysis resolves surfaces and computes native face/pair metrics such as area, centroid, bounds, separation, and relative orientation. Export writes simulation JSON, component-local BREP geometry, selected faces, hashes, indices, and rigid transforms.

Candidate or metric evidence is preprocessing information, not a solved contact state. A solver adapter must define how neutral laws map to solver-specific cards and document any unsupported field.

See all 22 Simulation symbols.