seams-core v2.14.0
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
seams::System Class Reference

One frame: coordinates, a cell, and the analyses that read them. More...

#include <include/seams.hpp>

Inheritance diagram for seams::System:

Public Member Functions

 System ()
 Allocate an empty frame.
void set_ortho (std::span< const double > xyz, double lx, double ly, double lz)
 Store points in an orthorhombic cell whose origin is zero.
void set_ortho (std::span< const double > xyz, std::span< const double, 3 > origin, std::span< const double, 3 > lengths, std::span< const int > types={}, std::span< const int > ids={})
 Store points in an orthorhombic cell.
void set_frame (std::span< const double > xyz, std::span< const double, 9 > box9, std::span< const int > types={}, std::span< const int > ids={})
 Store points and a general nine-number cell.
std::pair< std::vector< int >, std::vector< int > > chill (double cutoff, int type, int graph, int rule)
std::pair< std::vector< double >, std::vector< double > > steinhardt (double cutoff, int order, bool average)
void read (std::string_view path, int frame, int type_filter)
 Read one frame from a trajectory path.
int count () const
 Number of points in the frame.
Classification chill (const ChillOptions &options)
 Original CHILL labels and nine population counts.
Classification chill_plus (const ChillOptions &options)
 CHILL+ labels and nine population counts.
Steinhardt steinhardt (const SteinhardtOptions &options)
 Local q_l on the cutoff shell.
Steinhardt ql (const OrderOptions &options)
 Local q_l on a named graph.
Q4Q6 q4q6 (double cutoff, int species=0)
 Local q4 and q6 on the cutoff shell.
Q6Bar q6bar (const Q6BarOptions &options)
 q6-bar, its mean and median, and the ice count above the cut.
Neighbours neighbours (const NeighbourOptions &options)
 Cutoff or mutual neighbour list.
ChordlessCycles rings_chordless (const NeighbourOptions &options, int size)
 Chordless cycles of one length on a neighbour graph.
Neighbours knn (const KnnOptions &options)
 k-nearest neighbour list.
std::vector< int > neighbour_degree (double cutoff, int species=0)
 Degree of each atom on the cutoff graph.
Rings rings (const RingOptions &options)
 Primitive rings up to a maximum size.
Cages cages (const CageOptions &options)
 Hexagonal and double-diamond cage membership.
SignatureMatch signature_cages (const SignatureOptions &options)
 Closed cages of one ring census.
Distribution rdf (const DistributionOptions &options)
 Partial radial distribution and the cell volume.
RunningCoordination running_cn (const DistributionOptions &options)
 Running coordination number along the partial RDF.
double coordination (const DistributionOptions &options)
 Coordination number integrated to rmax.
int hbonds (const BondOptions &options)
 Hydrogen-bond count.
DensityProfile density (const DensityOptions &options)
 Number density along one cell axis.
Fingerprint fingerprint (const FingerprintOptions &options)
 Topological fingerprint of the bonded graph.
Contacts contact_pairs (std::string_view spec)
 Mutual nearest unlike contacts.
DomainReport domains (const DomainOptions &options)
 Largest polar or apolar domain.
PrismCensus prisms (const PrismOptions &options)
 Perfect and imperfect prism counts by ring size.
std::vector< int > monolayer (const SheetOptions &options)
 Primitive-ring histogram of a monolayer.
std::vector< int > site_table (std::string_view spec)
 Per-atom site kind.
std::vector< int > symmetry (double shell_rmsd)
 Per-atom ice-shell label.
Brine brine (std::span< const int > ice, const BrineOptions &options)
 Planar ice front from an ice assignment.
Public Member Functions inherited from seams::detail::Handle< seams_system, seams_system_destroy >
 Handle ()=default
Handle & operator= (const Handle &)=delete
 ~Handle ()
 operator bool () const noexcept

Additional Inherited Members

Protected Member Functions inherited from seams::detail::Handle< seams_system, seams_system_destroy >
seams_system * get () const noexcept
void reset () noexcept
Protected Attributes inherited from seams::detail::Handle< seams_system, seams_system_destroy >
seams_system * ptr_

Detailed Description

One frame: coordinates, a cell, and the analyses that read them.

Move-only. The destructor frees the C handle. Methods that read the frame require exclusive use of this object. The Steinhardt scratch inside the library is process-global, so two frames must not run steinhardt, ql, q4q6, or q6bar at the same time. set_num_threads is also process-global.

