Expand description
§use-elasticity
Small scalar elasticity and mechanics-of-materials helpers for RustUse.
§Install
[dependencies]
use-elasticity = "0.0.2"§Foundation
use-elasticity provides small scalar helpers for stress, strain, Young’s modulus, shear modulus,
bulk modulus, Poisson’s ratio, axial deformation, stiffness, and elastic energy.
Inputs are expected to be SI-style numeric values:
- newtons for force
- square meters for area
- pascals for stress and elastic moduli
- meters for length, displacement, deformation, and height
- cubic meters for volume
- joules for energy
- joules per cubic meter for energy density
Material property catalogs belong in top-level use-materials.
Unit abstractions belong in top-level use-units.
Structural equilibrium helpers belong in use-statics.
Simulation belongs in top-level use-simulation.
§Example
use use_elasticity::{ElasticBar, ElasticMaterial, normal_stress};
let Some(material) = ElasticMaterial::with_poisson_ratio(260.0, 0.3) else {
unreachable!();
};
let Some(bar) = ElasticBar::new(10.0, 2.0, 1_000.0) else {
unreachable!();
};
assert_eq!(normal_stress(100.0, 2.0), Some(50.0));
assert!(matches!(material.shear_modulus(), Some(value) if (value - 100.0).abs() < 1.0e-12));
assert_eq!(bar.deformation_under_force(100.0), Some(0.5));§When to use directly
Choose use-elasticity when you need reusable scalar elasticity relations without a larger
materials or simulation layer.
§Scope
- This crate covers small scalar elasticity helpers only.
- It is not a material database, finite element solver, structural analysis engine, fracture mechanics package, plasticity model, or simulation framework.
- It does not expand into fatigue analysis, beam theory, or design-code compliance workflows.
§Status
use-elasticity is a pre-1.0 crate with a deliberately small API.
Small scalar elasticity helpers.
Modules§
Structs§
- Elastic
Bar - Simple uniform elastic bar properties for axial loading summaries.
- Elastic
Material - Simple elastic material parameters for linear isotropic summaries.
Functions§
- axial_
deformation - Computes axial deformation of a prismatic bar under linear elastic loading.
- axial_
stiffness - Computes axial stiffness of a uniform elastic bar.
- bulk_
modulus - Computes bulk modulus from pressure change and volumetric strain.
- bulk_
modulus_ from_ youngs_ and_ poisson - Computes bulk modulus from Young’s modulus and Poisson’s ratio.
- change_
in_ length - Computes change in length from strain and original length.
- change_
in_ volume - Computes change in volume from volumetric strain and original volume.
- elastic_
energy_ density - Computes elastic strain-energy density.
- elastic_
energy_ from_ force_ deformation - Computes elastic energy from force and deformation for a linear loading path.
- elastic_
energy_ from_ spring_ constant - Computes elastic energy stored in a linear spring from stiffness and deformation.
- final_
length - Computes final length after elastic axial strain.
- force_
from_ axial_ deformation - Computes force from axial deformation of a uniform elastic bar.
- force_
from_ stress - Computes force from stress and cross-sectional area.
- is_
common_ poisson_ ratio - Returns
truewhen Poisson’s ratio is finite and between0.0and0.5, inclusive. - normal_
strain - Computes normal strain from change in length and original length.
- normal_
stress - Computes normal stress from applied force and cross-sectional area.
- poisson_
ratio - Computes Poisson’s ratio from transverse and axial strain.
- pressure_
change_ from_ bulk_ modulus - Computes pressure change from bulk modulus and volumetric strain.
- shear_
modulus - Computes shear modulus from shear stress and shear strain.
- shear_
modulus_ from_ youngs_ and_ poisson - Computes shear modulus from Young’s modulus and Poisson’s ratio.
- shear_
strain - Computes engineering shear strain from lateral displacement and height.
- shear_
strain_ from_ modulus - Computes shear strain from shear stress and shear modulus.
- shear_
stress - Computes shear stress from applied force and loaded area.
- shear_
stress_ from_ modulus - Computes shear stress from shear modulus and shear strain.
- strain_
from_ youngs_ modulus - Computes strain from stress and Young’s modulus.
- stress_
from_ youngs_ modulus - Computes stress from Young’s modulus and axial strain.
- transverse_
strain_ from_ poisson_ ratio - Computes transverse strain from Poisson’s ratio and axial strain.
- volume_
strain - Computes volumetric strain from change in volume and original volume.
- youngs_
modulus - Computes Young’s modulus from stress and strain.
- youngs_
modulus_ from_ shear_ and_ poisson - Computes Young’s modulus from shear modulus and Poisson’s ratio.