seams-core v2.14.0
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
cage_enum.hpp
Go to the documentation of this file.
1//-----------------------------------------------------------------------------------
2// d-SEAMS - Deferred Structural Elucidation Analysis for Molecular Simulations
3// SPDX-License-Identifier: MIT
4//-----------------------------------------------------------------------------------
5#ifndef SEAMS_CAGE_ENUM_H_
6#define SEAMS_CAGE_ENUM_H_
7
8#include <cage.hpp>
9
10#include <array>
11#include <map>
12#include <string>
13#include <string_view>
14#include <vector>
15
34namespace cage {
35
37struct FoundCage {
39 std::vector<int> faces;
40 std::vector<int> vertices;
41 std::string certificate;
42 bool closed = true;
43 int danglingEdges = 0;
44};
45
48bool isClosedPolyhedron(const std::vector<std::vector<int>> &rings,
49 const std::vector<int> &faces);
50
55bool isSpherePolyhedron(const std::vector<std::vector<int>> &rings,
56 const std::vector<int> &faces);
57
63std::vector<FoundCage>
64findBySignature(const std::vector<std::vector<int>> &rings,
65 const Signature &signature);
66
68bool speciesCycleMatches(const std::vector<int> &cycle,
69 const std::vector<int> &pattern);
70
76std::vector<FoundCage>
77findBySignature(const std::vector<std::vector<int>> &rings,
78 const Signature &signature, const std::vector<int> &species,
79 const std::vector<std::vector<int>> &patterns);
80
83std::vector<FoundCage>
84findBySignature(const std::vector<std::vector<int>> &rings,
85 const std::vector<std::vector<int>> &nList,
86 const Signature &signature);
87
91std::vector<FoundCage>
92findBySignature(const std::vector<std::vector<int>> &rings,
93 const std::vector<std::vector<int>> &nList,
94 const Signature &signature, const std::vector<int> &atomRank);
95
102 bool enabled = true;
103 double lo = 2.65;
104 double hi = 3.15;
105};
106
110EdgeWindow parseEdgeWindow(std::string_view spec);
111
113std::string edgeWindowSpec(const EdgeWindow &window);
114
125std::vector<std::vector<FoundCage>>
126findBySignatures(const std::vector<std::vector<int>> &rings,
127 const std::vector<std::vector<int>> &nList,
128 const std::vector<Signature> &signatures,
129 const std::vector<int> &atomRank,
130 const std::vector<std::array<double, 3>> *xyz = nullptr,
131 const std::vector<double> *box = nullptr,
132 const EdgeWindow &window = {},
133 const std::vector<double> *boxLow = nullptr);
134
140std::vector<FoundCage>
141findIncompleteBySignature(const std::vector<std::vector<int>> &rings,
142 const Signature &signature, int minFaces);
143
146std::size_t exerciseClosedSeedFilter(const std::vector<std::vector<int>> &rings,
147 const Signature &signature);
148
152struct CageShape {
153 int nVertices = 0;
154 int status = 1;
155 double rmsd = -1.0;
156 std::string pointGroup;
157};
158
160std::vector<std::array<double, 3>>
161coordsOfVertices(const std::vector<std::array<double, 3>> &all,
162 const std::vector<int> &vertices);
163
165CageShape shapeOfVertices(const std::vector<std::array<double, 3>> &cageXyz);
166
169CageShape overlayVertices(const std::vector<std::array<double, 3>> &ref,
170 const std::vector<std::array<double, 3>> &cageXyz);
171
176struct FormerRow {
177 int index = -1;
178 int species = 0;
179 int coord = 0;
180 int homopolar = 0;
181 std::map<int, int> rings;
182};
183
185std::vector<FormerRow>
186formerRows(const std::vector<std::vector<int>> &nList,
187 const std::vector<std::vector<int>> &rings,
188 const std::vector<int> &species, int formerSpecies);
189
192bool sameNetwork(const std::vector<FormerRow> &early,
193 const std::vector<FormerRow> &late);
194
195} // namespace cage
196
197#endif // SEAMS_CAGE_ENUM_H_
File for cage types for topological network criteria.
Functions for topological network criteria cage types.
Definition cage.hpp:47
std::vector< FoundCage > findIncompleteBySignature(const std::vector< std::vector< int > > &rings, const Signature &signature, int minFaces)
Connected face sets that stay inside the signature budget, have at least minFaces faces,...
std::string edgeWindowSpec(const EdgeWindow &window)
none when the window is off, otherwise lo,hi.
bool sameNetwork(const std::vector< FormerRow > &early, const std::vector< FormerRow > &late)
True when the two tables have the same per-atom species, coordination, homopolar count,...
bool isClosedPolyhedron(const std::vector< std::vector< int > > &rings, const std::vector< int > &faces)
True when every edge of the listed faces is used by exactly two of those faces.
CageShape shapeOfVertices(const std::vector< std::array< double, 3 > > &cageXyz)
Point group of this vertex set.
EdgeWindow parseEdgeWindow(std::string_view spec)
none, off, or false disables the window.
std::vector< std::array< double, 3 > > coordsOfVertices(const std::vector< std::array< double, 3 > > &all, const std::vector< int > &vertices)
Coordinates of vertices only.
std::vector< FoundCage > findBySignature(const std::vector< std::vector< int > > &rings, const Signature &signature)
Face-sharing rings whose size census equals signature and whose edges close.
bool speciesCycleMatches(const std::vector< int > &cycle, const std::vector< int > &pattern)
True when cycle is pattern rotated or reversed.
bool isSpherePolyhedron(const std::vector< std::vector< int > > &rings, const std::vector< int > &faces)
True when the listed faces are closed (isClosedPolyhedron), at least three faces around each of their...
std::size_t exerciseClosedSeedFilter(const std::vector< std::vector< int > > &rings, const Signature &signature)
Runs Search with the closed seed filter left on.
CageShape overlayVertices(const std::vector< std::array< double, 3 > > &ref, const std::vector< std::array< double, 3 > > &cageXyz)
Overlay cageXyz on ref.
std::vector< FormerRow > formerRows(const std::vector< std::vector< int > > &nList, const std::vector< std::vector< int > > &rings, const std::vector< int > &species, int formerSpecies)
formerSpecies < 0 keeps every atom.
std::vector< std::vector< FoundCage > > findBySignatures(const std::vector< std::vector< int > > &rings, const std::vector< std::vector< int > > &nList, const std::vector< Signature > &signatures, const std::vector< int > &atomRank, const std::vector< std::array< double, 3 > > *xyz=nullptr, const std::vector< double > *box=nullptr, const EdgeWindow &window={}, const std::vector< double > *boxLow=nullptr)
findBySignature for each of signatures, one list per entry.
IRA/SOFI result for one cage.
std::string pointGroup
Inclusive length window on each face edge, in the coordinate units of the frame.
One network-former atom: coordination, same-species bonds, and the primitive rings that pass through ...
std::map< int, int > rings
One cage matching a signature, closed or incomplete.
Definition cage_enum.hpp:37
std::vector< int > faces
ring indices into the input vector
Definition cage_enum.hpp:39
Signature signature
Definition cage_enum.hpp:38
std::string certificate
nauty hex, empty when nauty is off
Definition cage_enum.hpp:41
int danglingEdges
edges used once (cups / incomplete)
Definition cage_enum.hpp:43
bool closed
faces tile a sphere
Definition cage_enum.hpp:42
std::vector< int > vertices
sorted unique atom indices
Definition cage_enum.hpp:40
Ring-size census of a polyhedral cage: size -> number of faces.
Definition cage.hpp:71