Definition at line 939 of file seams.hpp.

Constructor & Destructor Documentation

◆ System()

seams::System::System ( )
inline

Allocate an empty frame.

Exceptions
Errorwith status Memory when the allocation fails.

Definition at line 945 of file seams.hpp.

945 : detail::Handle<seams_system, seams_system_destroy>(seams_system_create()) {
946 if (get() == nullptr) {
948 }
949 }
SEAMS_API seams_system * seams_system_create(void)
Allocate an empty frame.
@ SEAMS_ERR_NOMEM
An allocation failed.
Definition seams.h:160
void check(int status, const void *handle)
Definition seams.hpp:557

Member Function Documentation

◆ brine()

Brine seams::System::brine ( std::span< const int > ice,
const BrineOptions & options )
inlinenodiscard

Planar ice front from an ice assignment.

Parameters
iceNon-zero when the atom is ice. Length must equal count().
optionsWater species, ion species, bins, and axis.

Definition at line 1332 of file seams.hpp.

1332 {
1333 seams_brine *out = nullptr;
1334 detail::check(seams_brine_analyse(get(), ice.data(), ice.size(), options.water_type,
1335 options.ion_type, options.bins,
1336 static_cast<int>(options.axis), &out),
1337 get());
1338 return Brine(out);
1339 }
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.
struct seams_brine seams_brine
One planar ice/brine front measurement.
Definition seams.h:249

◆ cages()

Cages seams::System::cages ( const CageOptions & options)
inlinenodiscard

Hexagonal and double-diamond cage membership.

Definition at line 1161 of file seams.hpp.

1161 {
1162 seams_cage_set *out = nullptr;
1163 detail::check(seams_cages(get(), options.cutoff, options.species,
1164 static_cast<int>(options.graph), options.k, options.complete ? 1 : 0,
1165 &out),
1166 get());
1167 return Cages(out);
1168 }
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.
struct seams_cage_set seams_cage_set
Hexagonal and double-diamond membership.
Definition seams.h:247

◆ chill() [1/2]

Classification seams::System::chill ( const ChillOptions & options)
inlinenodiscard

Original CHILL labels and nine population counts.

Definition at line 1051 of file seams.hpp.

1051 {
1052 return classify(false, options);
1053 }

◆ chill() [2/2]

std::pair< std::vector< int >, std::vector< int > > seams::System::chill ( double cutoff,
int type,
int graph,
int rule )
inline

Definition at line 1005 of file seams.hpp.

1006 {
1007 const int n = count();
1008 std::vector<int> labels(static_cast<std::size_t>(std::max(n, 0)));
1009 int counts[9] = {};
1010 detail::check(seams_chill(get(), cutoff, type, graph, rule, labels.data(),
1011 static_cast<std::size_t>(std::max(n, 0)), counts),
1012 get());
1013 return {labels, std::vector<int>(counts, counts + 9)};
1014 }
int count() const
Number of points in the frame.
Definition seams.hpp:1048
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.

◆ chill_plus()

Classification seams::System::chill_plus ( const ChillOptions & options)
inlinenodiscard

CHILL+ labels and nine population counts.

Definition at line 1056 of file seams.hpp.

1056 {
1057 return classify(true, options);
1058 }

◆ contact_pairs()

Contacts seams::System::contact_pairs ( std::string_view spec)
inlinenodiscard

Mutual nearest unlike contacts.

spec is site-table text.

Definition at line 1265 of file seams.hpp.

1265 {
1266 const std::string text(spec);
1267 Contacts out;
1268 detail::check(seams_contact_pairs(get(), text.c_str(), &out.pairs, &out.cations, &out.anions),
1269 get());
1270 return out;
1271 }
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.

◆ coordination()

double seams::System::coordination ( const DistributionOptions & options)
inlinenodiscard

Coordination number integrated to rmax.

Definition at line 1219 of file seams.hpp.

1219 {
1220 double cn = 0;
1221 detail::check(seams_coordination(get(), options.rmax, options.bins, options.type_i,
1222 options.type_j, &cn),
1223 get());
1224 return cn;
1225 }
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.

◆ count()

int seams::System::count ( ) const
inlinenodiscard

Number of points in the frame.

