pub trait ElementOps<const NDIM: usize, const NDOF: usize, NId: Key> {
type Load: Copy + ElementLoadComponents + Add<Output = Self::Load> + Mul<f64, Output = Self::Load>;
type Id: Key;
Show 17 methods
// Required methods
fn nodes(&self) -> NodeList<NId>;
fn dof_mask(&self) -> DofMask;
fn assemble_tangent<S: TangentSink<NId>>(
&self,
nodes: &NodeView<'_, NDIM, NDOF, NId>,
load: Option<&Self::Load>,
sink: &mut S,
);
fn assemble_load<S: VectorSink<NId>>(
&self,
nodes: &NodeView<'_, NDIM, NDOF, NId>,
load: Option<&Self::Load>,
sink: &mut S,
);
fn assemble_mass<S: VectorSink<NId>>(
&self,
nodes: &NodeView<'_, NDIM, NDOF, NId>,
sink: &mut S,
);
fn commit(
&mut self,
nodes: &NodeView<'_, NDIM, NDOF, NId>,
load: Option<&Self::Load>,
);
fn local_force_width(&self) -> usize;
fn local_force(&self, nodes: &NodeView<'_, NDIM, NDOF, NId>) -> ElementForce;
fn local_load_force(
&self,
nodes: &NodeView<'_, NDIM, NDOF, NId>,
load: Option<&Self::Load>,
) -> ElementForce;
fn fiber_responses(
&self,
nodes: &NodeView<'_, NDIM, NDOF, NId>,
) -> Option<Vec<Vec<(f64, f64)>>>;
// Provided methods
fn validate(
&self,
_nodes: &NodeView<'_, NDIM, NDOF, NId>,
) -> Result<(), &'static str> { ... }
fn accepts_load(&self, _load: &Self::Load) -> bool { ... }
fn prepare(&mut self, _nodes: &NodeView<'_, NDIM, NDOF, NId>) { ... }
fn gauss_point_count(&self) -> usize { ... }
fn gauss_component_count(&self) -> usize { ... }
fn gauss_responses(
&self,
_nodes: &NodeView<'_, NDIM, NDOF, NId>,
) -> Option<Vec<GaussResponse>> { ... }
fn shell_responses(
&self,
_nodes: &NodeView<'_, NDIM, NDOF, NId>,
) -> Option<Vec<ShellResponse>> { ... }
}Expand description
What Domain’s generic assembly/state plumbing needs from an element
catalog. A trait rather than a shared enum because Element (2D) and
Element3 (3D) hold different variant sets, and a single enum would
either duplicate every variant or need Box<dyn Trait> in the assembly
loop. NDIM/NDOF are separate const generics (not computed from each
other) because stable Rust cannot evaluate 2 * NDOF in a generic item.
Required Associated Types§
Required Methods§
Sourcefn dof_mask(&self) -> DofMask
fn dof_mask(&self) -> DofMask
The node DOF slots this element stiffens (the same for each node).
Must cover every slot on which assemble_tangent can produce a
nonzero stiffness or resistance: a slot outside the mask that no
other element, constraint or boundary condition uses is not an
equation at all, so such a contribution would be silently dropped
(debug builds assert against it).
Sourcefn assemble_tangent<S: TangentSink<NId>>(
&self,
nodes: &NodeView<'_, NDIM, NDOF, NId>,
load: Option<&Self::Load>,
sink: &mut S,
)
fn assemble_tangent<S: TangentSink<NId>>( &self, nodes: &NodeView<'_, NDIM, NDOF, NId>, load: Option<&Self::Load>, sink: &mut S, )
Tangent and internal resisting force at the current nodal state.
load is the effective element load at the pseudo-time being
assembled (every pattern’s load on this element, scaled by its
factor). Only elements whose internal state depends on the load
itself (ForceBeamColumn) read it; for every other element loads
enter only through assemble_load.
Sourcefn assemble_load<S: VectorSink<NId>>(
&self,
nodes: &NodeView<'_, NDIM, NDOF, NId>,
load: Option<&Self::Load>,
sink: &mut S,
)
fn assemble_load<S: VectorSink<NId>>( &self, nodes: &NodeView<'_, NDIM, NDOF, NId>, load: Option<&Self::Load>, sink: &mut S, )
The equivalent nodal load vector of load (zero if load is
None or of a kind this element does not carry).
Sourcefn assemble_mass<S: VectorSink<NId>>(
&self,
nodes: &NodeView<'_, NDIM, NDOF, NId>,
sink: &mut S,
)
fn assemble_mass<S: VectorSink<NId>>( &self, nodes: &NodeView<'_, NDIM, NDOF, NId>, sink: &mut S, )
Lumped (diagonal) mass, per element DOF.
Sourcefn commit(
&mut self,
nodes: &NodeView<'_, NDIM, NDOF, NId>,
load: Option<&Self::Load>,
)
fn commit( &mut self, nodes: &NodeView<'_, NDIM, NDOF, NId>, load: Option<&Self::Load>, )
Commit this element’s state at the converged nodal state. load is
the effective element load at the committed pseudo-time.
Sourcefn local_force_width(&self) -> usize
fn local_force_width(&self) -> usize
Length of local_force/local_load_force; the bound a recorder’s
component index is checked against.
Sourcefn local_force(&self, nodes: &NodeView<'_, NDIM, NDOF, NId>) -> ElementForce
fn local_force(&self, nodes: &NodeView<'_, NDIM, NDOF, NId>) -> ElementForce
This element’s local nodal force at its current committed state,
in the element’s own axis frame (the original fixed orientation for
Linear/PDelta, the current chord for Corotational). Never
mutates state.
Sourcefn local_load_force(
&self,
nodes: &NodeView<'_, NDIM, NDOF, NId>,
load: Option<&Self::Load>,
) -> ElementForce
fn local_load_force( &self, nodes: &NodeView<'_, NDIM, NDOF, NId>, load: Option<&Self::Load>, ) -> ElementForce
assemble_load’s equivalent nodal load in the same local frame as
local_force; what Domain::element_end_force subtracts so a
loaded member’s end forces include the load’s fixed-end effect.
Provided Methods§
Sourcefn validate(
&self,
_nodes: &NodeView<'_, NDIM, NDOF, NId>,
) -> Result<(), &'static str>
fn validate( &self, _nodes: &NodeView<'_, NDIM, NDOF, NId>, ) -> Result<(), &'static str>
Rejects an element whose geometry or parameters make it unusable
(coincident nodes, inverted orientation, …); called by
Domain::validate. The default accepts everything.
Sourcefn accepts_load(&self, _load: &Self::Load) -> bool
fn accepts_load(&self, _load: &Self::Load) -> bool
Whether this element can carry every kind of load present in load.
Checked by Domain::validate on each pattern’s load, before anything is
accumulated; the default accepts everything.
Sourcefn prepare(&mut self, _nodes: &NodeView<'_, NDIM, NDOF, NId>)
fn prepare(&mut self, _nodes: &NodeView<'_, NDIM, NDOF, NId>)
Caches geometry-only quantities (shape-function derivatives, areas)
once the model is final; called by Domain::validate after validate
succeeds. Must be idempotent, and every method must give the same
answer whether or not it has been called (the default does nothing).
Sourcefn gauss_point_count(&self) -> usize
fn gauss_point_count(&self) -> usize
How many Gauss points gauss_responses reports (zero for elements that
are not continuum elements); the bound a Gauss-point recorder’s point
is checked against.
Sourcefn gauss_component_count(&self) -> usize
fn gauss_component_count(&self) -> usize
Components per Gauss-point strain or stress vector (3 for plane elements, 8 for shells);
the bound a Gauss-point recorder’s component is checked against.
Sourcefn gauss_responses(
&self,
_nodes: &NodeView<'_, NDIM, NDOF, NId>,
) -> Option<Vec<GaussResponse>>
fn gauss_responses( &self, _nodes: &NodeView<'_, NDIM, NDOF, NId>, ) -> Option<Vec<GaussResponse>>
Every Gauss point’s committed strain and stress; None for every
element that is not a continuum element.
Sourcefn shell_responses(
&self,
_nodes: &NodeView<'_, NDIM, NDOF, NId>,
) -> Option<Vec<ShellResponse>>
fn shell_responses( &self, _nodes: &NodeView<'_, NDIM, NDOF, NId>, ) -> Option<Vec<ShellResponse>>
Every Gauss point’s committed generalized strain and resultants; None for every
element that is not a shell.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".