Skip to main content

StructuralSolver

Struct StructuralSolver 

Source
pub struct StructuralSolver {
Show 17 fields pub section: CrossSection, pub load: LoadCase, pub axial_load_n: Fix128, pub column_length_mm: Fix128, pub end_condition: ColumnEndCondition, pub material: MaterialProperties, pub plastic_model: PlasticModel, pub sn_curve: SnCurve, pub creep_params: FindleyParameters, pub norton_creep: NortonCreep, pub operating_temp_c: Fix128, pub dt_s: Fix128, pub state: PlasticState, pub elapsed_hours: Fix128, pub fatigue_damage: Fix128, pub failure_step: Option<u64>, pub step_count: u64,
}
Expand description

Structural solver configuration bundle.

Fields§

§section: CrossSection

Beam geometry (used for bending stress and axial buckling).

§load: LoadCase

Bending load applied every step.

§axial_load_n: Fix128

Axial column load (N) applied every step (0 = pure bending).

§column_length_mm: Fix128

Column length for buckling check (mm).

§end_condition: ColumnEndCondition

End condition for buckling check.

§material: MaterialProperties

Filament material.

§plastic_model: PlasticModel

Plastic constitutive model.

§sn_curve: SnCurve

Fatigue S-N curve.

§creep_params: FindleyParameters

Long-term creep parameters.

§norton_creep: NortonCreep

Norton creep (short-term); used for the plastic-state creep field.

§operating_temp_c: Fix128

Operating temperature (°C) used for time-temperature shift.

§dt_s: Fix128

Time-step size (seconds).

§state: PlasticState

State carried across steps.

§elapsed_hours: Fix128

Total elapsed simulation time (hours).

§fatigue_damage: Fix128

Accumulated fatigue damage (Miner).

§failure_step: Option<u64>

Failure step marker (once set, remains set).

§step_count: u64

Step counter.

Implementations§

Source§

impl StructuralSolver

Source

pub fn new( section: CrossSection, load: LoadCase, material: MaterialProperties, ) -> Self

Construct with from_fdm_material defaults for the given material and bending load case. Axial load defaults to zero (pure bending).

Creep: the PLA presets are installed only when material is the PLA preset (FDM category, name "PLA"). For every other material creep is not modelled (zero coefficients, Self::creep_modelled is false, reported creep strain is exactly zero) until Self::with_creep supplies parameters.

Fatigue: the S-N curve is SnCurve::for_material (SUS304 / A5052 metal presets for those preset materials, the FDM rule of thumb for every other material) until Self::with_sn_curve replaces it.

Source

pub fn with_creep(self, findley: FindleyParameters, norton: NortonCreep) -> Self

Replace both creep models, for any material. After this call creep is modelled with exactly these parameters (unless all of findley.epsilon_0, findley.m and norton.a are zero, which is the not-modelled state).

Source

pub fn with_sn_curve(self, curve: SnCurve) -> Self

Replace the S-N curve used by the per-step Miner damage, Self::fatigue_strength_mpa and Self::fatigue_spectrum_report.

Source

pub fn fatigue_strength_mpa( &self, cycles: u64, ) -> Result<Fix128, FatigueRangeError>

Alternating stress (MPa) at which the solver’s S-N curve predicts failure after exactly cycles: the Basquin inverse S = S_e · (N_e / N)^(1/m), and S_e for cycles ≥ N_e.

§Errors

FatigueRangeError::ZeroCycles for cycles == 0, FatigueRangeError::BelowLowCycleBound under 1 000 cycles (outside the Basquin range), FatigueRangeError::NonPositiveExponent for a curve with fatigue_exponent_m == 0.

Source

pub fn fatigue_spectrum_report( &self, spectrum: &[SpectrumEntry], ) -> FatigueReport

Miner’s rule D = Σ nᵢ / N(Sᵢ) of a variable-amplitude spectrum on the solver’s S-N curve, with is_safe = D < 1 and the safety factor 1 / D. Independent of the solver’s accumulated per-step damage.

Source

pub fn plate_buckling_mpa( &self, thickness_mm: Fix128, width_mm: Fix128, poisson: Fix128, edge_factor_k: Fix128, ) -> Fix128

Local plate buckling stress (MPa) of a wall of thickness_mm and width width_mm made of the solver’s material (Timoshenko): σ_cr = k · π² E / (12 (1 − ν²)) · (t / b)², E = the material’s Young’s modulus. edge_factor_k is 4 for a wall simply supported on all edges, 0.425 with one free edge; poisson is supplied by the caller because MaterialProperties carries no Poisson ratio. Returns 0 for width_mm == 0 or poisson == ±1.

Source

pub fn snap_through_load_n( &self, rise_mm: Fix128, span_mm: Fix128, ) -> Result<Fix128, SnapThroughError>

Snap-through (limit) load (N) of a shallow two-bar truss of rise rise_mm and span span_mm whose bars have the solver’s cross-section and material: P = (16 / (3√3)) · E A (h / L)³.

§Errors

SnapThroughError::NonPositiveSpan for span_mm ≤ 0, SnapThroughError::NonPositiveStiffness for a non-positive modulus or section area, SnapThroughError::NegativeRise for rise_mm < 0.

Source

pub fn creep_modelled(&self) -> bool

Whether creep is modelled for this solver. false means both creep models carry zero coefficients (creep_params.epsilon_0, creep_params.m and norton_creep.a all zero) and every StructuralReport::creep_strain is exactly zero: new leaves a non-PLA material in this state.

Source

pub fn step(&mut self) -> StructuralReport

Advance one step and return the current diagnostics.

Source

pub fn run(&mut self, n_steps: u64) -> StructuralHistory

Run for n steps and return a snapshot of the final state.

Trait Implementations§

Source§

impl Clone for StructuralSolver

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for StructuralSolver

Source§

impl Debug for StructuralSolver

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.