Loading...
Searching...
No Matches
ring Namespace Reference

Topological network criteria functions. More...

Classes

class  AffiliationUpdater
 Exact incremental affiliation across frames. More...
struct  CageAffiliation
 Per-ring affiliation flags, indexed like the input ring vector. More...
struct  RingSearchIndex
 Inverted index from an atom to the rings that contain it. More...
struct  SeededAtomLabels
 Per-atom cage flags from seeded (hysteresis) affiliation. More...

Enumerations

enum class  strucType {
  strucType::unclassified , strucType::DDC , strucType::HCbasal , strucType::HCprismatic ,
  strucType::bothBasal , strucType::bothPrismatic , strucType::Prism , strucType::deformedPrism ,
  strucType::mixedPrismRing
}

Functions

CageAffiliation cageAffiliation (const std::vector< std::vector< int > > &rings, const std::vector< std::vector< int > > &nList)
SeededAtomLabels seededCageAffiliation (const std::vector< std::vector< int > > &strictRings, const std::vector< std::vector< int > > &strictNList, const std::vector< std::vector< int > > &permissiveRings, const std::vector< std::vector< int > > &permissiveNList)
 Seeded affiliation over two graphs on the same atoms: the strict graph (typically the mutual k-nearest bonds) supplies seeds, the permissive supergraph (typically the union bonds) supplies completions, and a permissively affiliated atom is accepted only when its bonded component of affiliated atoms contains a seed.
std::vector< std::vector< int > > getSingleRingSize (const std::vector< std::vector< int > > &rings, int ringSize)
 Returns a vector of vectors of rings of a single size.
bool hasCommonElements (std::vector< int > ring1, std::vector< int > ring2)
bool compareRings (std::vector< int > ring1, std::vector< int > ring2)
bool findTripletInRing (const std::vector< int > &ring, const std::vector< int > &triplet)
 Searches a particular ring for a triplet.
bool commonElementsInThreeRings (const std::vector< int > &ring1, const std::vector< int > &ring2, const std::vector< int > &ring3)
 Common elements in 3 rings.
std::vector< int > findsCommonElements (const std::vector< int > &ring1, const std::vector< int > &ring2)
 Returns the common elements of two rings.
int clearRingList (std::vector< std::vector< int > > &rings)
 Erases memory for a vector of vectors for a list of rings.
int assignPolygonType (const std::vector< std::vector< int > > &rings, std::vector< int > &atomTypes, const std::vector< int > &nRings)
void getEdgeMoleculesInRings (const std::vector< std::vector< int > > &rings, molSys::PointCloud< molSys::Point< double >, double > &oCloud, molSys::PointCloud< molSys::Point< double >, double > &yCloud, std::array< double, 3 > coordLow, std::array< double, 3 > coordHigh, bool identicalCloud=false)
void printSliceGetEdgeMoleculesInRings (std::string path, const std::vector< std::vector< int > > &rings, molSys::PointCloud< molSys::Point< double >, double > &oCloud, molSys::PointCloud< molSys::Point< double >, double > &yCloud, std::array< double, 3 > coordLow, std::array< double, 3 > coordHigh, bool identicalCloud=false)
int bulkPolygonRingAnalysis (std::string path, const std::vector< std::vector< int > > &rings, const std::vector< std::vector< int > > &nList, molSys::PointCloud< molSys::Point< double >, double > &yCloud, int maxDepth, int firstFrame)
int topoBulkAnalysis (std::string path, const std::vector< std::vector< int > > &rings, const std::vector< std::vector< int > > &nList, molSys::PointCloud< molSys::Point< double >, double > &yCloud, int firstFrame, bool onlyTetrahedral=true)
RingSearchIndex buildRingSearchIndex (const std::vector< std::vector< int > > &rings, int numAtoms)
 Builds the inverted atom-to-rings index used by the cage searches.
std::vector< int > findDDC (const std::vector< std::vector< int > > &rings, std::vector< strucType > &ringType, const std::vector< int > &listHC, std::vector< cage::Cage > &cageList)
std::vector< int > findDDC (const std::vector< std::vector< int > > &rings, std::vector< strucType > &ringType, const std::vector< int > &listHC, std::vector< cage::Cage > &cageList, const RingSearchIndex &index)
 As findDDC, reusing an index the caller has already built.
