53 {
54
55 auto result =
parse(argc, argv);
56 auto &arguments = result.arguments();
57
58 YAML::Node config = YAML::LoadFile(result["c"].as<std::string>());
59
60 std::string script, tFile;
61
62 sol::state lua;
63
64 lua.open_libraries();
65
66 if (config["trajectory"]) {
67 tFile = config["trajectory"].as<std::string>();
68 }
69
70 std::string vars = config["variables"].as<std::string>();
71
72
73 if (config["topoTwoDim"]["use"].as<bool>()) {
74
75 lua.script_file(vars);
76
77
78
79
81
82 std::vector<std::vector<int>> nList, hbnList;
83
84 std::vector<std::vector<int>> ringsAllSizes;
85 std::vector<std::vector<int>> rings;
86
87 std::vector<double> rdfValues;
88
89
90
91 auto lscript = lua.get<std::string>("functionScript");
92
93 lua["doBOP"] = config["bulk"]["use"].as<bool>();
94 lua["topoOneDim"] = config["topoOneDim"]["use"].as<bool>();
95 lua["topoTwoDim"] = config["topoTwoDim"]["use"].as<bool>();
96 lua["topoBulk"] = config["bulk"]["use"].as<bool>();
97
98 lua["nList"] = &nList;
99 lua["hbnList"] = &hbnList;
100 lua["resCloud"] = &resCloud;
101 lua["trajectory"] = tFile;
102
103 lua["ringsAllSizes"] = &rings;
104
105 lua["rdf"] = &rdfValues;
106
107
108
109
110
114
115
116
119
120
122
123
125
126
128
129
130 lua.script_file(lscript);
131
132
133 }
134
135
136 if (config["topoOneDim"]["use"].as<bool>()) {
137
138 lua.script_file(vars);
139
140
141
142
146
147 std::vector<std::vector<int>> nList, hbnList;
148
149 std::vector<std::vector<int>> ringsAllSizes;
150 std::vector<std::vector<int>> rings;
151 int atomID;
152
153
154
155 auto lscript = lua.get<std::string>("functionScript");
156
157 lua["doBOP"] = config["bulk"]["use"].as<bool>();
158 lua["topoOneDim"] = config["topoOneDim"]["use"].as<bool>();
159 lua["topoTwoDim"] = config["topoTwoDim"]["use"].as<bool>();
160 lua["topoBulk"] = config["bulk"]["use"].as<bool>();
161
162 lua["nList"] = &nList;
163 lua["hbnList"] = &hbnList;
164 lua["resCloud"] = &resCloud;
165 lua["oCloud"] = &oCloud;
166 lua["hCloud"] = &hCloud;
167 lua["trajectory"] = tFile;
168
169 lua["ringsAllSizes"] = &rings;
170 lua["lowestAtomID"] = &atomID;
171
172
173
174
178
179
180
183
184
186
187
189
190
191 lua.script_file(lscript);
192
193
194 }
195
196
197 if (config["bulk"]["use"].as<bool>()) {
198
199 lua.script_file(vars);
200
201
202
204
206
207 std::vector<std::vector<int>> nList,
208 hbnList;
209
210 std::vector<std::vector<int>>
211 iceList;
212
213 std::vector<double> avgQ6;
214
215 std::vector<std::vector<int>> ringsAllSizes;
216 std::vector<std::vector<int>> rings;
217
218
219
220
221
222 auto lscript = lua.get<std::string>("functionScript");
223
224 lua["doBOP"] = config["bulk"]["bondOrderParameters"].as<bool>();
225 lua["topoOneDim"] = config["topoOneDim"]["use"].as<bool>();
226 lua["topoTwoDim"] = config["topoTwoDim"]["use"].as<bool>();
227 lua["topoBulk"] = config["bulk"]["topologicalNetworkCriterion"].as<bool>();
228
229 lua["nList"] = &nList;
230 lua["hbnList"] = &hbnList;
231 lua["iceNeighbourList"] = &iceList;
232 lua["resCloud"] = &resCloud;
233 lua["oCloud"] = &oCloud;
234 lua["hCloud"] = &hCloud;
235 lua["clusterCloud"] = &solCloud;
236 lua["avgQ6"] = &avgQ6;
237 lua["trajectory"] = tFile;
238
239 lua["ringsAllSizes"] = &rings;
240
241
242
245
248
251
254
258
261
262
263
268
269
270
276
277
279
281
282
284
285
286
288
289
290 lua.script_file(lscript);
291
292
293 }
294
295
296 std::cout << rang::style::bold
297 << fmt::format("Welcome to the Black Parade.\nYou ran:-\n")
298 << rang::style::reset
299 << fmt::format("\nBulk Ice Analysis: {}",
300 config["bulk"]["use"].as<bool>())
301 << fmt::format("\nQuasi-one-dimensional Ice Analysis: {}",
302 config["topoOneDim"]["use"].as<bool>())
303 << fmt::format("\nQuasi-two-dimensional Ice Analysis: {}",
304 config["topoTwoDim"]["use"].as<bool>())
305 << "\n";
306
307 return 0;
308}
std::vector< std::vector< int > > populateHbonds(std::string filename, molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int > > nList, int targetFrame, int Htype)
std::vector< std::vector< int > > populateHbondsWithInputClouds(molSys::PointCloud< molSys::Point< double >, double > *yCloud, molSys::PointCloud< molSys::Point< double >, double > *hCloud, std::vector< std::vector< int > > nList)
molSys::PointCloud< molSys::Point< double >, double > getIceType(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int > > nList, std::string path, int firstFrame, bool isSlice=false, std::string outputFileName="chill.txt")
Classifies each atom 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.
molSys::PointCloud< molSys::Point< double >, double > getCorrelPlus(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int > > nList, bool isSlice=false)
Gets c_ij and then classifies bond types according to the CHILL+ algorithm.
molSys::PointCloud< molSys::Point< double >, double > getCorrel(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int > > nList, bool isSlice=false)
molSys::PointCloud< molSys::Point< double >, double > reclassifyWater(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< double > *q6)
std::vector< double > getq6(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int > > nList, bool isSlice=false)
molSys::PointCloud< molSys::Point< double >, double > getIceTypePlus(molSys::PointCloud< molSys::Point< double >, double > *yCloud, 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.
int recenterClusterCloud(molSys::PointCloud< molSys::Point< double >, double > *iceCloud, std::vector< std::vector< int > > nList)
Recenters the coordinates of a pointCloud.
int clusterAnalysis(std::string path, molSys::PointCloud< molSys::Point< double >, double > *iceCloud, molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int > > nList, std::vector< std::vector< int > > &iceNeighbourList, double cutoff, int firstFrame, std::string bopAnalysis="q6")
std::vector< std::vector< int > > neighbourListByIndex(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int > > nList)
std::vector< std::vector< int > > neighListO(double rcutoff, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int typeI)
std::vector< std::vector< int > > ringNetwork(std::vector< std::vector< int > > nList, int maxDepth)
int topoBulkAnalysis(std::string path, std::vector< std::vector< int > > rings, std::vector< std::vector< int > > nList, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int firstFrame, bool onlyTetrahedral=true)
int bulkPolygonRingAnalysis(std::string path, std::vector< std::vector< int > > rings, std::vector< std::vector< int > > nList, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int maxDepth, int firstFrame)
int rdf2Danalysis_AA(std::string path, std::vector< double > *rdfValues, molSys::PointCloud< molSys::Point< double >, double > *yCloud, double cutoff, double binwidth, int firstFrame, int finalFrame)
int topoUnitMatchingBulk(std::string path, std::vector< std::vector< int > > rings, std::vector< std::vector< int > > nList, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int firstFrame, bool printClusters, bool onlyTetrahedral)
molSys::PointCloud< molSys::Point< double >, double > getPointCloudOneAtomType(molSys::PointCloud< molSys::Point< double >, double > *yCloud, molSys::PointCloud< molSys::Point< double >, double > *outCloud, int atomTypeI, bool isSlice=false, std::array< double, 3 > coordLow=std::array< double, 3 >{0, 0, 0}, std::array< double, 3 > coordHigh=std::array< double, 3 >{0, 0, 0})
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)
void getEdgeMoleculesInRings(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 prismAnalysis(std::string path, std::vector< std::vector< int > > rings, std::vector< std::vector< int > > nList, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int maxDepth, int *atomID, int firstFrame, int currentFrame, bool doShapeMatching=false)
void moleculesInSingleSlice(molSys::PointCloud< molSys::Point< double >, double > *yCloud, bool clearPreviousSliceSelection=true, std::array< double, 3 > coordLow=std::array< double, 3 >{0, 0, 0}, std::array< double, 3 > coordHigh=std::array< double, 3 >{0, 0, 0})
void printSliceGetEdgeMoleculesInRings(std::string path, 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)
molSys::PointCloud< molSys::Point< double >, double > readLammpsTrj(std::string filename, int targetFrame, molSys::PointCloud< molSys::Point< double >, double > *yCloud, bool isSlice=false, std::array< double, 3 > coordLow=std::array< double, 3 >{0, 0, 0}, std::array< double, 3 > coordHigh=std::array< double, 3 >{0, 0, 0})
molSys::PointCloud< molSys::Point< double >, double > readLammpsTrjreduced(std::string filename, int targetFrame, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int typeI, bool isSlice=false, std::array< double, 3 > coordLow=std::array< double, 3 >{0, 0, 0}, std::array< double, 3 > coordHigh=std::array< double, 3 >{0, 0, 0})
molSys::PointCloud< molSys::Point< double >, double > readLammpsTrjO(std::string filename, int targetFrame, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int typeO, bool isSlice=false, std::array< double, 3 > coordLow=std::array< double, 3 >{0, 0, 0}, std::array< double, 3 > coordHigh=std::array< double, 3 >{0, 0, 0})
int writeHisto(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int > > nList, std::vector< double > avgQ6)
int writeDump(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::string path, std::string outFile)
Generic function for writing out to a dump file.
cxxopts::ParseResult parse(int argc, char *argv[])
This contains a collection of points; contains information for a particular frame.