Returns
The atom count. An empty frame returns 0.

Definition at line 1048 of file seams.hpp.

1048{ return seams_system_count(get()); }
SEAMS_API int seams_system_count(const seams_system *sys)
Number of points in the frame, as an int.

◆ density()

DensityProfile seams::System::density ( const DensityOptions & options)
inlinenodiscard

Number density along one cell axis.

Definition at line 1237 of file seams.hpp.

1237 {
1238 std::size_t n_out = 0;
1239 detail::check(seams_density_axis(get(), options.species, options.bins,
1240 static_cast<int>(options.axis), nullptr, nullptr, 0, &n_out),
1241 get());
1242 DensityProfile out;
1243 out.coordinate.resize(n_out);
1244 out.density.resize(n_out);
1245 detail::check(seams_density_axis(get(), options.species, options.bins,
1246 static_cast<int>(options.axis), out.coordinate.data(),
1247 out.density.data(), n_out, &n_out),
1248 get());
1249 out.coordinate.resize(n_out);
1250 out.density.resize(n_out);
1251 return out;
1252 }
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.

◆ domains()

DomainReport seams::System::domains ( const DomainOptions & options)
inlinenodiscard

Largest polar or apolar domain.

Definition at line 1274 of file seams.hpp.

1274 {
1275 DomainReport out;
1276 detail::check(seams_domains(get(), options.cutoff, options.spec.c_str(),
1277 static_cast<int>(options.subset), &out.subset, &out.largest,
1278 &out.percolation),
1279 get());
1280 return out;
1281 }
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.

◆ fingerprint()

Fingerprint seams::System::fingerprint ( const FingerprintOptions & options)
inlinenodiscard

Topological fingerprint of the bonded graph.

Definition at line 1255 of file seams.hpp.

1255 {
1256 seams_topo *out = nullptr;
1257 detail::check(seams_fingerprint(get(), options.cutoff, options.species, options.k,
1258 static_cast<int>(options.graph), options.hops,
1259 options.color_types ? 1 : 0, &out),
1260 get());
1261 return Fingerprint(out);
1262 }
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.
struct seams_topo seams_topo
Topological fingerprint of one bonded frame.
Definition seams.h:251

◆ hbonds()

int seams::System::hbonds ( const BondOptions & options)
inlinenodiscard

Hydrogen-bond count.

Definition at line 1228 of file seams.hpp.

1228 {
1229 int n_bonds = 0;
1230 detail::check(seams_hbonds(get(), options.cutoff, options.oxygen, options.hydrogen,
1231 options.distance, options.angle, &n_bonds),
1232 get());
1233 return n_bonds;
1234 }
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.

◆ knn()

Neighbours seams::System::knn ( const KnnOptions & options)
inlinenodiscard

k-nearest neighbour list.

Definition at line 1134 of file seams.hpp.

1134 {
1135 seams_neighbours *out = nullptr;
1136 detail::check(seams_neighbours_knn(get(), options.k, options.cutoff, options.species,
1137 options.mutual ? 1 : 0, &out),
1138 get());
1139 return Neighbours(out);
1140 }
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.
struct seams_neighbours seams_neighbours
One neighbour list.
Definition seams.h:243

◆ monolayer()

std::vector< int > seams::System::monolayer ( const SheetOptions & options)
inlinenodiscard

Primitive-ring histogram of a monolayer.

Returns
counts[k] is the number of rings of size k.

Definition at line 1296 of file seams.hpp.

1296 {
1297 std::vector<int> counts(static_cast<std::size_t>(options.max_size + 1));
1298 detail::check(seams_monolayer(get(), options.cutoff, options.species, options.max_size,
1299 options.sheet_area, counts.data(), counts.size()),
1300 get());
1301 return counts;
1302 }
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.

◆ neighbour_degree()

std::vector< int > seams::System::neighbour_degree ( double cutoff,
int species = 0 )
inlinenodiscard

Degree of each atom on the cutoff graph.

Parameters
cutoffPositive cutoff, Angstrom.
speciesSpecies filter. Zero keeps every atom.

Definition at line 1147 of file seams.hpp.

1147 {
1148 return neighbours(NeighbourOptions{cutoff, species, Graph::Cutoff}).degrees();
1149 }
Neighbours neighbours(const NeighbourOptions &options)
Cutoff or mutual neighbour list.
Definition seams.hpp:1115
@ Cutoff
Every pair inside the cutoff.
Definition seams.hpp:69

