namespace chill#

Overview#

CHILL and CHILL+ structure classification. More…

namespace chill {
 
// enums
 
enum ChillPlusRule;
enum CrystalKind;
 
// structs
 
struct AnalysisPhases;
struct BondClassifier;
struct BondOrder;
struct ChillPlusResult;
struct LinearClassifier;
struct QlCutoffStages;
struct QlmAtom;
struct SteinhardtQl;
struct TemplateHit;
struct VoronoiWeights;
struct YlmAtom;
 
// global functions
 
molSys::bond_type classifyBond(double cij, const BondClassifier& rule, bool closed = true);
BondClassifier chillRule();
BondClassifier chillPlusRule();
BondClassifier bondClassifier(const std::string& name);
void registerBondClassifier(const std::string& name, const BondClassifier& rule);
std::vector<std::string> bondClassifierNames();
void classifyBonds(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, const BondClassifier& rule, bool isSlice = false);
void classifyBonds(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, const BondClassifier& rule, bool isSlice, bool closed);
void classifyBondsCsr(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& offsets, const std::vector<int>& cols, const BondClassifier& rule, bool isSlice = false);
int chillPlusFromCsr(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& offsets, const std::vector<int>& cols, bool keepBonds = true);
int chillPlusOvitoFromCsr(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& offsets, const std::vector<int>& cols);
int chillFromCsr(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& offsets, const std::vector<int>& cols);
void bondOrder(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, const BondClassifier& rule, BondOrder& order, const std::vector<char>* which, bool fresh = true);
void correlFromOrder(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const BondOrder& order, const BondClassifier& rule, bool isSlice, const std::vector<char>* which, bool closed = true);
void getCorrel(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice = false, int coordinationNumber = 4);
void getIceTypeNoPrint(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice = false);
void getIceType(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, std::string path, int firstFrame, bool isSlice = false, std::string outputFileName = “chill.txt”);
void getCorrelPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice = false, int coordinationNumber = 4);
void getCorrelPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice, int coordinationNumber, bool closedBounds);
bool chillPlusPublishedCutoff(molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int typeI);
bool q4q6ChillPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int typeI, std::vector<double>& q4, std::vector<double>& q6, std::vector<double>& q4bar, std::vector<double>& q6bar);
bool chillPlusSymbolicPrefilter(molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int typeI);
void getIceTypePlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, std::string path, int firstFrame, bool isSlice = false, std::string outputFileName = “chillPlus.txt”);
void getIceTypePlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, std::string path, int firstFrame, bool isSlice, std::string outputFileName, bool neighbourTest);
void getIceTypePlusNoPrint(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice = false);
void getIceTypePlusNoPrint(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice, bool neighbourTest);
void clearIceTypesExcept(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& types);
std::vector<double> getq6(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice = false);
void reclassifyWater(molSys::PointCloud<molSys::Point<double>, double>& yCloud, std::vector<double>& q6);
int printIceType(molSys::PointCloud<molSys::Point<double>, double>& yCloud, std::string path, int firstFrame, bool isSlice = false, std::string outputFileName = “superChill.txt”);
bool isInterfacial(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int iatom, int num_staggrd, int num_eclipsd, bool chillPlus = false);
int numStaggered(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int jatom);
SteinhardtQl steinhardtQl(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int orderL);
SteinhardtQl steinhardtQlCutoff(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int orderL, int typeI, bool average, bool invariants = false);
QlCutoffStages& lastQlCutoffStages();
bool localCutoffQ4Q6(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int typeI, std::vector<double>& q4, std::vector<double>& q6);
bool steinhardtQ4Q6Cutoff(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int typeI, bool average, SteinhardtQl& q4, SteinhardtQl& q6);
SteinhardtQl steinhardtQlMutual(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, int k, double candidateCutoff, int typeI, int orderL);
void setSteinhardtAtomSplit(bool split);
AnalysisPhases lastChillPhases();
AnalysisPhases lastSteinhardtPhases();
int steinhardtQlmWidth(int orderL);
void writeSteinhardtQlm(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int orderL, std::vector<double>& qlm, const std::vector<char>* which);
void readSteinhardtQl(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int orderL, const std::vector<double>& qlm, std::vector<double>& ql, std::vector<double>& qlBar, const std::vector<char>* which);
bool preferOffload();
ChillPlusResult hostChillPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList);
ChillPlusResult specializedChillPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList);
ChillPlusResult chillPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList);
int cutoffShellCount(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int iatom);
ChillPlusRule chillPlusRule(std::string_view spec);
ChillPlusRule chillPlusRuleFromFile(const std::string& spec);
const char* chillPlusRuleName(ChillPlusRule rule);
void applyChillPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, ChillPlusRule rule, bool isSlice = false);
std::vector<TemplateHit> classifyTemplates(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int kNeigh = 12);
std::vector<TemplateHit> classifyTemplates(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& offsets, const std::vector<int>& cols, int kNeigh = 12);
std::vector<double> soapSpectrum(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, int iatom, const std::vector<std::vector<int>>& nList, int nMax, int lMax, double rcut);
std::vector<std::vector<double>> soapSpectrumAll(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int nMax, int lMax, double rcut);
std::vector<double> voronoiFeature(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, int iatom, double candidateCutoff);
std::vector<std::vector<double>> voronoiFeatures(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double candidateCutoff);
std::vector<VoronoiWeights> voronoiFacetWeights(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double candidateCutoff);
SteinhardtQl steinhardtQlVoronoi(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double candidateCutoff, int orderL);
SteinhardtQl steinhardtQlVoronoi(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<VoronoiWeights>& cells, int orderL);
 
} // namespace chill