std::vector< int > findMixedRings (const std::vector< std::vector< int > > &rings, std::vector< strucType > &ringType, std::vector< int > &listDDC, std::vector< int > &listHC)
std::vector< int > findHC (const std::vector< std::vector< int > > &rings, std::vector< strucType > &ringType, const std::vector< std::vector< int > > &nList, std::vector< cage::Cage > &cageList)
std::vector< int > findHC (const std::vector< std::vector< int > > &rings, std::vector< strucType > &ringType, const std::vector< std::vector< int > > &nList, std::vector< cage::Cage > &cageList, const RingSearchIndex &index)
 As findHC, reusing an index the caller has already built.
bool conditionOneDDC (const std::vector< std::vector< int > > &rings, std::vector< int > &peripheralRings, int iring)
bool conditionOneDDC (const std::vector< std::vector< int > > &rings, std::vector< int > &peripheralRings, int iring, const RingSearchIndex &index)
 As conditionOneDDC, reusing an index the caller has already built.
bool conditionTwoDDC (const std::vector< std::vector< int > > &rings, std::vector< int > &peripheralRings, int iring)
bool conditionTwoDDC (const std::vector< std::vector< int > > &rings, std::vector< int > &peripheralRings, int iring, const RingSearchIndex &index)
 As conditionTwoDDC, answering each triplet from the inverted index.
bool conditionThreeDDC (const std::vector< std::vector< int > > &rings, std::vector< int > &peripheralRings)
bool basalConditions (const std::vector< std::vector< int > > &nList, const std::vector< int > &basal1, const std::vector< int > &basal2)
 Tests whether two rings are basal rings (true) or not (false).
bool basalNeighbours (const std::vector< std::vector< int > > &nList, std::vector< int > &triplet, int atomOne, int atomTwo)
bool notNeighboursOfRing (const std::vector< std::vector< int > > &nList, std::vector< int > &triplet, const std::vector< int > &ring)
int findPrismatic (const std::vector< std::vector< int > > &rings, std::vector< int > &listHC, std::vector< strucType > &ringType, int iring, int jring, std::vector< int > &prismaticRings)
 Finds the prismatic rings from basal rings iring and jring.
int findPrismatic (const std::vector< std::vector< int > > &rings, std::vector< int > &listHC, std::vector< strucType > &ringType, int iring, int jring, std::vector< int > &prismaticRings, const RingSearchIndex &index)
 As findPrismatic, drawing candidate rings from the inverted index.
int getAtomTypesTopoBulk (const std::vector< std::vector< int > > &rings, const std::vector< ring::strucType > &ringType, std::vector< cage::iceType > &atomTypes)
int getStrucNumbers (const std::vector< ring::strucType > &ringType, const std::vector< cage::Cage > &cageList, int &numHC, int &numDDC, int &mixedRings, int &prismaticRings, int &basalRings)
 Determines the number of HCs, DDCs, Mixed rings, prismatic and basal rings.
std::vector< int > findPrisms (const std::vector< std::vector< int > > &rings, std::vector< strucType > &ringType, int &nPerfectPrisms, int &nImperfectPrisms, const std::vector< std::vector< int > > &nList, molSys::PointCloud< molSys::Point< double >, double > &yCloud, std::vector< double > &rmsdPerAtom, bool doShapeMatching=false)
bool basalPrismConditions (const std::vector< std::vector< int > > &nList, std::vector< int > &basal1, std::vector< int > &basal2)
bool relaxedPrismConditions (const std::vector< std::vector< int > > &nList, std::vector< int > &basal1, std::vector< int > &basal2)
bool discardExtraTetragonBlocks (std::vector< int > &basal1, std::vector< int > &basal2, molSys::PointCloud< molSys::Point< double >, double > &yCloud)
std::vector< std::vector< int > > keepAxialRingsOnly (const std::vector< std::vector< int > > &rings, molSys::PointCloud< molSys::Point< double >, double > &yCloud)
 Saves only axial rings out of all possible rings.
int prismAnalysis (std::string path, const std::vector< std::vector< int > > &rings, const std::vector< std::vector< int > > &nList, molSys::PointCloud< molSys::Point< double >, double > &yCloud, int maxDepth, int &atomID, int firstFrame, int currentFrame, bool doShapeMatching=false)
int assignPrismType (const std::vector< std::vector< int > > &rings, const std::vector< int > &listPrism, int ringSize, const std::vector< ring::strucType > &ringType, std::vector< int > &atomTypes, std::vector< ring::strucType > &atomState)
int deformedPrismTypes (const std::vector< ring::strucType > &atomState, std::vector< int > &atomTypes, int maxDepth)
 Get the atom type values for deformed prisms.