◆ neighbours()

Neighbours seams::System::neighbours ( const NeighbourOptions & options)
inlinenodiscard

Cutoff or mutual neighbour list.

Definition at line 1115 of file seams.hpp.

1115 {
1116 seams_neighbours *out = nullptr;
1117 detail::check(seams_neighbours_build(get(), options.cutoff, options.species,
1118 static_cast<int>(options.graph), &out),
1119 get());
1120 return Neighbours(out);
1121 }
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.

◆ prisms()

PrismCensus seams::System::prisms ( const PrismOptions & options)
inlinenodiscard

Perfect and imperfect prism counts by ring size.

Definition at line 1284 of file seams.hpp.

1284 {
1285 PrismCensus out;
1286 detail::check(seams_prisms(get(), options.cutoff, options.species, out.perfect.data(),
1287 out.imperfect.data(), out.perfect.size()),
1288 get());
1289 return out;
1290 }
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.

◆ q4q6()

Q4Q6 seams::System::q4q6 ( double cutoff,
int species = 0 )
inlinenodiscard

Local q4 and q6 on the cutoff shell.

Definition at line 1094 of file seams.hpp.

1094 {
1095 const auto n = static_cast<std::size_t>(count());
1096 Q4Q6 out;
1097 out.q4.resize(n);
1098 out.q6.resize(n);
1099 detail::check(seams_q4q6(get(), cutoff, species, out.q4.data(), out.q6.data()), get());
1100 return out;
1101 }
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.

◆ q6bar()

Q6Bar seams::System::q6bar ( const Q6BarOptions & options)
inlinenodiscard

q6-bar, its mean and median, and the ice count above the cut.

Definition at line 1104 of file seams.hpp.

1104 {
1105 const auto n = static_cast<std::size_t>(count());
1106 Q6Bar out;
1107 out.values.resize(n);
1108 detail::check(seams_q6bar(get(), options.cutoff, options.species, options.ice_cut,
1109 out.values.data(), n, &out.mean, &out.median, &out.n_ice),
1110 get());
1111 return out;
1112 }
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.

◆ ql()

Steinhardt seams::System::ql ( const OrderOptions & options)
inlinenodiscard

Local q_l on a named graph.

Definition at line 1079 of file seams.hpp.

1079 {
1080 const auto n = static_cast<std::size_t>(count());
1081 Steinhardt out;
1082 out.local.resize(n);
1083 if (options.average) {
1084 out.average.resize(n);
1085 }
1086 detail::check(seams_ql(get(), options.cutoff, options.species, options.order,
1087 static_cast<int>(options.graph), out.local.data(), n,
1088 options.average ? out.average.data() : nullptr, n),
1089 get());
1090 return out;
1091 }
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.

◆ rdf()

Distribution seams::System::rdf ( const DistributionOptions & options)
inlinenodiscard

Partial radial distribution and the cell volume.

Definition at line 1181 of file seams.hpp.

1181 {
1182 std::size_t n_out = 0;
1183 Distribution out;
1184 detail::check(seams_rdf(get(), options.rmax, options.bins, options.type_i, options.type_j,
1185 nullptr, nullptr, nullptr, 0, &n_out, &out.volume),
1186 get());
1187 out.radius.resize(n_out);
1188 out.g.resize(n_out);
1189 out.count.resize(n_out);
1190 detail::check(seams_rdf(get(), options.rmax, options.bins, options.type_i, options.type_j,
1191 out.radius.data(), out.g.data(), out.count.data(), n_out, &n_out,
1192 nullptr),
1193 get());
1194 out.radius.resize(n_out);
1195 out.g.resize(n_out);
1196 out.count.resize(n_out);
1197 return out;
1198 }
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.

◆ read()

void seams::System::read ( std::string_view path,
int frame,
int type_filter )
inline

Read one frame from a trajectory path.

Parameters
pathXYZ, CON, chemfiles, or a LAMMPS dump.
frame1-based frame index.
type_filterSpecies to keep. Negative keeps every atom.

Definition at line 1039 of file seams.hpp.

1039 {
1040 const std::string text(path);
1041 detail::check(seams_system_read(get(), text.c_str(), frame, type_filter), get());
1042 }
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.

◆ rings()