Detailed Documentation#

CHILL and CHILL+ structure classification.

This namespace contains functions that are used in the CHILL/CHILL+ classification scheme, as well as a yodaCloud struct to hold all the information.

Both the CHILL and CHILL+ methods are based on the local bond order parameter method (ten Wolde et al., J. Chem. Phys. 104, 9932, 1996, DOI 10.1063/1.471721), developed for the identification of crystal nuclei in Lennard-Jones systems. The local order parameter method is based on order parameters introduced by Steinhardt et al.

The local environment of the water molecules is classified using an algorithm based on spherical harmonics, which is independent of the specific crystal structure and does not require the definition of a reference frame. The local order around each water molecule \(i\) is described by a local orientational bond order parameter \(q_{lm}(i)\), with \(2l+1\) complex components:

\[q_{lm}(i) = @frac{1}{N_b(i)} \Sigma_{j=1}^{N_b(i)} Y_{lm}(r_{ij})\]

Here, \(N_b(i)=4\) is the number of nearest neighbours for water molecule \(i\), \(l\) is a free integer parameter, \(m\) is an integer such that \(m \in [-l,l]\). The functions \(Y_{lm}(r_{ij})\) are the spherical harmonics and \(r_{ij}\) is the distance vector between molecule \(i\) and each one of its four nearest neighbours \(j\).

The alignment of the orientation of the local structures is measured by the normalized dot product of the local orientational bond order parameter, \(q_l(i)\), between each pair of neighbor molecules \(i\) and \(j\), given by:

\[a(i,j) = \frac{\sum_{m=-l}^{l} q_{lm}(i)\, q_{lm}^*(j)} {|q_l(i)|\,|q_l(j)|}\]

where, \(q_{lm}^*\) is the complex conjugate of \(q_{lm}\).

Depending on the values of \(a(i,j)\), the bond between each pair of molecules \(i\) and \(j\) is classified as being either staggered or eclipsed.

Algorithm   Eclipsed bonds              Staggered bonds
CHILL       -0.05 >= a(i,j) >= -0.2     a(i,j) <= -0.8
CHILL+      0.25 >= a(i,j) >= -0.35     a(i,j) <= -0.8

Since each molecule \(i\) in deeply supercooled water has four nearest neighbours, the type of the resultant four bonds is used to identify phases according to the CHILL and CHILL+ algorithms.

The CHILL algorithm can classify water molecules as belonging to the cubic, hexagonal, interfacial or liquid (amorphous) phase:

