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>
impl AnalysisBuilder<Unwired>
pub fn new() -> Self
pub fn constraint_handler( self, constraint_handler: ConstraintHandler, ) -> AnalysisBuilder<WithConstraintHandler>
Source§impl AnalysisBuilder<WithConstraintHandler>
impl AnalysisBuilder<WithConstraintHandler>
pub fn integrator<NId>( self, integrator: Integrator<NId>, ) -> AnalysisBuilder<WithIntegrator<NId>>
Source§impl<NId> AnalysisBuilder<WithIntegrator<NId>>
impl<NId> AnalysisBuilder<WithIntegrator<NId>>
pub fn algorithm( self, algorithm: Algorithm, ) -> AnalysisBuilder<WithAlgorithm<NId>>
Source§impl<NId> AnalysisBuilder<WithAlgorithm<NId>>
impl<NId> AnalysisBuilder<WithAlgorithm<NId>>
pub fn test(self, test: ConvergenceTest) -> AnalysisBuilder<Ready<NId>>
Source§impl<NId: Copy> AnalysisBuilder<Ready<NId>>
impl<NId: Copy> AnalysisBuilder<Ready<NId>>
Sourcepub 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>,
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).
Sourcepub 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>,
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§
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> 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
impl<T, U> Imply<T> for U
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.