103#include "seams_version.h"
120#if defined(SEAMS_STATIC)
122#elif defined(_WIN32) || defined(__CYGWIN__)
123#if defined(SEAMS_BUILDING)
124#define SEAMS_API __declspec(dllexport)
126#define SEAMS_API __declspec(dllimport)
128#elif defined(__GNUC__) || defined(__clang__)
129#define SEAMS_API __attribute__((visibility("default")))
138#if defined(__GNUC__) || defined(__clang__)
139#define SEAMS_DEPRECATED(msg) __attribute__((deprecated(msg)))
140#elif defined(_MSC_VER)
141#define SEAMS_DEPRECATED(msg) __declspec(deprecated(msg))
143#define SEAMS_DEPRECATED(msg)
540 size_t n,
const double *box9,
541 size_t box_len,
const int *types,
568 int n,
const double *box9,
569 const int *types,
const int *ids);
597 int n,
double ox,
double oy,
double oz,
598 double lx,
double ly,
double lz,
599 const int *types,
const int *ids);
625 int frame,
int type_filter);
769SEAMS_DEPRECATED(
"use seams_neighbours_copy; these pointers are owned by the handle")
771 const
int **offsets,
int *n_offsets,
772 const
int **cols,
int *nnz);
803 int *offsets,
size_t offsets_cap,
804 size_t *n_offsets,
int *cols,
805 size_t cols_cap,
size_t *nnz);
849 int graph,
int rule,
int *labels,
850 size_t labels_len,
int counts9[9]);
880 int graph,
int rule,
int *labels,
919 int order_l,
int graph,
double *ql,
size_t ql_len,
920 double *qlbar,
size_t qlbar_len);
950 double *q4,
double *q6);
989 double ice_cut,
double *q6bar,
size_t q6bar_len,
990 double *mean,
double *median,
int *n_ice);
1135 int *atoms,
size_t cap,
size_t *n_out);
1172 size_t rings_len,
size_t *n_rings,
1173 int *per_atom,
size_t per_atom_len);
1236 int graph,
int k,
int complete,
1280 int *n_cubic,
int *n_water,
int *n_both);
1338 int type,
int graph, const
char *spec,
1339 size_t *n_cages,
size_t *n_atoms);
1369 int *labels,
size_t labels_len);
1415 size_t n_ice,
int water_type,
int ion_type,
1460 double *z_exit,
double *thickness,
int *found);
1490 double *c_liquid,
double *k,
int *defined);
1519 double *molality,
double *ice_fraction,
1520 size_t cap,
size_t *n_out);
1544 int *reservoir_waters);
1609 int graph, const
char *spec,
size_t *n_cages,
1645 int graph, const
char *spec, const
char *edge,
1646 size_t *n_cages,
size_t *n_atoms);
1677 int order_l,
double *ql,
size_t ql_len,
1678 double *qlbar,
size_t qlbar_len);
1745 int type_j,
double *r,
double *g,
int *count,
size_t cap,
1746 size_t *n_out,
double *volume);
1777 int type_j,
double *r,
double *cn,
size_t cap,
1806 int type_i,
int type_j,
double *cn);
1837 int hydrogen_type,
double dist_cutoff,
1838 double angle_cutoff,
int *n_bonds);
1871 double *z,
double *rho,
size_t cap,
size_t *n_out);
1902 int graph,
int hops,
int color_types,
1966 size_t cap,
size_t *n_out);
2020 size_t *n_pairs,
int *n_cation,
int *n_anion);
2052 int subset,
int *n_subset,
int *largest,
2053 double *percolation);
2085 int *imperfect,
size_t len);
2113 int max_depth,
double sheet_area,
int *counts,
2274 int graph,
int rule,
int *labels,
2275 size_t labels_len,
int counts9[9]);
2304 size_t q4_len,
double *q6,
size_t q6_len);
2332 size_t sizes_len,
int *symmetry,
2333 size_t symmetry_len);
2414 size_t n, const
double *box9,
SEAMS_API seams_status seams_brine_pockets(const seams_brine *front, int *n_pockets, int *reservoir_waters)
Brine pockets trapped in the ice, excluding the liquid reservoir.
SEAMS_API seams_status seams_brine_profile(const seams_brine *front, double *z_mid, double *molality, double *ice_fraction, size_t cap, size_t *n_out)
Concentration profile along the front axis.
SEAMS_API seams_status seams_brine_analyse(seams_system *sys, const int *ice, size_t n_ice, int water_type, int ion_type, int n_bins, int axis, seams_brine **out)
Planar ice/brine front from an ice assignment.
SEAMS_API seams_status seams_brine_fronts(const seams_brine *front, double *z_enter, double *z_exit, double *thickness, int *found)
The two planar crossings of the ice slab.
SEAMS_API void seams_brine_destroy(seams_brine *front)
Free a brine-front handle.
SEAMS_API seams_status seams_brine_rejection(const seams_brine *front, double *c_ice, double *c_liquid, double *k, int *defined)
Molal rejection coefficient k = c_ice / c_liquid.
SEAMS_API seams_status seams_cages_signature(seams_system *sys, double cutoff, int type, int graph, const char *spec, size_t *n_cages, size_t *n_atoms)
Count closed cages whose ring census matches a signature.
SEAMS_API seams_status seams_system_symmetry(seams_system *sys, double shell_rmsd, int *labels, size_t labels_len)
Per-atom ice shell label.
SEAMS_API void seams_cages_destroy(seams_cage_set *cages)
Free a cage-membership handle.
SEAMS_API seams_status seams_cages_labels(const seams_cage_set *cages, int *per_atom, size_t len)
Per-atom cage code.
SEAMS_API seams_status seams_cages_find(seams_system *sys, double cutoff, int type, int graph, int k, int complete, seams_cage_set **out)
Hexagonal and double-diamond cage membership.
SEAMS_API seams_status seams_cages_counts(const seams_cage_set *cages, int *n_hex, int *n_cubic, int *n_water, int *n_both)
Disjoint cage population counts.
SEAMS_API seams_status seams_system_ids(const seams_system *sys, int *ids, size_t len)
Copy the stored atom ids out.
SEAMS_API seams_status seams_system_types(const seams_system *sys, int *types, size_t len)
Copy the stored atom types out.
SEAMS_API seams_status seams_system_box(const seams_system *sys, double *box9, size_t box_len)
Copy the stored cell out as nine LAMMPS numbers.
SEAMS_API seams_status seams_system_set_positions(seams_system *sys, const double *xyz, size_t n, const double *box9, size_t box_len)
Overwrite the coordinates, and optionally the cell, of the stored frame.
SEAMS_API seams_status seams_system_positions(const seams_system *sys, double *xyz, size_t len)
Copy the stored coordinates out.
SEAMS_API seams_status seams_system_stage_positions(seams_system *sys, int enable)
Trade memory for a single pass in seams_system_set_positions().
SEAMS_API seams_status seams_system_set_ortho(seams_system *sys, const double *xyz, int n, double ox, double oy, double oz, double lx, double ly, double lz, const int *types, const int *ids)
Store points and an orthorhombic cell.
SEAMS_API seams_status seams_path_nframes(const char *path, size_t *nframes)
Number of frames in a trajectory path.
SEAMS_API seams_status seams_system_set_frame(seams_system *sys, const double *xyz, int n, const double *box9, const int *types, const int *ids)
Store points and a general LAMMPS cell, with an int count.
SEAMS_API seams_status seams_system_set_atoms(seams_system *sys, const double *xyz, size_t n, const double *box9, size_t box_len, const int *types, const int *ids)
Store points and a general cell.
SEAMS_API seams_status seams_system_read(seams_system *sys, const char *path, int frame, int type_filter)
Read one frame from a trajectory file.
SEAMS_API int seams_system_count(const seams_system *sys)
Number of points in the frame, as an int.
SEAMS_API seams_system * seams_system_create(void)
Allocate an empty frame.
SEAMS_API void seams_system_destroy(seams_system *sys)
Free a frame.
SEAMS_API seams_status seams_rdf(seams_system *sys, double rmax, int bins, int type_i, int type_j, double *r, double *g, int *count, size_t cap, size_t *n_out, double *volume)
Partial radial distribution.
SEAMS_API seams_status seams_cages(seams_system *sys, double cutoff, int type, int graph, int k, int complete, seams_cage_set **out)
Hexagonal and double-diamond cages.
SEAMS_API seams_status seams_hbonds(seams_system *sys, double cutoff, int oxygen_type, int hydrogen_type, double dist_cutoff, double angle_cutoff, int *n_bonds)
Hydrogen-bond count on one frame.
SEAMS_API seams_status seams_density_axis(seams_system *sys, int type, int bins, int axis, double *z, double *rho, size_t cap, size_t *n_out)
Number density along one cell axis.
SEAMS_API seams_status seams_fingerprint_key(const seams_topo *fp, char *buf, size_t cap, size_t *n_out)
Frame key text.
SEAMS_API seams_status seams_site_table(seams_system *sys, const char *spec, int *kinds, size_t len)
Per-atom site kind from a site-table spec.
SEAMS_API seams_status seams_fingerprint(seams_system *sys, double cutoff, int type, int k, int graph, int hops, int color_types, seams_topo **out)
Topological fingerprint of the bonded graph.
SEAMS_API seams_status seams_contact_pairs(seams_system *sys, const char *site_spec, size_t *n_pairs, int *n_cation, int *n_anion)
Mutual nearest unlike contacts of a site table.
SEAMS_API void seams_fingerprint_destroy(seams_topo *fp)
Free a fingerprint.
SEAMS_API seams_status seams_neighbours_knn(seams_system *sys, int k, double cutoff, int type, int mutual, seams_neighbours **out)
k-nearest neighbour list.
SEAMS_API seams_status seams_fingerprint_atom(const seams_topo *fp, int index, char *buf, size_t cap, size_t *n_out)
Local key of one atom.
SEAMS_API seams_status seams_running_cn(seams_system *sys, double rmax, int bins, int type_i, int type_j, double *r, double *cn, size_t cap, size_t *n_out)
Running coordination number along the partial RDF.
SEAMS_API seams_status seams_prisms(seams_system *sys, double cutoff, int type, int *perfect, int *imperfect, size_t len)
Perfect and imperfect prism counts by ring size.
SEAMS_API seams_status seams_domains(seams_system *sys, double cutoff, const char *site_spec, int subset, int *n_subset, int *largest, double *percolation)
Largest domain of a polar or apolar site subset.
SEAMS_API seams_status seams_monolayer(seams_system *sys, double cutoff, int type, int max_depth, double sheet_area, int *counts, size_t counts_len)
Primitive-ring histogram of a monolayer.
SEAMS_API seams_status seams_signature_cages_edge(seams_system *sys, double cutoff, int type, int graph, const char *spec, const char *edge, size_t *n_cages, size_t *n_atoms)
Closed cages of one ring census with an explicit face-edge window.
SEAMS_API seams_status seams_coordination(seams_system *sys, double rmax, int bins, int type_i, int type_j, double *cn)
Coordination number integrated to rmax.
SEAMS_API seams_status seams_signature_cages(seams_system *sys, double cutoff, int type, int graph, const char *spec, size_t *n_cages, size_t *n_atoms)
Closed cages of one ring census.
SEAMS_API seams_status seams_fingerprint_rings(const seams_topo *fp, int *counts, size_t counts_len)
Primitive-ring census stored on the fingerprint.
SEAMS_API seams_status seams_steinhardt(seams_system *sys, double cutoff, int type, int order_l, double *ql, size_t ql_len, double *qlbar, size_t qlbar_len)
Local Steinhardt q_l on the cutoff shell, and the average on request.
SEAMS_API int seams_neighbours_count(const seams_neighbours *nb)
Number of neighbour rows, as an int.
SEAMS_API seams_status seams_neighbours_csr(const seams_neighbours *nb, const int **offsets, int *n_offsets, const int **cols, int *nnz)
Borrow the neighbour list as CSR.
SEAMS_API void seams_neighbours_destroy(seams_neighbours *nb)
Free a neighbour list.
SEAMS_API seams_status seams_neighbours_copy(const seams_neighbours *nb, int *offsets, size_t offsets_cap, size_t *n_offsets, int *cols, size_t cols_cap, size_t *nnz)
Copy the neighbour CSR into caller buffers.
SEAMS_API seams_status seams_neighbours_build(seams_system *sys, double cutoff, int type, int graph, seams_neighbours **out)
Build a cutoff or mutual neighbour list.
SEAMS_API seams_status seams_chill(seams_system *sys, double cutoff, int type, int graph, int rule, int *labels, size_t labels_len, int counts9[9])
Original CHILL labels, published or OVITO edges.
SEAMS_API seams_status seams_chill_plus(seams_system *sys, double cutoff, int type, int graph, int rule, int *labels, int counts9[9])
CHILL+ labels, without a buffer length.
SEAMS_API seams_status seams_q6bar(seams_system *sys, double cutoff, int type, double ice_cut, double *q6bar, size_t q6bar_len, double *mean, double *median, int *n_ice)
Lechner-Dellago q6-bar and the ice count above a cut.
SEAMS_API seams_status seams_ql(seams_system *sys, double cutoff, int type, int order_l, int graph, double *ql, size_t ql_len, double *qlbar, size_t qlbar_len)
Local Steinhardt q_l, and the Lechner-Dellago average on request.
SEAMS_API seams_status seams_q4q6(seams_system *sys, double cutoff, int type, double *q4, double *q6)
Local q4 and q6 on the cutoff shell, without buffer lengths.
SEAMS_API seams_status seams_rings_chordless(const seams_neighbours *nb, int size, int *rings, size_t rings_len, size_t *n_rings, int *per_atom, size_t per_atom_len)
Chordless cycles of one size.
SEAMS_API void seams_rings_destroy(seams_rings *rings)
Free a ring set.
SEAMS_API int seams_rings_count(const seams_rings *rings)
Number of primitive rings, as an int.
SEAMS_API seams_status seams_rings_labels(const seams_rings *rings, int *sizes, int *symmetry)
Size and symmetry of each ring, without buffer lengths.
SEAMS_API seams_status seams_rings_find(seams_system *sys, double cutoff, int type, int graph, int max_depth, seams_rings **out)
Primitive rings (Franzblau) up to a maximum size.
SEAMS_API seams_status seams_rings_histogram(const seams_rings *rings, int *counts, int counts_len)
Count primitive rings by size, with an int length.
SEAMS_API seams_status seams_rings_vertices(const seams_rings *rings, int index, int *atoms, size_t cap, size_t *n_out)
Atom indices of one ring.
SEAMS_API seams_status seams_rings_fraction(const seams_rings *rings, int size, double *fraction)
Fraction of atoms that sit on a ring.
SEAMS_API seams_status seams_chill_plus_n(seams_system *sys, double cutoff, int type, int graph, int rule, int *labels, size_t labels_len, int counts9[9])
CHILL+ labels into a buffer of known length.
SEAMS_API seams_status seams_q4q6_n(seams_system *sys, double cutoff, int type, double *q4, size_t q4_len, double *q6, size_t q6_len)
Local q4 and q6 on the cutoff shell into buffers of known length.
SEAMS_API seams_status seams_neighbours_nrows(const seams_neighbours *nb, size_t *n)
Number of neighbour rows.
SEAMS_API seams_status seams_rings_labels_n(const seams_rings *rings, int *sizes, size_t sizes_len, int *symmetry, size_t symmetry_len)
Size and symmetry of each ring into buffers of known length.
SEAMS_API seams_status seams_rings_histogram_n(const seams_rings *rings, int *counts, size_t counts_len)
Count primitive rings by size into a buffer of known length.
SEAMS_API const char * seams_last_error_message(void)
Thread-local detail of the last failing call on this thread.
SEAMS_API seams_status seams_system_natoms(const seams_system *sys, size_t *n)
Number of points in the frame.
SEAMS_API seams_status seams_rings_nrings(const seams_rings *rings, size_t *n)
Number of primitive rings.
seams_site_kind
Site kind.
struct seams_brine seams_brine
One planar ice/brine front measurement.
seams_cage_label
Per-atom cage membership from the hexagonal and double-diamond search.
struct seams_cage_set seams_cage_set
Hexagonal and double-diamond membership.
struct seams_topo seams_topo
Topological fingerprint of one bonded frame.
struct seams_rings seams_rings
One primitive-ring set.
struct seams_neighbours seams_neighbours
One neighbour list.
seams_ring_symmetry
Ring topology.
seams_chill_rule
CHILL+ definition.
seams_status
Status codes.
seams_label
CHILL and CHILL+ atom labels.
seams_graph
Neighbour graph.
struct seams_system seams_system
One frame.
@ SEAMS_SITE_WATER_H
Water hydrogen.
@ SEAMS_SITE_WATER_O
Water oxygen.
@ SEAMS_SITE_CATION
Cation head.
@ SEAMS_SITE_DONOR_H
Hydrogen-bond donor hydrogen.
@ SEAMS_SITE_ACCEPTOR
Hydrogen-bond acceptor.
@ SEAMS_SITE_TAIL
Alkyl tail.
@ SEAMS_SITE_APOLAR
Other apolar site.
@ SEAMS_SITE_SOLVENT
Other solvent.
@ SEAMS_SITE_UNSPECIFIED
Not named in the site table.
@ SEAMS_SITE_POLAR
Other polar site.
@ SEAMS_CAGE_CUBIC
Double-diamond cage only.
@ SEAMS_CAGE_HEX
Hexagonal cage only.
@ SEAMS_CAGE_WATER
In neither cage.
@ SEAMS_CAGE_BOTH
Both cages.
@ SEAMS_RING_HEXAGON
Six-ring outside any cage.
@ SEAMS_RING_UNCLASSIFIED
No topology assigned.
@ SEAMS_RING_HC_PRISMATIC
Prismatic face of a hexagonal cage.
@ SEAMS_RING_MIXED_PRISM
Face of a mixed prism.
@ SEAMS_RING_DEFORMED_PRISM
Face of a deformed prism.
@ SEAMS_RING_BOTH_PRISMATIC
Shared by both cage kinds, prismatic.
@ SEAMS_RING_PENTAGON
Five-ring outside any cage.
@ SEAMS_RING_BOTH_BASAL
Shared by both cage kinds, basal.
@ SEAMS_RING_PRISM
Face of a perfect prism.
@ SEAMS_RING_HC_BASAL
Basal face of a hexagonal cage.
@ SEAMS_RING_OTHER
Any other size outside any cage.
@ SEAMS_RING_DDC
Face of a double-diamond cage.
@ SEAMS_CHILL_OVITO
OVITO Chill+ modifier, every neighbour in the cutoff.
@ SEAMS_CHILL_PUBLISHED
Nguyen and Molinero, four closest neighbours.
@ SEAMS_ERR_RANGE
A number or a buffer length is outside the accepted range.
@ SEAMS_ERR_NOMEM
An allocation failed.
@ SEAMS_ERR_NULL
A required pointer is null.
@ SEAMS_ERR_STATE
The handle has no frame yet.
@ SEAMS_ERR_BOX
The cell is missing, non-finite, or has no volume.
@ SEAMS_ERR_INTERNAL
The library hit an internal failure.
@ SEAMS_ERR_ARG
A caller argument is the wrong shape, or a coordinate is not finite.
@ SEAMS_OK
The call succeeded.
@ SEAMS_LABEL_INTERCLATHRATE
Interfacial clathrate.
@ SEAMS_LABEL_UNCLASSIFIED
Not classified, or dropped by the species filter.
@ SEAMS_LABEL_INTERFACIAL
Interfacial ice.
@ SEAMS_LABEL_WATER
Liquid water.
@ SEAMS_LABEL_RECUBIC
Cubic after reclassification.
@ SEAMS_LABEL_CUBIC
Cubic ice (Ic).
@ SEAMS_LABEL_HEXAGONAL
Hexagonal ice (Ih).
@ SEAMS_LABEL_REHEX
Hexagonal after reclassification.
@ SEAMS_LABEL_CLATHRATE
Clathrate.
@ SEAMS_GRAPH_CUTOFF
Every neighbour inside the cutoff.
@ SEAMS_GRAPH_SEEDED
Mutual seeds with union completions, for cages only.
@ SEAMS_GRAPH_MUTUAL
Mutual four nearest inside cutoff + 1.5.
#define SEAMS_API
Marks a symbol exported by libseams.
#define SEAMS_DEPRECATED(msg)
Marks an entry point kept for ABI 1 callers.