From 9fb00317adc5ff97fb2283787605ca5d75e8342d Mon Sep 17 00:00:00 2001 From: Irakli Kourtis Date: Tue, 13 Oct 2026 16:54:25 -0400 Subject: [PATCH] Add the modelcraft-decks crate (empty: error type only) (#19) So the Abaqus, Nastran and LS-DYNA writer tasks add their modules in parallel. Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 --- Cargo.lock | 8 ++++++++ Cargo.toml | 1 + crates/decks/Cargo.toml | 13 +++++++++++++ crates/decks/src/lib.rs | 20 ++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 crates/decks/Cargo.toml create mode 100644 crates/decks/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 4d5a32f..2df2c5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1841,6 +1841,14 @@ dependencies = [ "serde_json", ] +[[package]] +name = "modelcraft-decks" +version = "0.1.0" +dependencies = [ + "modelcraft-model", + "thiserror 2.0.21", +] + [[package]] name = "modelcraft-engine" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index ef5af8c..70b8dd7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ repository = "https://github.com/jyviko/modelcraft" modelcraft-model = { path = "crates/model" } modelcraft-geometry = { path = "crates/geometry" } modelcraft-mesh = { path = "crates/mesh" } +modelcraft-decks = { path = "crates/decks" } modelcraft-engine = { path = "crates/engine" } modelcraft-testkit = { path = "crates/testkit" } modelcraft-render = { path = "crates/render" } diff --git a/crates/decks/Cargo.toml b/crates/decks/Cargo.toml new file mode 100644 index 0000000..97bf2c1 --- /dev/null +++ b/crates/decks/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "modelcraft-decks" +description = "ModelCraft's solver decks: Abaqus input, Nastran bulk data and LS-DYNA keyword writers (and later readers)" +version.workspace = true +edition.workspace = true +license.workspace = true + +[lints] +workspace = true + +[dependencies] +modelcraft-model = { workspace = true } +thiserror = { workspace = true } diff --git a/crates/decks/src/lib.rs b/crates/decks/src/lib.rs new file mode 100644 index 0000000..3cbeef9 --- /dev/null +++ b/crates/decks/src/lib.rs @@ -0,0 +1,20 @@ +//! Solver decks: the solver-neutral model written as Abaqus input, Nastran bulk data and LS-DYNA +//! keyword files. Each format is its own module (`abaqus`, `nastran`, `lsdyna`), written from the +//! vendor's public reference manual in our own words; examples and expected files are our own. +//! Writers read [`modelcraft_model::Model`] and its `resolve()` result, never another format. +#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] +#![forbid(unsafe_code)] + +#[derive(Debug, Clone, PartialEq, thiserror::Error)] +pub enum Error { + /// The model has something this format cannot express (named, with the format). + #[error("not supported by {format}: {what}")] + Unsupported { format: &'static str, what: String }, + /// The model is not ready to write (its check failed). + #[error(transparent)] + Model(#[from] modelcraft_model::Error), + #[error("limit reached: {0}")] + Limit(String), +} + +pub type Result = std::result::Result;