int rmAxialTranslations (molSys::PointCloud< molSys::Point< double >, double > &yCloud, int &atomID, int firstFrame, int currentFrame)
 Shift the entire ice nanotube and remove axial translations.
int polygonRingAnalysis (std::string path, std::vector< std::vector< int > > rings, std::vector< std::vector< int > > nList, molSys::PointCloud< molSys::Point< double >, double > &yCloud, int maxDepth, double sheetArea, int firstFrame)

Detailed Description

Topological network criteria functions.

This namespace contains functions for the topological network criteria for bulk and confined systems both.

Although the namespace is shared by bulk and confined topological network criteria, the functions are split into files specific to each set of criteria.

All the topological network criteria are based on the identification of primitive rings (using the Franzblau algorithm for primitive rings), following which specific rules for combinations of primitive rings are used to identify quasi-one-dimensional, quasi-two-dimensional and bulk ices.

Changelog

Function Documentation

◆ basalConditions()

bool ring::basalConditions ( const std::vector< std::vector< int > > & nList,
const std::vector< int > & basal1,
const std::vector< int > & basal2 )

Tests whether two rings are basal rings (true) or not (false).

◆ basalNeighbours()

bool ring::basalNeighbours ( const std::vector< std::vector< int > > & nList,
std::vector< int > & triplet,
int atomOne,
int atomTwo )

Tests whether the last two elements of a triplet are neighbours of two atom IDs passed in

◆ buildRingSearchIndex()

RingSearchIndex ring::buildRingSearchIndex ( const std::vector< std::vector< int > > & rings,
int numAtoms )
nodiscard

Builds the inverted atom-to-rings index used by the cage searches.

◆ bulkPolygonRingAnalysis()

int ring::bulkPolygonRingAnalysis ( std::string path,
const std::vector< std::vector< int > > & rings,
const std::vector< std::vector< int > > & nList,
molSys::PointCloud< molSys::Point< double >, double > & yCloud,
int maxDepth,
int firstFrame )
nodiscard

Find out rings in the bulk, looping through all ring sizes upto the maxDepth The input ringsAllSizes array has rings of every size.

◆ cageAffiliation()

CageAffiliation ring::cageAffiliation ( const std::vector< std::vector< int > > & rings,
const std::vector< std::vector< int > > & nList )
nodiscard

Batch computation of the affiliation predicates for six-membered rings. nList is by index with the leading self entry, as neighbourListByIndex produces.

◆ conditionOneDDC() [1/2]

bool ring::conditionOneDDC ( const std::vector< std::vector< int > > & rings,
std::vector< int > & peripheralRings,
int iring )

First condition for the DDC: There must be at least 3 other rings in which each element of the equatorial ring is present

◆ conditionOneDDC() [2/2]

bool ring::conditionOneDDC ( const std::vector< std::vector< int > > & rings,
std::vector< int > & peripheralRings,
int iring,
const RingSearchIndex & index )

As conditionOneDDC, reusing an index the caller has already built.

◆ conditionThreeDDC()

bool ring::conditionThreeDDC ( const std::vector< std::vector< int > > & rings,
std::vector< int > & peripheralRings )

Third condition for the DDC: Even (by vector index) numbered index triplets and odd triplets must have at least one element in common

◆ conditionTwoDDC() [1/2]

bool ring::conditionTwoDDC ( const std::vector< std::vector< int > > & rings,
std::vector< int > & peripheralRings,
int iring )

Second condition for the DDC: There must be at least 1 other ring for every triplet in the equatorial ring

◆ conditionTwoDDC() [2/2]

bool ring::conditionTwoDDC ( const std::vector< std::vector< int > > & rings,
std::vector< int > & peripheralRings,
int iring,
const RingSearchIndex & index )

As conditionTwoDDC, answering each triplet from the inverted index.

◆ findDDC() [1/2]

std::vector< int > ring::findDDC ( const std::vector< std::vector< int > > & rings,
std::vector< strucType > & ringType,
const std::vector< int > & listHC,
std::vector< cage::Cage > & cageList )

Find out which hexagonal rings are DDC (Double Diamond Cages) rings. Returns a vector containing all the ring IDs which are DDC rings

◆ findDDC() [2/2]

std::vector< int > ring::findDDC ( const std::vector< std::vector< int > > & rings,
std::vector< strucType > & ringType,
const std::vector< int > & listHC,
std::vector< cage::Cage > & cageList,
const RingSearchIndex & index )

