|
seams-core v2.14.0
libyodaLib, the C++ engine of d-SEAMS
|
Overwrite coordinates in place and copy the stored frame out. More...
Functions | |
| 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_stage_positions (seams_system *sys, int enable) |
| Trade memory for a single pass in seams_system_set_positions(). | |
| 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_positions (const seams_system *sys, double *xyz, size_t len) |
| Copy the stored coordinates 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_ids (const seams_system *sys, int *ids, size_t len) |
| Copy the stored atom ids out. | |
Overwrite coordinates in place and copy the stored frame out.
There is no borrowed-pointer load. Every analysis reads the library's per-atom records, so a view onto caller memory would be copied on each analysis call instead of once per frame. A trajectory loop calls seams_system_set_atoms() once and seams_system_set_positions() for each later frame, which writes only the coordinates.
| 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.
| sys | Frame handle. |
| box9 | Caller buffer: ox, oy, oz, lx, ly, lz, xy, xz, yz. The values match the cell that was stored, to rounding. |
| box_len | Must be 9. |
| SEAMS_API seams_status seams_system_ids | ( | const seams_system * | sys, |
| int * | ids, | ||
| size_t | len ) |
Copy the stored atom ids out.
| sys | Frame handle. |
| ids | Caller buffer for n ints, in stored order. |
| len | Length of ids. Must be at least n. |
| SEAMS_API seams_status seams_system_positions | ( | const seams_system * | sys, |
| double * | xyz, | ||
| size_t | len ) |
Copy the stored coordinates out.
| sys | Frame handle. |
| xyz | Caller buffer for 3 n doubles, Angstrom, in stored order. |
| len | Length of xyz in doubles. Must be at least 3 n. |
| 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.
Types and ids stay as stored. Per-atom labels written by an earlier seams_chill() or seams_chill_plus() are reset. On failure the frame is unchanged.
By default the call checks every coordinate first and then writes them in place, which reads xyz twice and needs no extra memory. After seams_system_stage_positions(sys, 1) it reads xyz once instead (see there).
| sys | Frame handle with a stored frame. |
| xyz | n times 3 Cartesian coordinates, Angstrom. Every value must be finite. |
| n | Atom count. Must equal the stored count. |
| box9 | New cell (ox, oy, oz, lx, ly, lz, xy, xz, yz), or NULL to keep the stored cell. |
| box_len | 9 when box9 is not NULL; ignored otherwise. |
| SEAMS_API seams_status seams_system_stage_positions | ( | seams_system * | sys, |
| int | enable ) |
Trade memory for a single pass in seams_system_set_positions().
With enable nonzero the handle keeps a second set of per-atom records, about 72 bytes per atom. seams_system_set_positions() then checks and writes the coordinates into that set in one pass and swaps it with the stored frame when every value was finite, so a failed call still leaves the frame unchanged. The first reload after each load fills the second set from the frame. With enable 0, the default, the second set is freed. The setting survives loads.
| sys | Frame handle, with or without a stored frame. |
| enable | Nonzero to keep the second set, 0 to free it. |
| SEAMS_API seams_status seams_system_types | ( | const seams_system * | sys, |
| int * | types, | ||
| size_t | len ) |
Copy the stored atom types out.
| sys | Frame handle. |
| types | Caller buffer for n ints, in stored order. |
| len | Length of types. Must be at least n. |