Loading...
Searching...
No Matches
bop.hpp
Go to the documentation of this file.
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 SEAMS_BOP_H_
16#define SEAMS_BOP_H_
17
18#include <array>
19#include <cmath>
20#include <complex>
21#include <string>
22#include <generic.hpp>
23#include <mol_sys.hpp>
24#include <neighbours.hpp>
25#include <seams_output.hpp>
26
30
35
135
136namespace chill {
137
138// 2*l+1 length complex vector
146struct YlmAtom {
147 std::vector<std::complex<double>> ylm;
148};
149
150// Vector of 2*l+1 averaged over 4 nearest neighbours
167struct QlmAtom {
168 std::vector<YlmAtom> ptq; // Averaged over neighbours
169};
170
185
188[[nodiscard]] BondClassifier chillRule();
189
193
197[[nodiscard]] BondClassifier bondClassifier(const std::string &name);
198
201void registerBondClassifier(const std::string &name,
202 const BondClassifier &rule);
203
205[[nodiscard]] std::vector<std::string> bondClassifierNames();
206
211 const std::vector<std::vector<int>> &nList,
212 const BondClassifier &rule, bool isSlice = false);
213
229void
231 const std::vector<std::vector<int>> &nList, bool isSlice = false,
232 int coordinationNumber = 4);
233
241void
243 const std::vector<std::vector<int>> &nList, bool isSlice = false);
244
245// Classifies each atom according to the CHILL algorithm
258void
260 const std::vector<std::vector<int>> &nList, std::string path,
261 int firstFrame, bool isSlice = false,
262 std::string outputFileName = "chill.txt");
263
267void
269 const std::vector<std::vector<int>> &nList, bool isSlice = false,
270 int coordinationNumber = 4);
271
273void
275 const std::vector<std::vector<int>> &nList, std::string path,
276 int firstFrame, bool isSlice = false,
277 std::string outputFileName = "chillPlus.txt");
278
280void
283 const std::vector<std::vector<int>> &nList, bool isSlice = false);
284
287std::vector<double>
289 const std::vector<std::vector<int>> &nList, bool isSlice = false);
290
295void
297 std::vector<double> &q6);
298
300[[nodiscard]] int printIceType(molSys::PointCloud<molSys::Point<double>, double> &yCloud,
301 std::string path, int firstFrame, bool isSlice = false,
302 std::string outputFileName = "superChill.txt");
303
308 const std::vector<std::vector<int>> &nList, int iatom,
309 int num_staggrd, int num_eclipsd, bool chillPlus = false);
310
312[[nodiscard]] int numStaggered(molSys::PointCloud<molSys::Point<double>, double> &yCloud,
313 const std::vector<std::vector<int>> &nList, int jatom);
314
323 std::vector<double> ql;
324 std::vector<double> qlBar;
325};
326
333[[nodiscard]] SteinhardtQl
335 const std::vector<std::vector<int>> &nList, int orderL);
336
337} // namespace chill
338
350namespace sph {
351
352// 7 is for Q3, orderL=3
353
354std::vector<std::complex<double>>
355spheriHarmo(int orderL, std::array<double, 2> radialCoord);
356
357std::array<double, 2> radialCoord(std::array<double, 3> cartCoord);
358
360std::vector<std::complex<double>>
361lookupTableQ3Vec(std::array<double, 2> angles);
362
364std::complex<double> lookupTableQ3(int m, std::array<double, 2> angles);
365
367std::vector<std::complex<double>>
368lookupTableQ4Vec(std::array<double, 2> angles);
369
371std::complex<double> lookupTableQ4(int m, std::array<double, 2> angles);
372
374std::vector<std::complex<double>>
375lookupTableQ6Vec(std::array<double, 2> angles);
376
378std::vector<std::complex<double>>
379lookupTableQ8Vec(std::array<double, 2> angles);
380
382std::complex<double> lookupTableQ8(int m, std::array<double, 2> angles);
383
385std::complex<double> lookupTableQ6(int m, std::array<double, 2> angles);
386
387} // namespace sph
388
389#endif // SEAMS_BOP_H_
File for containing generic or common functions.
void getCorrelPlus(molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, bool isSlice=false, int coordinationNumber=4)
std::vector< std::complex< double > > lookupTableQ6Vec(std::array< double, 2 > angles)
Lookup table for Q6.
void getIceTypePlusNoPrint(molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, bool isSlice=false)
CHILL+ ice types on the cloud. Does not write a file.
double eclipsedMin
c_ij at or below this is staggered
Definition bop.hpp:180
std::vector< std::complex< double > > lookupTableQ3Vec(std::array< double, 2 > angles)
Lookup table for Q3.
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.
BondClassifier chillRule()
std::vector< double > ql
Definition bop.hpp:323
std::vector< std::complex< double > > ylm
Definition bop.hpp:147
void getCorrel(molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, bool isSlice=false, int coordinationNumber=4)
Function for getting the bond order correlations (or in some treatments) according to the CHILL alg...
std::vector< YlmAtom > ptq
Definition bop.hpp:168
std::vector< std::complex< double > > lookupTableQ4Vec(std::array< double, 2 > angles)
Lookup table for Q4.
std::array< double, 2 > radialCoord(std::array< double, 3 > cartCoord)
std::complex< double > lookupTableQ6(int m, std::array< double, 2 > angles)
Lookup table for Q6 (m=0 to m=12).
std::vector< std::string > bondClassifierNames()
Names of every registered rule set.
void getIceTypeNoPrint(molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, bool isSlice=false)
Function that classifies every particle's molSys::atom_state_type ice type, according to the CHILL al...
void classifyBonds(molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, const BondClassifier &rule, bool isSlice=false)
int coordinationNumber
Upper edge of the eclipsed band.
Definition bop.hpp:182
void getIceType(molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, std::string path, int firstFrame, bool isSlice=false, std::string outputFileName="chill.txt")
Function that classifies every particle's molSys::atom_state_type ice type, according to the CHILL al...
bool isInterfacial(molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, int iatom, int num_staggrd, int num_eclipsd, bool chillPlus=false)
std::vector< double > getq6(molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, bool isSlice=false)
std::vector< std::complex< double > > spheriHarmo(int orderL, std::array< double, 2 > radialCoord)
double eclipsedMax
Lower edge of the eclipsed band.
Definition bop.hpp:181
void reclassifyWater(molSys::PointCloud< molSys::Point< double >, double > &yCloud, std::vector< double > &q6)
int numStaggered(molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, int jatom)
Finds the number of staggered bonds for a given atom of index jatom.
BondClassifier chillPlusRule()
BondClassifier bondClassifier(const std::string &name)
std::complex< double > lookupTableQ8(int m, std::array< double, 2 > angles)
Lookup table for Q8 (m=0 to m=16).
std::complex< double > lookupTableQ3(int m, std::array< double, 2 > angles)
Lookup table for Q3 (m=0 to m=6).
std::vector< double > qlBar
Local .
Definition bop.hpp:324
SteinhardtQl steinhardtQl(const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList, int orderL)
std::vector< std::complex< double > > lookupTableQ8Vec(std::array< double, 2 > angles)
Lookup table for Q8.
void getIceTypePlus(molSys::PointCloud< molSys::Point< double >, double > &yCloud, const 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.
std::complex< double > lookupTableQ4(int m, std::array< double, 2 > angles)
Lookup table for Q4 (m=0 to m=8).
void registerBondClassifier(const std::string &name, const BondClassifier &rule)
The main molecular system handler.
CHILL and CHILL+ structure classification.
Definition bop.hpp:136
Functions used for spherical harmonics.
Definition bop.hpp:350
Header file for neighbour list generation.
One rule set for classifying bond correlations .
Definition bop.hpp:178
This is the local orientational bond order parameter , of length .
Definition bop.hpp:167
Per-particle Steinhardt order parameters of a single degree .
Definition bop.hpp:322
This contains a complex vector of length .
Definition bop.hpp:146
This contains a collection of points; contains information for a particular frame.
Definition mol_sys.hpp:173
This contains per-particle information.
Definition mol_sys.hpp:152