Phase        E    S    Neighbours  Description
Cubic        0    4    4           All 4 neighbours are staggered.
Hexagonal    1    3    4           3 staggered and 1 eclipsed bond.
Interfacial  any  2    4           Belongs to the ice phase, but does not satisfy strict criteria of cubic and hexagonal.
             0    3    4
Liquid       N/A  N/A  any         Classification by exclusion.

Here, E and S refer to eclipsed and staggered bonds. The neighbours column contains the number of nearest neighbours.

The CHILL+ algorithm, which is a modified version of CHILL, additionally identifies clathrate and interfacial clathrate phases. The criteria are enumerated in the table below:

Phase                  E    S    Neighbours  Description
Cubic                  0    4    4           no change was made to the staggered bond criterion from CHILL
Hexagonal              1    3    4           wider eclipsed range compared to CHILL; identifies 99% hexagonal ice up to 270 K
Interfacial            any  2    4           must have at least one first neighbor water with more than two staggered bonds
                       0    3    4           must have at least one first neighbor water with more than one staggered bond
Clathrate              4    0    4           bulk clathrate and part of the interface of clathrates can be identified with four eclipsed bonds
Interfacial clathrate  3    any  4           partial clathrate cages and threads of clathrate-like order
Liquid                 N/A  N/A  any         classifies as liquid if none of the above criteria are fulfilled

Although both the CHILL and CHILL+ classification schemes take into account the local order of the environment of each particle, both schemes output a per-particle classification.

Changelog#

Global Functions#

molSys::bond_type classifyBond(double cij, const BondClassifier& rule, bool closed = true)

Staggered, eclipsed, or out of range. closed selects inclusive edges (c <= staggeredMax, eclipsedMin <= c <= eclipsedMax), the Nguyen and Molinero rule and the 2.13 behavior. Open edges match OVITO 3.17.2 (c < staggeredMax, eclipsedMin < c < eclipsedMax). The flag is an argument so BondClassifier stays three doubles and one int. A caller that passes the struct by value does not carry a fifth field.

BondClassifier chillRule()

The CHILL rule set (Moore et al., PCCP 12, 4124, 2010): strict staggered bound, narrow eclipsed band, four nearest neighbours

BondClassifier chillPlusRule()

The CHILL+ rule set (Nguyen and Molinero, JPCB 119, 9369, 2015): wider eclipsed band for interfacial and clathrate recognition

BondClassifier bondClassifier(const std::string& name)

Look up a registered rule set by name. “CHILL” and “CHILL+” are always present; registerBondClassifier adds more. Throws std::out_of_range for unknown names.

void registerBondClassifier(const std::string& name, const BondClassifier& rule)

Register (or replace) a named rule set at runtime, making the material’s thresholds available to every front end by name

std::vector<std::string> bondClassifierNames()

Names of every registered rule set.

void classifyBonds(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, const BondClassifier& rule, bool isSlice = false)

Compute and classify the bond correlations c_ij under an arbitrary rule set, filling yCloud.pts[i].c_ij. getCorrel and getCorrelPlus are this engine under their canonical water rules.

void classifyBonds(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, const BondClassifier& rule, bool isSlice, bool closed)

Same classification as the four-argument form. closed false uses the open OVITO edges. The four-argument form stays the 2.13 symbol and keeps inclusive edges.

void classifyBondsCsr(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& offsets, const std::vector<int>& cols, const BondClassifier& rule, bool isSlice = false)

CHILL/CHILL+ bonds from a CSR of cloud indices.

int chillPlusFromCsr(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& offsets, const std::vector<int>& cols, bool keepBonds = true)

Bonds and CHILL+ labels from a cutoff CSR. Returns the cubic count. keepBonds false still writes iceType and skips the per-atom bond vectors. The labels are the same either way. The vectors are what a caller that reads c_ij needs.

int chillPlusOvitoFromCsr(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& offsets, const std::vector<int>& cols)

OVITO Chill+ from a cutoff CSR. q_lm is the sum over every neighbour in the row, not the four closest. Edges are open and the Table 1 neighbour test is off, which is the Chill+ modifier. A crystal row still needs exactly four neighbours. Bond vectors are not stored. Returns the cubic count.

