Struct ElasticBar
pub struct ElasticBar {
pub length: f64,
pub area: f64,
pub youngs_modulus: f64,
}Expand description
Simple uniform elastic bar properties for axial loading summaries.
Fields§
§length: f64Original bar length in meters.
area: f64Cross-sectional area in square meters.
youngs_modulus: f64Young’s modulus in pascals.
Implementations§
§impl ElasticBar
impl ElasticBar
pub fn new(length: f64, area: f64, youngs_modulus: f64) -> Option<ElasticBar>
pub fn new(length: f64, area: f64, youngs_modulus: f64) -> Option<ElasticBar>
Creates a uniform elastic bar summary.
pub fn axial_stiffness(&self) -> Option<f64>
pub fn axial_stiffness(&self) -> Option<f64>
Computes axial stiffness for this bar.
pub fn deformation_under_force(&self, force: f64) -> Option<f64>
pub fn deformation_under_force(&self, force: f64) -> Option<f64>
Computes axial deformation under the given force.
§Examples
use use_elasticity::ElasticBar;
let Some(bar) = ElasticBar::new(10.0, 2.0, 1_000.0) else {
unreachable!();
};
assert_eq!(bar.deformation_under_force(100.0), Some(0.5));pub fn force_for_deformation(&self, deformation: f64) -> Option<f64>
pub fn force_for_deformation(&self, deformation: f64) -> Option<f64>
Computes force required to cause the given deformation.
pub fn stress_under_force(&self, force: f64) -> Option<f64>
pub fn stress_under_force(&self, force: f64) -> Option<f64>
Computes normal stress under the given force.
pub fn strain_under_force(&self, force: f64) -> Option<f64>
pub fn strain_under_force(&self, force: f64) -> Option<f64>
Computes normal strain under the given force using Young’s modulus.
Trait Implementations§
§impl Clone for ElasticBar
impl Clone for ElasticBar
§fn clone(&self) -> ElasticBar
fn clone(&self) -> ElasticBar
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 ElasticBar
impl Debug for ElasticBar
§impl PartialEq for ElasticBar
impl PartialEq for ElasticBar
impl Copy for ElasticBar
impl StructuralPartialEq for ElasticBar
Auto Trait Implementations§
impl Freeze for ElasticBar
impl RefUnwindSafe for ElasticBar
impl Send for ElasticBar
impl Sync for ElasticBar
impl Unpin for ElasticBar
impl UnsafeUnpin for ElasticBar
impl UnwindSafe for ElasticBar
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