Skip to main content

Crate use_elasticity

Crate use_elasticity 

Source
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§

prelude

Structs§

ElasticBar
Simple uniform elastic bar properties for axial loading summaries.
ElasticMaterial
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 true when Poisson’s ratio is finite and between 0.0 and 0.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.