Rings seams::System::rings ( const RingOptions & options)
inlinenodiscard

Primitive rings up to a maximum size.

Definition at line 1152 of file seams.hpp.

1152 {
1153 seams_rings *out = nullptr;
1154 detail::check(seams_rings_find(get(), options.cutoff, options.species,
1155 static_cast<int>(options.graph), options.max_size, &out),
1156 get());
1157 return Rings(out);
1158 }
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.
struct seams_rings seams_rings
One primitive-ring set.
Definition seams.h:245

◆ rings_chordless()

ChordlessCycles seams::System::rings_chordless ( const NeighbourOptions & options,
int size )
inlinenodiscard

Chordless cycles of one length on a neighbour graph.

Parameters
optionsGraph of the cycles.
sizeCycle length, from 3 through 12.
Returns
Neighbours::chordless on that graph.

Definition at line 1129 of file seams.hpp.

1129 {
1130 return neighbours(options).chordless(size);
1131 }
ChordlessCycles chordless(int size) const
Chordless cycles of one length on this graph.
Definition seams.hpp:709

◆ running_cn()

RunningCoordination seams::System::running_cn ( const DistributionOptions & options)
inlinenodiscard

Running coordination number along the partial RDF.

Definition at line 1201 of file seams.hpp.

1201 {
1202 std::size_t n_out = 0;
1203 detail::check(seams_running_cn(get(), options.rmax, options.bins, options.type_i,
1204 options.type_j, nullptr, nullptr, 0, &n_out),
1205 get());
1206 RunningCoordination out;
1207 out.radius.resize(n_out);
1208 out.coordination.resize(n_out);
1209 detail::check(seams_running_cn(get(), options.rmax, options.bins, options.type_i,
1210 options.type_j, out.radius.data(), out.coordination.data(),
1211 n_out, &n_out),
1212 get());
1213 out.radius.resize(n_out);
1214 out.coordination.resize(n_out);
1215 return out;
1216 }
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.

◆ set_frame()

void seams::System::set_frame ( std::span< const double > xyz,
std::span< const double, 9 > box9,
std::span< const int > types = {},
std::span< const int > ids = {} )
inline

Store points and a general nine-number cell.

Parameters
xyzInterleaved coordinates, Angstrom.
box9ox, oy, oz, lx, ly, lz, xy, xz, yz.
typesOne species per atom, or empty.
idsOne id per atom, or empty.

Definition at line 993 of file seams.hpp.

994 {}, std::span<const int> ids = {}) {
995 if (xyz.size() % 3 != 0) {
996 throw Error(SEAMS_ERR_ARG, "coordinates are not a multiple of 3");
997 }
998 const auto n = static_cast<int>(xyz.size() / 3);
999 detail::check(seams_system_set_frame(get(), xyz.data(), n, box9.data(),
1000 types.empty() ? nullptr : types.data(),
1001 ids.empty() ? nullptr : ids.data()),
1002 get());
1003 }
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_ERR_ARG
A caller argument is the wrong shape, or a coordinate is not finite.
Definition seams.h:158

◆ set_ortho() [1/2]

void seams::System::set_ortho ( std::span< const double > xyz,
double lx,
double ly,
double lz )
inline

Store points in an orthorhombic cell whose origin is zero.

Parameters
xyzInterleaved x, y, z. Length is a multiple of 3. Angstrom.
lxEdge length along x, Angstrom.
lyEdge length along y, Angstrom.
lzEdge length along z, Angstrom.

Definition at line 958 of file seams.hpp.

958 {
959 const double origin[3] = {0, 0, 0};
960 const double lengths[3] = {lx, ly, lz};
961 set_ortho(xyz, origin, lengths);
962 }
void set_ortho(std::span< const double > xyz, double lx, double ly, double lz)
Store points in an orthorhombic cell whose origin is zero.
Definition seams.hpp:958

◆ set_ortho() [2/2]

void seams::System::set_ortho ( std::span< const double > xyz,
std::span< const double, 3 > origin,
std::span< const double, 3 > lengths,
std::span< const int > types = {},
std::span< const int > ids = {} )
inline

Store points in an orthorhombic cell.

Parameters
xyzInterleaved x, y, z. Length is a multiple of 3. Angstrom.
originCell origin, Angstrom.
lengthsEdge lengths, Angstrom. Each must be positive.
typesOne species per atom, or an empty span.
idsOne id per atom, or an empty span.

