20 #include <boost/math/constants/constants.hpp>
22 #include <eigen3/Eigen/Core>
23 #include <eigen3/Eigen/Dense>
50 const double pi = boost::math::constants::pi<double>();
74 int n = (*input).size();
78 std::sort((*input).begin(), (*input).end());
83 median = 0.5 * ((*input)[n / 2] + (*input)[n / 2 - 1]);
86 median = (*input)[(n + 1) / 2 -
105 int iatom,
int jatom) {
110 dr[0] = fabs(yCloud->pts[iatom].x - yCloud->pts[jatom].x);
111 dr[1] = fabs(yCloud->pts[iatom].y - yCloud->pts[jatom].y);
112 dr[2] = fabs(yCloud->pts[iatom].z - yCloud->pts[jatom].z);
115 for (
int k = 0; k < 3; k++) {
117 dr[k] -= yCloud->box[k] * round(dr[k] / yCloud->box[k]);
118 r2 += pow(dr[k], 2.0);
141 dr[0] = fabs(yCloud->pts[iatom].x - singlePoint[0]);
142 dr[1] = fabs(yCloud->pts[iatom].y - singlePoint[1]);
143 dr[2] = fabs(yCloud->pts[iatom].z - singlePoint[2]);
146 for (
int k = 0; k < 3; k++) {
148 dr[k] -= yCloud->box[k] * round(dr[k] / yCloud->box[k]);
149 r2 += pow(dr[k], 2.0);
172 dr[0] = fabs(yCloud->pts[iatom].x - yCloud->pts[jatom].x);
173 dr[1] = fabs(yCloud->pts[iatom].y - yCloud->pts[jatom].y);
174 dr[2] = fabs(yCloud->pts[iatom].z - yCloud->pts[jatom].z);
177 for (
int k = 0; k < 3; k++) {
178 r2 += pow(dr[k], 2.0);
203 dr[0] = yCloud->pts[iatom].x - yCloud->pts[jatom].x;
204 dr[1] = yCloud->pts[iatom].y - yCloud->pts[jatom].y;
205 dr[2] = yCloud->pts[iatom].z - yCloud->pts[jatom].z;
208 for (
int k = 0; k < 3; k++) {
210 if (dr[k] < -box[k] * 0.5) {
211 dr[k] = dr[k] + box[k];
213 if (dr[k] >= box[k] * 0.5) {
214 dr[k] = dr[k] - box[k];
242 int jatomIndex,
double *x_i,
double *y_i,
double *z_i,
double *x_j,
243 double *y_j,
double *z_j);
270 while (iss >> number) {
284 while (iss >> number) {
297 return (stat(name.
c_str(), &buffer) == 0);
313 for (
int m = 0; m < 2 * l + 1; m++) {
314 v[m] = (1.0 / (double)neigh) * v[m];
double distance(molSys::PointCloud< molSys::Point< double >, double > *yCloud, int iatom, int jatom)
Inline generic function for obtaining the wrapped distance between two particles WITHOUT applying PBC...
std::vector< std::complex< double > > avgVector(std::vector< std::complex< double >> v, int l, int neigh)
std::array< double, 3 > relDist(molSys::PointCloud< molSys::Point< double >, double > *yCloud, int iatom, int jatom)
double eigenVecAngle(std::vector< double > OO, std::vector< double > OH)
Eigen function for getting the angle (in radians) between the O–O and O-H vectors.
double calcMedian(std::vector< double > *input)
Inline generic function for calculating the median given a vector of the values.
std::vector< int > tokenizerInt(std::string line)
Function for tokenizing line strings into a vector of ints.
double periodicDist(molSys::PointCloud< molSys::Point< double >, double > *yCloud, int iatom, int jatom)
Inline generic function for obtaining the unwrapped periodic distance between two particles,...
double unWrappedDistFromPoint(molSys::PointCloud< molSys::Point< double >, double > *yCloud, int iatom, std::vector< double > singlePoint)
bool file_exists(const std::string &name)
Function for checking if a file exists or not.
std::vector< std::string > tokenizer(std::string line)
Function for tokenizing line strings into words (strings) delimited by whitespace....
double angDistDegQuaternions(std::vector< double > quat1, std::vector< double > quat2)
int unwrappedCoordShift(molSys::PointCloud< molSys::Point< double >, double > *yCloud, int iatomIndex, int jatomIndex, double *x_i, double *y_i, double *z_i, double *x_j, double *y_j, double *z_j)
Shift particles (unwrapped coordinates)
double radDeg(double angle)
bool compareByAtomID(const molSys::Point< double > &a, const molSys::Point< double > &b)
int prettyPrintYoda(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::string outFile)
Generic function for printing all the struct information.
double getAverageWithoutOutliers(std::vector< double > inpVec)
Get the average, after excluding the outliers, using quartiles.
std::vector< double > tokenizerDouble(std::string line)
Function for tokenizing line strings into a vector of doubles.
The main molecular system handler.
Small generic functions that are shared by all namespaces.
This contains a collection of points; contains information for a particular frame.
This contains per-particle information.