pub struct InsideBoxRestraint {
pub min: [F; 3],
pub max: [F; 3],
pub periodic: [bool; 3],
}Expand description
Packmol kind 3 — quadratic penalty forcing atom inside axis-aligned box.
periodic[k] == true marks axis k as periodic: the pair-kernel
minimum-image wrap uses this box’s extent for axis k, and the cell
list on axis k wraps instead of clamping. The soft confinement
penalty (f / fg) is always active regardless of periodic — a
periodic axis still keeps atoms in the reference image via the
penalty; periodic only affects pair-distance and cell lookup.
Fields§
§min: [F; 3]§max: [F; 3]§periodic: [bool; 3]Implementations§
Source§impl InsideBoxRestraint
impl InsideBoxRestraint
Sourcepub fn new(min: [F; 3], max: [F; 3], periodic: [bool; 3]) -> Self
pub fn new(min: [F; 3], max: [F; 3], periodic: [bool; 3]) -> Self
Construct a box restraint with explicit bounds and per-axis
periodicity flags. Pass [false; 3] for a purely-confining box;
[true; 3] for a fully-periodic box; mixed flags give slab
geometries (e.g. [true, true, false] = XY-periodic slab).
Sourcepub fn cube_from_origin(origin: [F; 3], side: F, periodic: [bool; 3]) -> Self
pub fn cube_from_origin(origin: [F; 3], side: F, periodic: [bool; 3]) -> Self
Construct an axis-aligned cubic box from an origin and isotropic side length, with per-axis periodicity flags.
Sourcepub fn from_simbox(simbox: &SimBox, periodic: [bool; 3]) -> Self
pub fn from_simbox(simbox: &SimBox, periodic: [bool; 3]) -> Self
Construct an axis-aligned box from a molrs-core SimBox.
The restraint bounds are origin → origin + lengths; caller
supplies the periodic flags explicitly (the SimBox type does
not currently carry per-axis periodicity). Off-axis cells
(triclinic tilts) are not representable as an axis-aligned
restraint — write a custom impl AtomRestraint for those.
Trait Implementations§
Source§impl AtomRestraint for InsideBoxRestraint
impl AtomRestraint for InsideBoxRestraint
fn f(&self, pos: &[F; 3], scale: F, _scale2: F) -> F
fn fg(&self, pos: &[F; 3], scale: F, scale2: F, g: &mut [F; 3]) -> F
Source§fn periodic_box(&self) -> Option<([F; 3], [F; 3], [bool; 3])>
fn periodic_box(&self) -> Option<([F; 3], [F; 3], [bool; 3])>
Some((min, max, periodic))
where periodic[k] == true marks axis k as wrapping. Default
None means this restraint does not imply PBC.fn is_parallel_safe(&self) -> bool
fn name(&self) -> &'static str
Source§impl Clone for InsideBoxRestraint
impl Clone for InsideBoxRestraint
Source§fn clone(&self) -> InsideBoxRestraint
fn clone(&self) -> InsideBoxRestraint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more