require(“dseams”)#
Public table from require("dseams") (lua/dseams.lua on
dseams_core). require("yoda") is the same table.
Fennel call shape is in Call dseams from Fennel.
Compiled names on dseams.core are in Compiled registrations.
Public names#
local dseams = require("dseams")
local cloud = dseams.read("water.lammpstrj", {type = 2})
local types = dseams.chill_plus(cloud, {cutoff = 3.5, type = 2})
local nl = dseams.core.neighListO(3.5, cloud, 2)
name |
kind |
role |
|---|---|---|
|
function |
suffix-dispatching loader |
|
function |
cutoff neighbour list by atom ID |
|
function |
k-nearest graph by atom ID |
|
function |
CHILL+ state names; no file |
|
function |
CHILL state names; no file |
|
function |
seeded HC/DDC per-atom flags |
|
table |
|
These seven names are the public surface. Locals in lua/dseams.lua
(suffix, opts) are not exported. Option tables may be omitted.
Defaults are those of lua/dseams.lua.
The engine CLI injects compiled names as globals. Library scripts
call them on dseams.core.
Calling conventions#
PointCloud userdata#
Readers return a PointCloud userdata, not a table. The usertype is
registered on the Lua state when dseams_core loads, so
PointCloud.new() is a global after require. Workflow scripts pass
that scratch object into the legacy readers.
member |
kind |
meaning |
|---|---|---|
|
field |
particle count |
|
field |
frame index just read |
|
method |
box lengths, 3-number table |
|
method |
box origin, 3-number table |
|
method |
per-particle state name strings |
Ice-state strings: cubic, hexagonal, water, interfacial,
clathrate, interClathrate, reCubic, reHex, unclassified.
Tables vs userdata#
New-style compiled names take neighbour lists and ring lists by
value. sol2 builds a C++ container from a plain Lua table of
tables. Those names return sol::as_nested or sol::as_table, so
the result is a Lua table.
Legacy names take C++ container references. They bind only container userdata (the object another C++ bind already put on the stack). A freshly written Lua table is not accepted.
style |
examples |
nList / rings in |
result |
|---|---|---|---|
new |
|
Lua table |
Lua table (or void / name table) |
new, userdata out |
|
Lua table |
C++ vector userdata |
legacy |
|
userdata |
userdata |
sol2 does not apply C++ default arguments on a raw bind. Wrapped
names spell optionals in Lua (sol::optional). Legacy names need
every argument the bound C++ signature requires.
read(path[, opts])#
Suffix-dispatching loader. Returns a PointCloud.
suffix |
backend |
notes |
|---|---|---|
|
|
whole file; |
|
|
errors if this build has no readcon |
|
|
errors if this build has no chemfiles; |
other (LAMMPS dump) |
|
|
opts.frame is the 1-based frame index (default 1). opts.type is
the LAMMPS type ID to keep.
neighbors(cloud[, opts])#
Cutoff neighbour list by atom ID. Calls
core.neighListO(opts.cutoff or 3.5, cloud, opts.type or 1).
Returns a Lua table of rows (self ID first).
knn(cloud[, opts])#
k-nearest graph by atom ID. Calls core.kNearestNeighbourList.
opts.kdefaults to 4opts.cutoff(candidate cutoff) defaults to 5.0opts.typedefaults to 1opts.mutualdefaults to true; only the booleanfalseselects the union graph
chill_plus(cloud[, opts])#
Builds neighbors(cloud, opts), runs
core.getCorrelPlus(cloud, nl, false), returns
core.getIceTypePlusNoPrint(cloud, nl, false) (1-based array of
state names). Does not write a file. Mutates cloud.
chill(cloud[, opts])#
Same pipeline with core.getCorrel and core.getIceTypeNoPrint.
Mutates cloud. Does not write a file.
cages(cloud[, opts])#
Seeded HC/DDC membership. Builds mutual and union k-nearest graphs
(opts.k 4, opts.cutoff 5.0, opts.type 1), converts each to an
index list, keeps six-membered rings, and returns
core.seededCageAffiliation(...): a table {hc = ..., ddc = ...}
of per-atom flags.
core#
The table returned by require("dseams_core"). Every name from
luaApi::registerAll (src/lua_api.cpp) lives here.
Usertypes (PointCloud, RingUpdater, AffiliationUpdater) are
registered on the Lua state, not on this table.
RingUpdater.new(6) works after require.
Signatures for every compiled name are in Compiled registrations.