Expand description
Safe calls into the d-SEAMS C API.
The crates.io package is dseams; the library keeps the name seams,
so code says use seams::System. The raw constants (graph and CHILL
variants) are re-exported as ffi.
dseams-sys stays a raw FFI crate. This crate owns every handle, frees
it in Drop, and returns Result<T, Error>. The error text
is the string from seams_handle_error. Coordinates and cutoffs are
angstroms. A cell is nine LAMMPS numbers: origin, edge lengths, then
the tilts xy, xz, yz.
Analyses with several knobs take an options struct. Neighbour lists and
rings yield iterators. A handle may move to another thread (Send).
It is not Sync: the C library requires exclusive use of a handle.
Separate handles may run the Steinhardt calls on separate threads.
§Quick example
let (xyz, edge) = seams::diamond8();
seams::set_num_threads(1)?;
let mut system = seams::System::new()?;
system.set_ortho(&xyz, edge, edge, edge)?;
assert_eq!(system.count(), 8);
let ice = system.chill_plus(&seams::ChillOptions::default())?;
assert_eq!(ice.counts[seams::Label::Cubic as usize], 8);
let orders = system.q4q6(3.5)?;
assert!(orders.q6.iter().all(|value| value.is_finite()));dseams-sys links the libseams in SEAMS_LIBDIR when that is set,
and otherwise finds an installed one through pkg-config. The bundled
feature compiles a copy from the pinned seams-core sources instead.
Re-exports§
pub use seams_sys as ffi;
Structs§
- Bond
Options - Knobs for a hydrogen-bond count.
- Brine
- Owned planar ice-front measurement.
- Brine
Fronts - The two planar crossings of an ice slab.
- Brine
Options - Knobs for a planar ice front.
- Brine
Profile - Concentration profile along the brine axis.
- Cage
Counts - Disjoint cage populations.
- Cage
Options - Knobs for hexagonal and double-diamond cages.
- Cages
- Owned hexagonal and double-diamond membership.
- Chill
Options - Knobs for CHILL and CHILL+.
- Classification
- CHILL or CHILL+ labels and the nine population counts.
- Contacts
- Mutual nearest unlike contacts of a site table.
- Density
Options - Knobs for the axial number density.
- Density
Profile - Number density along one cell axis.
- Distribution
- Partial radial distribution.
- Distribution
Options - Knobs for a partial RDF, its running coordination, or the integral.
- Domain
Options - Knobs for a domain search.
- Domain
Report - Largest polar or apolar domain.
- Fingerprint
- Owned topological fingerprint.
- Fingerprint
Options - Knobs for a topological fingerprint.
- KnnOptions
- Knobs for a k-nearest neighbour list.
- Neighbour
Options - Knobs for a neighbour list.
- Neighbour
Pair - One directed neighbour pair. The self entry is omitted.
- Neighbour
Pairs - Iterator of directed neighbour pairs.
- Neighbours
- Owned neighbour list.
- Order
Options - Knobs for q_l on a named graph.
- Pockets
- Brine pockets trapped in the ice.
- Prism
Census - Perfect and imperfect prism counts by ring size.
- Prism
Options - Knobs for prism stacks.
- Q4Q6
- Local q4 and q6 on the cutoff shell.
- Q6Bar
- Lechner-Dellago q6-bar and the ice count above a cut.
- Q6Bar
Options - Knobs for the q6-bar ice summary.
- Rejection
- Molal rejection coefficient.
- Ring
Iter - Iterator of primitive rings. Each item is a
Resultof vertex indices. - Ring
Options - Knobs for primitive rings.
- Rings
- Owned primitive-ring set.
- Running
Coordination - Running coordination number along a partial RDF.
- Sheet
Options - Knobs for a monolayer ring histogram.
- Signature
Match - Closed cages whose ring census matches a signature.
- Signature
Options - Knobs for a signature cage census.
- Steinhardt
- Local Steinhardt parameter, and the average when it was requested.
- Steinhardt
Options - Knobs for a local Steinhardt parameter on the cutoff shell.
- System
- One frame: coordinates, a cell, and the analyses that read them.
Enums§
- Axis
- Cell axis.
- Cage
Label - Per-atom cage membership. The four codes are disjoint.
- Chill
Rule - CHILL+ threshold table.
- Domain
Subset - Domain subset. The values match the C API.
- Error
- A failed call. The message is
seams_handle_errorwhen the call had a handle. - Graph
- Neighbour graph.
- Label
- CHILL and CHILL+ atom label.
Classification::counts[label as usize]is the population. - Ring
Symmetry - Primitive-ring symmetry class.
- Site
Kind - Site-table kind.
- Status
- Status codes. The numeric values match
seams_status.
Functions§
- abi
- ABI number compiled into this library. The value is 1.
- diamond8
- Eight-atom cubic diamond used by the crate examples.
- label_
name - Short name of a CHILL+ label.
- nframes
- Count frames in a trajectory path.
- num_
threads - OpenMP width the next call will use.
- ring_
symmetry_ name - Short name of a ring-symmetry code.
- set_
num_ threads - Set the OpenMP width for the next call. Zero restores the library default.
- version
- Library version text, for example
2.14.0.