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 <vector>
14
27namespace cage {
28
30struct FoundCage {
32 std::vector<int> faces;
33 std::vector<int> vertices;
34 std::string certificate;
35 bool closed = true;
36 int danglingEdges = 0;
37};
38
41bool isClosedPolyhedron(const std::vector<std::vector<int>> &rings,
42 const std::vector<int> &faces);
43
49std::vector<FoundCage>
50findBySignature(const std::vector<std::vector<int>> &rings,
51 const Signature &signature);
52
54bool speciesCycleMatches(const std::vector<int> &cycle,
55 const std::vector<int> &pattern);
56
62std::vector<FoundCage>
63findBySignature(const std::vector<std::vector<int>> &rings,
64 const Signature &signature, const std::vector<int> &species,
65 const std::vector<std::vector<int>> &patterns);
66
69std::vector<FoundCage>
70findBySignature(const std::vector<std::vector<int>> &rings,
71 const std::vector<std::vector<int>> &nList,
72 const Signature &signature);
73
79std::vector<FoundCage>
80findIncompleteBySignature(const std::vector<std::vector<int>> &rings,
81 const Signature &signature, int minFaces);
82
86struct CageShape {
87 int nVertices = 0;
88 int status = 1;
89 double rmsd = -1.0;
90 std::string pointGroup;
91};
92
94std::vector<std::array<double, 3>>
95coordsOfVertices(const std::vector<std::array<double, 3>> &all,
96 const std::vector<int> &vertices);
97
99CageShape shapeOfVertices(const std::vector<std::array<double, 3>> &cageXyz);
100
103CageShape overlayVertices(const std::vector<std::array<double, 3>> &ref,
104 const std::vector<std::array<double, 3>> &cageXyz);
105
109struct FormerRow {
110 int index = -1;
111 int species = 0;
112 int coord = 0;
113 int homopolar = 0;
114 std::map<int, int> rings;
115};
116
118std::vector<FormerRow>
119formerRows(const std::vector<std::vector<int>> &nList,
120 const std::vector<std::vector<int>> &rings,
121 const std::vector<int> &species, int formerSpecies);
122
125bool sameNetwork(const std::vector<FormerRow> &early,
126 const std::vector<FormerRow> &late);
127
128} // namespace cage
129
130#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,...
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.
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.
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.
IRA/SOFI result for one cage.
Definition cage_enum.hpp:86
std::string pointGroup
Definition cage_enum.hpp:90
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:30
std::vector< int > faces
ring indices into the input vector
Definition cage_enum.hpp:32
Signature signature
Definition cage_enum.hpp:31
std::string certificate
nauty hex, empty when nauty is off
Definition cage_enum.hpp:34
int danglingEdges
edges used once (cups / incomplete)
Definition cage_enum.hpp:36
bool closed
every face edge used twice
Definition cage_enum.hpp:35
std::vector< int > vertices
sorted unique atom indices
Definition cage_enum.hpp:33
Ring-size census of a polyhedral cage: size -> number of faces.
Definition cage.hpp:71