Definition at line 972 of file seams.hpp.

973 {},
974 std::span<const int> ids = {}) {
975 if (xyz.size() % 3 != 0) {
976 throw Error(SEAMS_ERR_ARG, "coordinates are not a multiple of 3");
977 }
978 const auto n = static_cast<int>(xyz.size() / 3);
979 detail::check(seams_system_set_ortho(get(), xyz.data(), n, origin[0], origin[1], origin[2],
980 lengths[0], lengths[1], lengths[2],
981 types.empty() ? nullptr : types.data(),
982 ids.empty() ? nullptr : ids.data()),
983 get());
984 }
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.

◆ signature_cages()

SignatureMatch seams::System::signature_cages ( const SignatureOptions & options)
inlinenodiscard

Closed cages of one ring census.

Definition at line 1171 of file seams.hpp.

1171 {
1172 SignatureMatch out;
1173 detail::check(seams_signature_cages(get(), options.cutoff, options.species,
1174 static_cast<int>(options.graph), options.spec.c_str(),
1175 &out.cages, &out.atoms),
1176 get());
1177 return out;
1178 }
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.

◆ site_table()

std::vector< int > seams::System::site_table ( std::string_view spec)
inlinenodiscard

Per-atom site kind.

Parameters
specSite-table text, for example 1=waterO.
Returns
One kind code per atom.

Definition at line 1309 of file seams.hpp.

1309 {
1310 const std::string text(spec);
1311 std::vector<int> kinds(static_cast<std::size_t>(count()));
1312 detail::check(seams_site_table(get(), text.c_str(), kinds.data(), kinds.size()), get());
1313 return kinds;
1314 }
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.

◆ steinhardt() [1/2]

Steinhardt seams::System::steinhardt ( const SteinhardtOptions & options)
inlinenodiscard

Local q_l on the cutoff shell.

Parameters
optionsCutoff, species, degree, and whether to average.

Definition at line 1064 of file seams.hpp.

1064 {
1065 const auto n = static_cast<std::size_t>(count());
1066 Steinhardt out;
1067 out.local.resize(n);
1068 if (options.average) {
1069 out.average.resize(n);
1070 }
1071 detail::check(seams_steinhardt(get(), options.cutoff, options.species, options.order,
1072 out.local.data(), n,
1073 options.average ? out.average.data() : nullptr, n),
1074 get());
1075 return out;
1076 }
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.

◆ steinhardt() [2/2]

std::pair< std::vector< double >, std::vector< double > > seams::System::steinhardt ( double cutoff,
int order,
bool average )
inline

Definition at line 1016 of file seams.hpp.

1017 {
1018 const int n = count();
1019 std::vector<double> ql(static_cast<std::size_t>(std::max(n, 0)));
1020 std::vector<double> bar;
1021 double *bar_ptr = nullptr;
1022 if (average) {
1023 bar.resize(static_cast<std::size_t>(std::max(n, 0)));
1024 bar_ptr = bar.data();
1025 }
1026 detail::check(seams_steinhardt(get(), cutoff, 0, order, ql.data(),
1027 static_cast<std::size_t>(std::max(n, 0)), bar_ptr,
1028 average ? static_cast<std::size_t>(std::max(n, 0)) : 0),
1029 get());
1030 return {ql, bar};
1031 }
Steinhardt ql(const OrderOptions &options)
Local q_l on a named graph.
Definition seams.hpp:1079

◆ symmetry()

std::vector< int > seams::System::symmetry ( double shell_rmsd)
inlinenodiscard

Per-atom ice-shell label.

Parameters
shell_rmsdPositive residual ceiling, or a non-positive value for the library ceiling.
Returns
0 ice Ih, 1 ice Ic, 2 stacking disorder, or -1 when the shell does not match.

Definition at line 1321 of file seams.hpp.

1321 {
1322 std::vector<int> labels(static_cast<std::size_t>(count()));
1323 detail::check(seams_system_symmetry(get(), shell_rmsd, labels.data(), labels.size()), get());
1324 return labels;
1325 }
SEAMS_API seams_status seams_system_symmetry(seams_system *sys, double shell_rmsd, int *labels, size_t labels_len)
Per-atom ice shell label.

The documentation for this class was generated from the following file: