solid-mechanics
Solid mechanics in Rust. Stress, strain, and structural analysis.
What This Does
- Stress and strain tensors — Cauchy stress and infinitesimal strain as symmetric 3×3 matrices, with hydrostatic/deviatoric decomposition, principal values, invariants, traction vectors
- Constitutive relations — isotropic Hooke's law, Lamé parameters, 6×6 Voigt stiffness/compliance, orthotropic elasticity
- Mohr's circle — 2D and 3D construction, stress transformation, principal stresses
- Beam mechanics — Euler-Bernoulli beam: deflection, bending moment, shear force for simply-supported and cantilever beams
- Finite elements — 1D bar elements, global stiffness assembly, displacement solution, stress recovery
- Yield criteria — von Mises and Tresca
- Plane stress and plane strain — 2D stress-strain conversion, out-of-plane response, 3×3 stiffness matrices
- Energy methods — strain energy density, Castigliano's theorem, complementary energy
Install
[]
= "0.1.0"
Requires Rust 2021 edition. Depends on nalgebra and serde.
Quick Start
Stress Tensor and Principal Stresses
use StressTensor;
let sigma = from_components;
println!;
println!;
println!;
Hooke's Law
use ;
let steel = new;
let stress = uniaxial;
let strain = steel.strain_from_stress;
Mohr's Circle
use MohrCircle;
let mc = from_2d;
println!;
Beam Deflection
use EulerBernoulliBeam;
let beam = new;
println!;
1D Finite Element Analysis
use ;
let fem = uniform_bar;
let mut forces = vec!;
forces = 50000.0;
let u = fem.solve.unwrap;
Yield Criteria
use ;
let vm = new;
let stress = from_components;
println!;
println!;
License
MIT OR Apache-2.0