int chillFromCsr(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& offsets, const std::vector<int>& cols)

Published CHILL labels from a cutoff CSR. Correlations are the four nearest neighbours in the list. Bond vectors are not stored. Returns the cubic count. Thresholds are chillRule().

void correlFromOrder(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const BondOrder& order, const BondClassifier& rule, bool isSlice, const std::vector<char>* which, bool closed = true)

c_ij for atoms which selects, from a bond-order vector that already holds every neighbour the bond reads. Atoms outside which are left untouched, including a ghost’s bond list.

void getCorrel(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice = false, int coordinationNumber = 4)

Function for getting the bond order correlations \(c_{ij}\) (or \(a_{ij}\) in some treatments) according to the CHILL algorithm.

Parameters:

yCloud

The output molSys::PointCloud

nList

The row-ordered neighbour list, by ID. The first element of each row is the particle ID, followed by the IDs of the neighbours

isSlice

This decides whether there is a slice or not

coordinationNumber

How many nearest neighbours the bond sum runs over. The default of four is the coordination CHILL is defined and validated against (tetrahedral water); other values reuse the c_ij machinery for differently coordinated systems, and a non-positive value gives each atom its own count from its neighbour-list row. The ice-classification tables in getIceType remain four-bond rules

void getIceTypeNoPrint(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice = false)

Function that classifies every particle’s molSys::atom_state_type ice type, according to the CHILL algorithm.

Does not print out the information.

Parameters:

yCloud

The output molSys::PointCloud

isSlice

This decides whether there is a slice or not

nList

Row-ordered neighbour list by atom ID

void getIceType(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, std::string path, int firstFrame, bool isSlice = false, std::string outputFileName = “chill.txt”)

Function that classifies every particle’s molSys::atom_state_type ice type, according to the CHILL algorithm.

Parameters:

yCloud

The output molSys::PointCloud

nList

Row-ordered neighbour list by atom ID

path

Path to the output directory to which ice types are written out to

firstFrame

First frame to be analyzed

isSlice

This decides whether there is a slice or not

outputFileName

Name of the output file, to which the ice types will be written out.

void getCorrelPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice = false, int coordinationNumber = 4)

Gets c_ij and then classifies bond types according to the CHILL+ algorithm. coordinationNumber as in getCorrel: four is the validated CHILL+ water scheme, non-positive keeps each atom’s whole neighbour row. This is the 2.13 symbol: inclusive edges (closedBounds true).

void getCorrelPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice, int coordinationNumber, bool closedBounds)

Same classification. closedBounds false uses the open OVITO edges.

bool chillPlusPublishedCutoff(molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int typeI)

Published CHILL+ on the cutoff shell. The pair rows are read inside this call; the shared neighbour-list builder is not modified. Returns false when that search is not available.

bool q4q6ChillPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int typeI, std::vector<double>& q4, std::vector<double>& q6, std::vector<double>& q4bar, std::vector<double>& q6bar)

One cutoff list and one bond pass for local q4, local q6, their Lechner-Dellago averages, and the published CHILL+ labels. The four q arrays match steinhardtQlCutoff with averaging on. Returns false when the atoms are not one type or the cutoff list is not available, and then writes nothing.

bool chillPlusSymbolicPrefilter(molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int typeI)

Cubic pre-filter from discovery/pysr_prefilter.py. The selected expression is cmean^4. It writes cubic and returns true only when every atom has a cutoff shell of four and a negative mean correlation whose fourth power sits above the highest non-cubic score in that search. That forces every bond below -0.84, which the published rule labels staggered, so the atom is cubic. Otherwise it returns false and leaves the cloud unchanged. The default published call does not use it.

void getIceTypePlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, std::string path, int firstFrame, bool isSlice = false, std::string outputFileName = “chillPlus.txt”)

Classifies each atom according to the CHILL+ algorithm. This is the 2.13 symbol: the published neighbour test stays on.

void getIceTypePlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, std::string path, int firstFrame, bool isSlice, std::string outputFileName, bool neighbourTest)

