Struct ElasticMaterial
pub struct ElasticMaterial {
pub youngs_modulus: f64,
pub poisson_ratio: Option<f64>,
}Expand description
Simple elastic material parameters for linear isotropic summaries.
Fields§
§youngs_modulus: f64Young’s modulus in pascals.
poisson_ratio: Option<f64>Poisson’s ratio when known.
Implementations§
§impl ElasticMaterial
impl ElasticMaterial
pub fn new(youngs_modulus: f64) -> Option<ElasticMaterial>
pub fn new(youngs_modulus: f64) -> Option<ElasticMaterial>
Creates a material summary with Young’s modulus only.
pub fn with_poisson_ratio(
youngs_modulus: f64,
poisson_ratio: f64,
) -> Option<ElasticMaterial>
pub fn with_poisson_ratio( youngs_modulus: f64, poisson_ratio: f64, ) -> Option<ElasticMaterial>
Creates a material summary with Young’s modulus and Poisson’s ratio.
pub fn stress_from_strain(&self, strain: f64) -> Option<f64>
pub fn stress_from_strain(&self, strain: f64) -> Option<f64>
Computes stress from strain using this material’s Young’s modulus.
§Examples
use use_elasticity::ElasticMaterial;
let Some(material) = ElasticMaterial::new(200.0) else {
unreachable!();
};
assert_eq!(material.stress_from_strain(0.01), Some(2.0));pub fn strain_from_stress(&self, stress: f64) -> Option<f64>
pub fn strain_from_stress(&self, stress: f64) -> Option<f64>
Computes strain from stress using this material’s Young’s modulus.
pub fn shear_modulus(&self) -> Option<f64>
pub fn shear_modulus(&self) -> Option<f64>
Computes shear modulus when Poisson’s ratio is available.
pub fn bulk_modulus(&self) -> Option<f64>
pub fn bulk_modulus(&self) -> Option<f64>
Computes bulk modulus when Poisson’s ratio is available.
Trait Implementations§
§impl Clone for ElasticMaterial
impl Clone for ElasticMaterial
§fn clone(&self) -> ElasticMaterial
fn clone(&self) -> ElasticMaterial
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ElasticMaterial
impl Debug for ElasticMaterial
§impl PartialEq for ElasticMaterial
impl PartialEq for ElasticMaterial
impl Copy for ElasticMaterial
impl StructuralPartialEq for ElasticMaterial
Auto Trait Implementations§
impl Freeze for ElasticMaterial
impl RefUnwindSafe for ElasticMaterial
impl Send for ElasticMaterial
impl Sync for ElasticMaterial
impl Unpin for ElasticMaterial
impl UnsafeUnpin for ElasticMaterial
impl UnwindSafe for ElasticMaterial
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more