Skip to main content

Crate seams

Crate seams 

Source
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§

BondOptions
Knobs for a hydrogen-bond count.
Brine
Owned planar ice-front measurement.
BrineFronts
The two planar crossings of an ice slab.
BrineOptions
Knobs for a planar ice front.
BrineProfile
Concentration profile along the brine axis.
CageCounts
Disjoint cage populations.
CageOptions
Knobs for hexagonal and double-diamond cages.
Cages
Owned hexagonal and double-diamond membership.
ChillOptions
Knobs for CHILL and CHILL+.
Classification
CHILL or CHILL+ labels and the nine population counts.
Contacts
Mutual nearest unlike contacts of a site table.
DensityOptions
Knobs for the axial number density.
DensityProfile
Number density along one cell axis.
Distribution
Partial radial distribution.
DistributionOptions
Knobs for a partial RDF, its running coordination, or the integral.
DomainOptions
Knobs for a domain search.
DomainReport
Largest polar or apolar domain.
Fingerprint
Owned topological fingerprint.
FingerprintOptions
Knobs for a topological fingerprint.
KnnOptions
Knobs for a k-nearest neighbour list.
NeighbourOptions
Knobs for a neighbour list.
NeighbourPair
One directed neighbour pair. The self entry is omitted.
NeighbourPairs
Iterator of directed neighbour pairs.
Neighbours
Owned neighbour list.
OrderOptions
Knobs for q_l on a named graph.
Pockets
Brine pockets trapped in the ice.
PrismCensus
Perfect and imperfect prism counts by ring size.
PrismOptions
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.
Q6BarOptions
Knobs for the q6-bar ice summary.
Rejection
Molal rejection coefficient.
RingIter
Iterator of primitive rings. Each item is a Result of vertex indices.
RingOptions
Knobs for primitive rings.
Rings
Owned primitive-ring set.
RunningCoordination
Running coordination number along a partial RDF.
SheetOptions
Knobs for a monolayer ring histogram.
SignatureMatch
Closed cages whose ring census matches a signature.
SignatureOptions
Knobs for a signature cage census.
Steinhardt
Local Steinhardt parameter, and the average when it was requested.
SteinhardtOptions
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.
CageLabel
Per-atom cage membership. The four codes are disjoint.
ChillRule
CHILL+ threshold table.
DomainSubset
Domain subset. The values match the C API.
Error
A failed call. The message is seams_handle_error when the call had a handle.
Graph
Neighbour graph.
Label
CHILL and CHILL+ atom label. Classification::counts[label as usize] is the population.
RingSymmetry
Primitive-ring symmetry class.
SiteKind
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.