franzblau.hpp
Go to the documentation of this file.
Code
1//-----------------------------------------------------------------------------------
2// d-SEAMS - Deferred Structural Elucidation Analysis for Molecular Simulations
3//
4// Copyright (c) 2018--present d-SEAMS core team
5//
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the MIT License as published by
8// the Open Source Initiative.
9//
10// A copy of the MIT License is included in the LICENSE file of this repository.
11// You should have received a copy of the MIT License along with this program.
12// If not, see <https://opensource.org/licenses/MIT>.
13//-----------------------------------------------------------------------------------
14
15#ifndef __FRANZBLAU_H_
16#define __FRANZBLAU_H_
17
18#include <algorithm>
19#include <array>
20#include <fstream>
21#include <iostream>
22#include <iterator>
23#include <math.h>
24#include <memory>
25#include <sstream>
26#include <string>
27#include <sys/stat.h>
28#include <vector>
29
30#include <cage.hpp>
31#include <mol_sys.hpp>
32#include <seams_input.hpp>
33#include <seams_output.hpp>
34
77namespace primitive {
78
90struct Vertex {
92 std::vector<int> neighListIndex;
94 bool inGraph =
95 true;
96};
97
108struct Graph {
109 std::vector<Vertex> pts;
111 std::vector<std::vector<int>>
113};
114
119std::vector<std::vector<int>> ringNetwork(std::vector<std::vector<int>> nList,
120 int maxDepth);
121
127 std::vector<std::vector<int>> neighHbondList);
128
132Graph populateGraphFromIndices(std::vector<std::vector<int>> nList);
133
138 std::vector<std::vector<int>> nList);
139
141Graph countAllRingsFromIndex(std::vector<std::vector<int>> neighHbondList,
142 int maxDepth);
143
145Graph removeNonSPrings(Graph *fullGraph);
146
148int findRings(Graph *fullGraph, int v, std::vector<int> *visited, int maxDepth,
149 int depth, int root = -1);
150
152int shortestPath(Graph *fullGraph, int v, int goal, std::vector<int> *path,
153 std::vector<int> *visited, int maxDepth, int depth = 1);
154
156Graph clearGraph(Graph *currentGraph);
157
158} // namespace primitive
159
160#endif // __FRANZBLAU_H_
File for cage types for topological network criteria.
Graph countAllRingsFromIndex(std::vector< std::vector< int > > neighHbondList, int maxDepth)
Creates a vector of vectors of all possible rings.
Definition franzblau.cpp:64
Graph populateGraphFromIndices(std::vector< std::vector< int > > nList)
Graph populateGraphFromNListID(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int > > neighHbondList)
Graph removeNonSPrings(Graph *fullGraph)
Removes the non-SP rings, using the Franzblau shortest path criterion.
std::vector< int > neighListIndex
This is the index according to pointCloud.
Definition franzblau.hpp:92
std::vector< std::vector< int > > rings
Graph restoreEdgesFromIndices(Graph *fullGraph, std::vector< std::vector< int > > nList)
Graph clearGraph(Graph *currentGraph)
Function for clearing vectors in Graph after multiple usage.
int shortestPath(Graph *fullGraph, int v, int goal, std::vector< int > *path, std::vector< int > *visited, int maxDepth, int depth=1)
Calculates the shortest path.
int findRings(Graph *fullGraph, int v, std::vector< int > *visited, int maxDepth, int depth, int root=-1)
Main function that searches for all rings.
std::vector< Vertex > pts
std::vector< std::vector< int > > ringNetwork(std::vector< std::vector< int > > nList, int maxDepth)
Definition franzblau.cpp:32
The main molecular system handler.
Functions for generating primitive rings. This namespace contains struct definitions and functions th...
Definition franzblau.hpp:77
File for functions that read in files).
This contains a collection of points; contains information for a particular frame.
Definition mol_sys.hpp:170
This contains per-particle information.
Definition mol_sys.hpp:149
This is a per-frame object, containing all the vertices for the particular frame, along with the vect...
This is a collection of elements, for each point, required for graph traversal.
Definition franzblau.hpp:90