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§
Source§impl ElasticMaterial
impl ElasticMaterial
Sourcepub fn new(youngs_modulus: f64) -> Option<ElasticMaterial>
pub fn new(youngs_modulus: f64) -> Option<ElasticMaterial>
Creates a material summary with Young’s modulus only.
Sourcepub 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.
Sourcepub 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));Sourcepub 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.
Sourcepub fn shear_modulus(&self) -> Option<f64>
pub fn shear_modulus(&self) -> Option<f64>
Computes shear modulus when Poisson’s ratio is available.
Sourcepub fn bulk_modulus(&self) -> Option<f64>
pub fn bulk_modulus(&self) -> Option<f64>
Computes bulk modulus when Poisson’s ratio is available.
Trait Implementations§
Source§impl Clone for ElasticMaterial
impl Clone for ElasticMaterial
Source§fn clone(&self) -> ElasticMaterial
fn clone(&self) -> ElasticMaterial
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ElasticMaterial
impl Debug for ElasticMaterial
Source§impl PartialEq for ElasticMaterial
impl PartialEq for ElasticMaterial
Source§fn eq(&self, other: &ElasticMaterial) -> bool
fn eq(&self, other: &ElasticMaterial) -> bool
Tests for
self and other values to be equal, and is used by ==.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