pub struct PyMaterial {
pub name: String,
pub class: MaterialClass,
pub young_modulus: f64,
pub poisson_ratio: f64,
pub density: f64,
pub yield_stress: Option<f64>,
pub hardening_modulus: Option<f64>,
pub viscosity: Option<f64>,
}Expand description
A material definition holding both elastic and optional plastic properties.
Fields§
§name: StringHuman-readable name.
class: MaterialClassClassification.
young_modulus: f64Young’s modulus (Pa).
poisson_ratio: f64Poisson’s ratio (dimensionless, -1 < ν < 0.5).
density: f64Mass density (kg/m^3).
yield_stress: Option<f64>Yield stress for plastic materials (Pa); ignored for elastic.
hardening_modulus: Option<f64>Isotropic hardening modulus (Pa); used after yield.
viscosity: Option<f64>Dynamic viscosity (Pa·s) for viscous fluids.
Implementations§
Source§impl PyMaterial
impl PyMaterial
Sourcepub fn elastic(name: &str, young: f64, poisson: f64, density: f64) -> Self
pub fn elastic(name: &str, young: f64, poisson: f64, density: f64) -> Self
Create a generic elastic material.
Sourcepub fn plastic(
name: &str,
young: f64,
poisson: f64,
density: f64,
yield_stress: f64,
hardening: f64,
) -> Self
pub fn plastic( name: &str, young: f64, poisson: f64, density: f64, yield_stress: f64, hardening: f64, ) -> Self
Create an elasto-plastic material.
Sourcepub fn viscous_fluid(name: &str, density: f64, viscosity: f64) -> Self
pub fn viscous_fluid(name: &str, density: f64, viscosity: f64) -> Self
Create a viscous fluid material.
Sourcepub fn rubber() -> Self
pub fn rubber() -> Self
Return natural rubber (vulcanised, approximate).
Very low Young’s modulus (~0.05 GPa) and near-incompressible (ν≈0.49).
Sourcepub fn shear_modulus(&self) -> f64
pub fn shear_modulus(&self) -> f64
Shear modulus G = E / (2(1 + ν)).
Sourcepub fn bulk_modulus(&self) -> f64
pub fn bulk_modulus(&self) -> f64
Bulk modulus K = E / (3(1 - 2ν)).
Sourcepub fn lame_lambda(&self) -> f64
pub fn lame_lambda(&self) -> f64
Lamé’s first parameter λ.
Sourcepub fn p_wave_speed(&self) -> f64
pub fn p_wave_speed(&self) -> f64
Speed of sound (longitudinal, P-wave) in the material.
Trait Implementations§
Source§impl Clone for PyMaterial
impl Clone for PyMaterial
Source§fn clone(&self) -> PyMaterial
fn clone(&self) -> PyMaterial
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 moreAuto Trait Implementations§
impl Freeze for PyMaterial
impl RefUnwindSafe for PyMaterial
impl Send for PyMaterial
impl Sync for PyMaterial
impl Unpin for PyMaterial
impl UnsafeUnpin for PyMaterial
impl UnwindSafe for PyMaterial
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.