neighbourTest false is the OVITO interfacial rule.

void getIceTypePlusNoPrint(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice = false)

CHILL+ ice types on the cloud. Does not write a file. This is the 2.13 symbol: the published neighbour test stays on.

void getIceTypePlusNoPrint(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice, bool neighbourTest)

neighbourTest false is the OVITO interfacial rule (two staggered bonds, or three staggered and no eclipsed bond, with no neighbour lookup). Either rule still requires a cutoff shell of four.

void clearIceTypesExcept(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& types)

Set iceType to unclassified for atoms whose LAMMPS type is not in types. Empty types leaves the cloud unchanged. Used after a water-type k-NN so substrate and ions are not scored as water.

std::vector<double> getq6(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, bool isSlice = false)

q6 can distinguish between water and ice. Use this for the largest ice cluster

void reclassifyWater(molSys::PointCloud<molSys::Point<double>, double>& yCloud, std::vector<double>& q6)

‘Test’ condition for classifying hexagonal ice using averaged q6 and q3 Checks water According to https://pubs.rsc.org/en/content/articlehtml/2011/cp/c1cp22167a Gets c_ij and then classifies bond types according to the CHILL+ algorithm

int printIceType(molSys::PointCloud<molSys::Point<double>, double>& yCloud, std::string path, int firstFrame, bool isSlice = false, std::string outputFileName = “superChill.txt”)

Prints out the iceType for a particular frame onto the terminal.

bool isInterfacial(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int iatom, int num_staggrd, int num_eclipsd, bool chillPlus = false)

Interfacial ice. Moore CHILL uses a neighbour with exactly two staggered bonds; Nguyen CHILL+ uses a neighbour with more than one. Pass chillPlus=true for the latter.

int numStaggered(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int jatom)

Finds the number of staggered bonds for a given atom of index jatom.

SteinhardtQl steinhardtQl(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int orderL)

Local and neighbour-averaged Steinhardt parameters of degree 3, 4, 6, 8, or 12. Local ql is Steinhardt, Nelson and Ronchetti; qlBar is the Lechner-Dellago average of q_lm over the particle and its neighbours. l=12 is host-only (associated Legendre, or sphericart when linked) for the Zeron hydrate pair with l=3; the device Ylm path has no l=12. Other degrees return zeros. The compute path flattens the neighbour list to CSR so the same kernel can run on the host (OpenMP), across MPI ranks (atom split plus Allgatherv of q_lm), or under OpenMP target offload when the build provides a device.

SteinhardtQl steinhardtQlCutoff(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int orderL, int typeI, bool average, bool invariants = false)

Local \(q_l\) on the cutoff list.

Neighbours are orthoFullCsr, not a four-nearest rebuild, and the kernel reads that CSR directly. Lechner-Dellago \(\bar{q}_l\) is filled only when average is true. Otherwise qlBar stays zero. invariants fills wl with the normalized Steinhardt \(\hat{w}_l\) for l = 4 or 6.

bool localCutoffQ4Q6(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int typeI, std::vector<double>& q4, std::vector<double>& q6)

Local q4 and q6 from one cutoff list. Same values as two steinhardtQlCutoff calls with averaging off. Returns false when the shared shell cannot be built.

bool steinhardtQ4Q6Cutoff(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double cutoff, int typeI, bool average, SteinhardtQl& q4, SteinhardtQl& q6)

q4 and q6 from one cutoff list. The bond vectors are wrapped once. Each degree then uses the same harmonic as steinhardtQlCutoff, so the values match two separate calls. Returns false when that list is not available; the outputs are left untouched.

SteinhardtQl steinhardtQlMutual(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, int k, double candidateCutoff, int typeI, int orderL)

Mutual k-nearest Steinhardt parameters. The coordinate buffer built for the nomination is the one the harmonics read, and the neighbour rows stay in one packed array. l is 3, 4 or 6; other degrees return the result of building the mutual graph and calling steinhardtQl.

void setSteinhardtAtomSplit(bool split)

Whether steinhardtQl splits atoms over the ranks of an initialised MPI_COMM_WORLD (true unless set). A driver that gives each rank whole frames of its own turns it off.

