forked from 1b-agent/fieldcraft-upstream
engine: parameter schemas for every command
cmd/forms.rs describes each command's parameters: model definitions (sets, materials with elasticity, plasticity, hyperelasticity, damage, thermal and fluid options, sections, reference points, couplings, masses, springs, boundary conditions, loads, fluid domains, steps including nonlinear and explicit), meshers, solvers, deck export, files and results. Tests check that every command has a form and that a form's defaults are accepted or refused only for the required fields left empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
5c5516aae0
commit
8848ef9e7c
16 files changed
+1071
-73
No files matched your search
@@ -43,7 +43,7 @@ pub const PAIR: CommandSpec = CommandSpec {
|
||||
r#""friction": {"static": 0.3, "kinetic": 0.2, "decay": 10} (Coulomb, μ = μk + (μs − μk) e^(−decay × slip rate); default frictionless), "penalty_scale": 1 (0 < scale ≤ 1: a factor on the stiffest penalty that leaves the time increment alone), "initial_penetration": "adjust" (move nodes that start inside onto the surface, strain-free, and report them) | "refuse" (refuse the analysis, naming the first)"#,
|
||||
r#"} — contact between two surfaces, each one's nodes kept out of the other's faces (explicit dynamics; fails if the name is taken)"#
|
||||
),
|
||||
form: None,
|
||||
form: Some(super::forms::CONTACT_PAIR),
|
||||
kind: CommandKind::Model,
|
||||
run: |s: &mut Session, p: &Value| {
|
||||
let n = name(p)?;
|
||||
@@ -61,7 +61,7 @@ pub const GENERAL: CommandSpec = CommandSpec {
|
||||
r#""friction": {"static": 0.3, "kinetic": 0.2, "decay": 10} (Coulomb, μ = μk + (μs − μk) e^(−decay × slip rate); default frictionless), "penalty_scale": 1 (0 < scale ≤ 1: a factor on the stiffest penalty that leaves the time increment alone), "initial_penetration": "adjust" (move nodes that start inside onto the surface, strain-free, and report them) | "refuse" (refuse the analysis, naming the first)"#,
|
||||
r#"} — single-surface contact of everything that may touch (explicit dynamics; fails if the name is taken)"#
|
||||
),
|
||||
form: None,
|
||||
form: Some(super::forms::CONTACT_GENERAL),
|
||||
kind: CommandKind::Model,
|
||||
run: |s: &mut Session, p: &Value| {
|
||||
let n = name(p)?;
|
||||
@@ -78,7 +78,7 @@ pub const EDIT: CommandSpec = CommandSpec {
|
||||
id: "interaction.contact.edit",
|
||||
label: "Edit Contact",
|
||||
params: r#"{"name": "impact", "surfaces": {"type": "pair", "main": "plate", "secondary": "ball"} | {"type": "general", "surface": "skin" (optional)}, "friction": {…}, "penalty_scale": 1, "initial_penetration": "adjust|refuse"} — replaces the contact of that name (the model's form; see interaction.contact.pair)"#,
|
||||
form: None,
|
||||
form: Some(super::forms::CONTACT_EDIT),
|
||||
kind: CommandKind::Model,
|
||||
run: |s: &mut Session, p: &Value| {
|
||||
let n = name(p)?;
|
||||
@@ -94,7 +94,7 @@ pub const DELETE: CommandSpec = CommandSpec {
|
||||
id: "interaction.contact.delete",
|
||||
label: "Delete Contact",
|
||||
params: r#"{"name": "impact"}"#,
|
||||
form: None,
|
||||
form: Some(super::forms::CONTACT_DELETE),
|
||||
kind: CommandKind::Model,
|
||||
run: |s: &mut Session, p: &Value| {
|
||||
s.model.remove_contact(name(p)?)?;
|
||||
@@ -109,7 +109,7 @@ pub const FIND: CommandSpec = CommandSpec {
|
||||
r#"{"tolerance": 0.1 (distance within which surfaces touch; default a tenth of the mean exterior face size), "create": false (true: add two face sets and a contact pair per touching pair of parts, named find-N-main, find-N-secondary and find-N), "#,
|
||||
r#""friction", "penalty_scale", "initial_penetration" (of the created pairs, as interaction.contact.pair)} — the parts of the mesh (solid elements connected through their nodes) whose exterior faces come within the tolerance of each other"#
|
||||
),
|
||||
form: None,
|
||||
form: Some(super::forms::CONTACT_FIND),
|
||||
kind: CommandKind::Model,
|
||||
run: find,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user