pub struct ExponentialPlane { /* private fields */ }Expand description
Drive a species’ signed distance to a plane, ξ = x·n̂ − offset, to an
exponential distribution ∝ e^(−ξ/λ) (ξ ≥ 0) — a layer densest at the plane
and decaying along +n̂ with decay length λ (a diffuse layer).
strength (λ_pen) scales the squared-Wasserstein penalty; scale/scale2
are accepted for trait symmetry but unused.
Implementations§
Source§impl ExponentialPlane
impl ExponentialPlane
Sourcepub fn new(normal: [F; 3], offset: F, strength: F, lambda: F) -> Self
pub fn new(normal: [F; 3], offset: F, strength: F, lambda: F) -> Self
normal— plane normal (normalised internally; need not be unit).offset— plane offset soξ = x·n̂ − offset(the wall is atξ = 0).strength— overall penalty multiplier.lambda— exponential decay length (λ > 0).
§Panics
If the normal is the zero vector or lambda <= 0.
Trait Implementations§
Source§impl Clone for ExponentialPlane
impl Clone for ExponentialPlane
Source§fn clone(&self) -> ExponentialPlane
fn clone(&self) -> ExponentialPlane
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExponentialPlane
impl Debug for ExponentialPlane
Source§impl Restraint for ExponentialPlane
impl Restraint for ExponentialPlane
Source§fn f(&self, coords: &[[F; 3]], _scale: F, _scale2: F) -> F
fn f(&self, coords: &[[F; 3]], _scale: F, _scale2: F) -> F
Penalty value for the group’s current configuration. Read more
Source§fn fg(
&self,
coords: &[[F; 3]],
_scale: F,
_scale2: F,
grads: &mut [[F; 3]],
) -> F
fn fg( &self, coords: &[[F; 3]], _scale: F, _scale2: F, grads: &mut [[F; 3]], ) -> F
Fused value + gradient. Accumulates
∂L/∂coords[i] INTO grads[i]
with +=; returns the same value f would. grads.len() == coords.len().Source§fn is_parallel_safe(&self) -> bool
fn is_parallel_safe(&self) -> bool
If
false, the scheduler serializes this restraint (Python-backed
collective restraints MUST return false).Auto Trait Implementations§
impl Freeze for ExponentialPlane
impl RefUnwindSafe for ExponentialPlane
impl Send for ExponentialPlane
impl Sync for ExponentialPlane
impl Unpin for ExponentialPlane
impl UnsafeUnpin for ExponentialPlane
impl UnwindSafe for ExponentialPlane
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