24 #include <boost/math/constants/constants.hpp>
27 #include <Eigen/Dense>
54 const double pi = boost::math::constants::pi<double>();
78 int n = (*input).size();
82 std::sort((*input).begin(), (*input).end());
87 median = 0.5 * ((*input)[n / 2] + (*input)[n / 2 - 1]);
90 median = (*input)[(n + 1) / 2 -
109 int iatom,
int jatom) {
114 dr[0] = fabs(yCloud->pts[iatom].x - yCloud->pts[jatom].x);
115 dr[1] = fabs(yCloud->pts[iatom].y - yCloud->pts[jatom].y);
116 dr[2] = fabs(yCloud->pts[iatom].z - yCloud->pts[jatom].z);
119 for (
int k = 0; k < 3; k++) {
121 dr[k] -= yCloud->box[k] * round(dr[k] / yCloud->box[k]);
122 r2 += pow(dr[k], 2.0);
145 dr[0] = fabs(yCloud->pts[iatom].x - singlePoint[0]);
146 dr[1] = fabs(yCloud->pts[iatom].y - singlePoint[1]);
147 dr[2] = fabs(yCloud->pts[iatom].z - singlePoint[2]);
150 for (
int k = 0; k < 3; k++) {
152 dr[k] -= yCloud->box[k] * round(dr[k] / yCloud->box[k]);
153 r2 += pow(dr[k], 2.0);
176 dr[0] = fabs(yCloud->pts[iatom].x - yCloud->pts[jatom].x);
177 dr[1] = fabs(yCloud->pts[iatom].y - yCloud->pts[jatom].y);
178 dr[2] = fabs(yCloud->pts[iatom].z - yCloud->pts[jatom].z);
181 for (
int k = 0; k < 3; k++) {
182 r2 += pow(dr[k], 2.0);
207 dr[0] = yCloud->pts[iatom].x - yCloud->pts[jatom].x;
208 dr[1] = yCloud->pts[iatom].y - yCloud->pts[jatom].y;
209 dr[2] = yCloud->pts[iatom].z - yCloud->pts[jatom].z;
212 for (
int k = 0; k < 3; k++) {
214 if (dr[k] < -box[k] * 0.5) {
215 dr[k] = dr[k] + box[k];
217 if (dr[k] >= box[k] * 0.5) {
218 dr[k] = dr[k] - box[k];
246 int jatomIndex,
double *x_i,
double *y_i,
double *z_i,
double *x_j,
247 double *y_j,
double *z_j);
274 while (iss >> number) {
288 while (iss >> number) {
301 return (stat(name.
c_str(), &buffer) == 0);
317 for (
int m = 0; m < 2 * l + 1; m++) {
318 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.