Skip to main content

AnalysisBuilder

Struct AnalysisBuilder 

Source
pub struct AnalysisBuilder<S = Unwired> { /* private fields */ }
Expand description

Typestate analysis composition: each stage exposes only the next piece that must be wired, and only AnalysisBuilder<Ready> exposes .build(). Illegal sequencing (e.g. calling .build() before an algorithm is set) is a compile error, not a runtime setLinks ordering bug like Xara’s BasicAnalysisBuilder.

AnalysisBuilder<S> itself isn’t generic over the kinematic profile — only its state markers are (WithIntegrator<NId> etc., defaulted to the planar profile), since an Integrator<NId> only commits to which node ID type it controls. The rest of the profile (NDIM/NDOF/ELEMENT_DOF/ E::Id/E) is inferred at .build(domain) time from domain itself.

Implementations§

Source§

impl AnalysisBuilder<Unwired>

Source

pub fn new() -> Self

Source

pub fn constraint_handler( self, constraint_handler: ConstraintHandler, ) -> AnalysisBuilder<WithConstraintHandler>

Source§

impl AnalysisBuilder<WithConstraintHandler>

Source

pub fn integrator<NId>( self, integrator: Integrator<NId>, ) -> AnalysisBuilder<WithIntegrator<NId>>

Source§

impl<NId> AnalysisBuilder<WithIntegrator<NId>>

Source

pub fn algorithm( self, algorithm: Algorithm, ) -> AnalysisBuilder<WithAlgorithm<NId>>

Source§

impl<NId> AnalysisBuilder<WithAlgorithm<NId>>

Source

pub fn test(self, test: ConvergenceTest) -> AnalysisBuilder<Ready<NId>>

Source§

impl<NId: Copy> AnalysisBuilder<Ready<NId>>

Source

pub fn build<const NDIM: usize, const NDOF: usize, E>( self, domain: Domain<NDIM, NDOF, NId, E>, ) -> Analysis<NDIM, NDOF, NId, E>
where NId: Key, E: ElementOps<NDIM, NDOF, NId>,

Numbers DOFs and builds the sparsity/solver setup once, here — not re-checked every step. Generic over the rest of the profile (NDIM/NDOF/E::Id/E), inferred from domain’s type — this is what lets one .build() serve both Domain/Analysis and Domain3/Analysis3.

§Panics

If domain has any equal_dof/rigid_diaphragm constraint but ConstraintHandler::Plain was selected — Plain can’t resolve multi-point constraints (see its doc comment); use Transformation. Also if the model fails Domain::validate (use try_build to receive that as an error instead). Both are model-construction errors, not runtime conditions, so build reports them by panicking (runtime failures are reported as errors; misuse of the builder is not).

Source

pub fn try_build<const NDIM: usize, const NDOF: usize, E>( self, domain: Domain<NDIM, NDOF, NId, E>, ) -> Result<Analysis<NDIM, NDOF, NId, E>, ModelError>
where NId: Key, E: ElementOps<NDIM, NDOF, NId>,

build, but a model that fails Domain::validate is returned as a ModelError — what a caller that must not panic (the wasm session) uses. Still panics on a ConstraintHandler::Plain / constraint mismatch, which is a programming error rather than a model problem.

Trait Implementations§

Source§

impl Default for AnalysisBuilder<Unwired>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<S> Freeze for AnalysisBuilder<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for AnalysisBuilder<S>
where S: RefUnwindSafe,

§

impl<S> Send for AnalysisBuilder<S>
where S: Send,

§

impl<S> Sync for AnalysisBuilder<S>
where S: Sync,

§

impl<S> Unpin for AnalysisBuilder<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for AnalysisBuilder<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for AnalysisBuilder<S>
where S: UnwindSafe,

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
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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
§

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

§

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

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

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

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

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.