Skip to main content

PyMaterial

Struct PyMaterial 

Source
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: String

Human-readable name.

§class: MaterialClass

Classification.

§young_modulus: f64

Young’s modulus (Pa).

§poisson_ratio: f64

Poisson’s ratio (dimensionless, -1 < ν < 0.5).

§density: f64

Mass 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

Source

pub fn elastic(name: &str, young: f64, poisson: f64, density: f64) -> Self

Create a generic elastic material.

Source

pub fn plastic( name: &str, young: f64, poisson: f64, density: f64, yield_stress: f64, hardening: f64, ) -> Self

Create an elasto-plastic material.

Source

pub fn viscous_fluid(name: &str, density: f64, viscosity: f64) -> Self

Create a viscous fluid material.

Source

pub fn steel() -> Self

Return steel (structural carbon steel, approximate).

Source

pub fn aluminium() -> Self

Return aluminium alloy 6061.

Source

pub fn rubber() -> Self

Return natural rubber (vulcanised, approximate).

Very low Young’s modulus (~0.05 GPa) and near-incompressible (ν≈0.49).

Source

pub fn concrete() -> Self

Return concrete (normal-weight, approximate).

Source

pub fn titanium() -> Self

Return titanium alloy Ti-6Al-4V.

Source

pub fn water() -> Self

Return water at 20 °C.

Source

pub fn air() -> Self

Return air at standard conditions.

Source

pub fn shear_modulus(&self) -> f64

Shear modulus G = E / (2(1 + ν)).

Source

pub fn bulk_modulus(&self) -> f64

Bulk modulus K = E / (3(1 - 2ν)).

Source

pub fn lame_lambda(&self) -> f64

Lamé’s first parameter λ.

Source

pub fn p_wave_speed(&self) -> f64

Speed of sound (longitudinal, P-wave) in the material.

Trait Implementations§

Source§

impl Clone for PyMaterial

Source§

fn clone(&self) -> PyMaterial

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PyMaterial

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.