As findDDC, reusing an index the caller has already built.

◆ findHC() [1/2]

std::vector< int > ring::findHC ( const std::vector< std::vector< int > > & rings,
std::vector< strucType > & ringType,
const std::vector< std::vector< int > > & nList,
std::vector< cage::Cage > & cageList )

Find out which hexagonal rings are HC rings. Returns a vector containing all the ring IDs which are HC rings

◆ findHC() [2/2]

std::vector< int > ring::findHC ( const std::vector< std::vector< int > > & rings,
std::vector< strucType > & ringType,
const std::vector< std::vector< int > > & nList,
std::vector< cage::Cage > & cageList,
const RingSearchIndex & index )

As findHC, reusing an index the caller has already built.

◆ findMixedRings()

std::vector< int > ring::findMixedRings ( const std::vector< std::vector< int > > & rings,
std::vector< strucType > & ringType,
std::vector< int > & listDDC,
std::vector< int > & listHC )

Find out which hexagonal rings are both DDCs (Double Diamond Cages) and HCs (Hexagonal Cages). Returns a vector containing all the ring IDs which are of this type

◆ findPrismatic() [1/2]

int ring::findPrismatic ( const std::vector< std::vector< int > > & rings,
std::vector< int > & listHC,
std::vector< strucType > & ringType,
int iring,
int jring,
std::vector< int > & prismaticRings )
nodiscard

Finds the prismatic rings from basal rings iring and jring.

◆ findPrismatic() [2/2]

int ring::findPrismatic ( const std::vector< std::vector< int > > & rings,
std::vector< int > & listHC,
std::vector< strucType > & ringType,
int iring,
int jring,
std::vector< int > & prismaticRings,
const RingSearchIndex & index )
nodiscard

As findPrismatic, drawing candidate rings from the inverted index.

◆ getAtomTypesTopoBulk()

int ring::getAtomTypesTopoBulk ( const std::vector< std::vector< int > > & rings,
const std::vector< ring::strucType > & ringType,
std::vector< cage::iceType > & atomTypes )
nodiscard

Assigns a type of enum class iceType, to every atom, using information from ringType, which has the information of every ring

◆ getStrucNumbers()

int ring::getStrucNumbers ( const std::vector< ring::strucType > & ringType,
const std::vector< cage::Cage > & cageList,
int & numHC,
int & numDDC,
int & mixedRings,
int & prismaticRings,
int & basalRings )
nodiscard

Determines the number of HCs, DDCs, Mixed rings, prismatic and basal rings.

◆ notNeighboursOfRing()

bool ring::notNeighboursOfRing ( const std::vector< std::vector< int > > & nList,
std::vector< int > & triplet,
const std::vector< int > & ring )

Tests to check that elements of a triplet are not neighbours of a ring (vector) passed

◆ seededCageAffiliation()

SeededAtomLabels ring::seededCageAffiliation ( const std::vector< std::vector< int > > & strictRings,
const std::vector< std::vector< int > > & strictNList,
const std::vector< std::vector< int > > & permissiveRings,
const std::vector< std::vector< int > > & permissiveNList )
nodiscard

Seeded affiliation over two graphs on the same atoms: the strict graph (typically the mutual k-nearest bonds) supplies seeds, the permissive supergraph (typically the union bonds) supplies completions, and a permissively affiliated atom is accepted only when its bonded component of affiliated atoms contains a seed.

Specificity on structureless input is structural rather than statistical: when the strict pass affiliates nothing, nothing is accepted regardless of what the permissive graph builds. Where both graphs label an atom, the strict labels win.

Parameters
[in]strictRingsSix-membered rings of the strict graph.
[in]strictNListStrict graph, by index with leading self entries.
[in]permissiveRingsSix-membered rings of the permissive graph.
[in]permissiveNListPermissive graph, same conventions.

◆ topoBulkAnalysis()

int ring::topoBulkAnalysis ( std::string path,
const std::vector< std::vector< int > > & rings,
const std::vector< std::vector< int > > & nList,
molSys::PointCloud< molSys::Point< double >, double > & yCloud,
int firstFrame,
bool onlyTetrahedral = true )
nodiscard

Find out which rings are DDCs or HCs, which are comprised of 6-membered primitive rings. Start with a neighbour list (by index) and a vector of vectors of rings (also by index). TODO: try 'square' ice and ice0