Skip to main content

Material

Struct Material 

Source
pub struct Material {
    pub name: Cow<'static, str>,
    pub youngs_modulus: f64,
    pub poisson_ratio: f64,
    pub yield_strength: f64,
    pub ultimate_tensile_strength: f64,
    pub density: f64,
    pub thermal_expansion: f64,
}
Expand description

Engineering material with mechanical properties.

Fields§

§name: Cow<'static, str>

Material name / identifier.

§youngs_modulus: f64

Young’s modulus (Pa).

§poisson_ratio: f64

Poisson’s ratio (dimensionless, typically 0.2-0.5).

§yield_strength: f64

Yield strength (Pa).

§ultimate_tensile_strength: f64

Ultimate tensile strength (Pa).

§density: f64

Density (kg/m^3).

§thermal_expansion: f64

Coefficient of thermal expansion (1/K).

Implementations§

Source§

impl Material

Source

pub fn new( name: impl Into<Cow<'static, str>>, youngs_modulus: f64, poisson_ratio: f64, yield_strength: f64, ultimate_tensile_strength: f64, density: f64, thermal_expansion: f64, ) -> Result<Self>

Create a validated material.

Checks: E > 0, -1 < v < 0.5, sigma_y >= 0, UTS >= sigma_y, rho > 0.

Source

pub fn shear_modulus(&self) -> f64

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

Source

pub fn bulk_modulus(&self) -> f64

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

Source

pub fn lame_lambda(&self) -> f64

First Lame parameter.

Source

pub fn thermal_strain(&self, delta_t: f64) -> f64

Thermal strain for a given temperature change: e_th = alpha * dT.

Source

pub fn thermal_stress(&self, delta_t: f64) -> f64

Thermal stress under full constraint: sigma = E * alpha * dT.

Source

pub fn steel() -> Self

Structural steel (ASTM A36 / S275).

Source

pub fn aluminum() -> Self

Aluminum 6061-T6.

Source

pub fn copper() -> Self

Copper (annealed, C11000).

Source

pub fn titanium() -> Self

Titanium Ti-6Al-4V (annealed).

Source

pub fn glass() -> Self

Soda-lime glass.

Note: glass is brittle — yield_strength represents tensile fracture strength, not a ductile yield point.

Source

pub fn rubber() -> Self

Natural rubber (vulcanized).

Note: rubber properties are highly compound-dependent. yield_strength represents approximate tensile strength.

Source

pub fn concrete() -> Self

Normal-strength concrete (C30).

Note: yield_strength is the compressive strength. Concrete has negligible tensile strength (~3 MPa) and is primarily a compressive material.

Source

pub fn wood_oak() -> Self

Oak wood (along grain).

Note: wood is anisotropic — all values are longitudinal (along grain). Cross-grain properties differ significantly.

Source

pub fn carbon_fiber() -> Self

Carbon fiber composite (unidirectional, ~60% Vf, intermediate modulus).

Note: values are longitudinal. Transverse properties are much lower. yield_strength represents ultimate tensile strength (composites are brittle — no ductile yield).

Source

pub fn stainless_steel_304() -> Self

Stainless steel 304 (austenitic).

Source

pub fn cast_iron() -> Self

Gray cast iron (ASTM Class 40).

Note: cast iron is brittle in tension. yield_strength is the 0.2% proof stress; tensile fracture occurs at ~293 MPa with minimal plastic deformation.

Source

pub fn brass() -> Self

Brass (C36000, free-cutting).

Source

pub fn hdpe() -> Self

High-density polyethylene (HDPE).

Trait Implementations§

Source§

impl Clone for Material

Source§

fn clone(&self) -> Material

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 Material

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Material

Source§

fn default() -> Self

Defaults to structural steel.

Source§

impl<'de> Deserialize<'de> for Material

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Material

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Material

Source§

fn eq(&self, other: &Material) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Material

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Material

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,