int steinhardtQlmWidth(int orderL)

Width of one atom’s interleaved q_lm: real, imaginary, m = -l..l.

void writeSteinhardtQlm(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int orderL, std::vector<double>& qlm, const std::vector<char>* which)

q_lm for atoms which selects. Other atoms are left zero.

void readSteinhardtQl(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int orderL, const std::vector<double>& qlm, std::vector<double>& ql, std::vector<double>& qlBar, const std::vector<char>* which)

ql and qlBar for atoms which selects, reading q_lm of their neighbours.

ChillPlusResult hostChillPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList)

Host CHILL+ (classifyBonds + getIceTypePlusNoPrint).

ChillPlusResult specializedChillPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList)

Flattened CHILL+.

Target device when compiled with offload.

int cutoffShellCount(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int iatom)

Neighbours in one cutoff row, ignoring the leading atom id and any id that is not in the cloud. This is the Table 1 shell count.

ChillPlusRule chillPlusRule(std::string_view spec)

chill+, ovito-chill+, a YAML document with rule: or chill-plus:, or a Lua table fragment rule = "...". An empty string is the published rule. Anything else throws.

ChillPlusRule chillPlusRuleFromFile(const std::string& spec)

Read spec as a rule name. If spec names a readable file, the file is scanned for a rule or chill-plus key. Comments are skipped. The file is not executed as Lua or YAML.

void applyChillPlus(molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, ChillPlusRule rule, bool isSlice = false)

Published or OVITO CHILL+ on one cloud. The neighbour list is the cutoff shell the rule counts.

std::vector<TemplateHit> classifyTemplates(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int kNeigh = 12)

Overlay the k nearest neighbours of each particle onto FCC, HCP, BCC and SC shells. Uses IRA when linked; otherwise Horn on a distance-sorted correspondence (high-symmetry shells only).

std::vector<TemplateHit> classifyTemplates(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<int>& offsets, const std::vector<int>& cols, int kNeigh = 12)

Same overlay, reading a CSR of cloud indices.

std::vector<double> soapSpectrum(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, int iatom, const std::vector<std::vector<int>>& nList, int nMax, int lMax, double rcut)

Bartok SOAP power spectrum for one particle (nMax radial Gaussians, spherical harmonics through lMax). Length is nMax*nMax*(lMax+1).

std::vector<std::vector<double>> soapSpectrumAll(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, const std::vector<std::vector<int>>& nList, int nMax, int lMax, double rcut)

Bartok SOAP power spectrum for every particle. Length is nop; each row is nMax*nMax*(lMax+1).

std::vector<double> voronoiFeature(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, int iatom, double candidateCutoff)

[q4, q6, q8] from the Voronoi-weighted Steinhardt path (Mickel).

std::vector<std::vector<double>> voronoiFeatures(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double candidateCutoff)

[q4, q6, q8] for every particle. One tessellation per order (l = 4, 6, 8).

std::vector<VoronoiWeights> voronoiFacetWeights(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double candidateCutoff)

Facet neighbours and area weights for every particle, with an a posteriori exactness certificate.

candidateCutoff seeds the bisector search; the cutoff is enlarged automatically until the certificate holds or the growth cap is reached.

Certificate. The cell of particle i clipped against every candidate within cutoff c is the true Voronoi cell whenever every vertex of the clipped cell lies within c/2 of i: a particle k beyond the cutoff has abs(d_k) > c, its bisector plane sits at distance abs(d_k)/2 > c/2 from i, and a half-space whose boundary is farther than c/2 cannot cut a region contained in the ball of radius c/2. An open or under-clipped cell keeps vertices on the seeding square at distance ~c and fails the certificate, which is exactly the failure the enlargement retries.

SteinhardtQl steinhardtQlVoronoi(const molSys::PointCloud<molSys::Point<double>, double>& yCloud, double candidateCutoff, int orderL)

Steinhardt parameters of degree orderL (3, 4, 6 or 8) with the bond sum weighted by Voronoi facet areas. qlBar averages the weighted q_lm over the particle and its facet neighbours, after Lechner and Dellago.