30 outputFile.
open(outFile);
34 outputFile <<
"# Frame\tAtomID\tx\ty\tz\tcij\ticeType\n";
36 for (
int i = 0; i < yCloud->nop; i++) {
37 outputFile << yCloud->currentFrame <<
"\t" << yCloud->pts[i].atomID
38 <<
"\t" << yCloud->pts[i].x <<
"\t" << yCloud->pts[i].y <<
"\t"
39 << yCloud->pts[i].z <<
"\t";
44 outputFile << static_cast<int>(yCloud->pts[i].iceType) <<
"\n";
73 int jatomIndex,
double *x_i,
double *y_i,
double *z_i,
double *x_j,
74 double *y_j,
double *z_j) {
76 double x_iatom, y_iatom, z_iatom;
77 double x_jatom, y_jatom, z_jatom;
78 double x_ij, y_ij, z_ij;
80 double xPBC, yPBC, zPBC;
85 x_iatom = yCloud->pts[iatomIndex].x;
86 y_iatom = yCloud->pts[iatomIndex].y;
87 z_iatom = yCloud->pts[iatomIndex].z;
89 x_jatom = yCloud->pts[jatomIndex].x;
90 y_jatom = yCloud->pts[jatomIndex].y;
91 z_jatom = yCloud->pts[jatomIndex].z;
94 x_ij = x_iatom - x_jatom;
95 y_ij = y_iatom - y_jatom;
96 z_ij = z_iatom - z_jatom;
100 if (fabs(x_ij) > 0.5 * box[0]) {
102 xPBC = box[0] - fabs(x_ij);
104 x_jatom = x_iatom - xPBC;
107 x_jatom = x_iatom + xPBC;
112 if (fabs(y_ij) > 0.5 * box[1]) {
114 yPBC = box[1] - fabs(y_ij);
116 y_jatom = y_iatom - yPBC;
119 y_jatom = y_iatom + yPBC;
124 if (fabs(z_ij) > 0.5 * box[2]) {
126 zPBC = box[2] - fabs(z_ij);
128 z_jatom = z_iatom - zPBC;
131 z_jatom = z_iatom + zPBC;
156 Eigen::Vector3d eigOO = Eigen::Map<Eigen::Vector3d>(OO.
data(), OO.
size());
157 Eigen::Vector3d eigOH = Eigen::Map<Eigen::Vector3d>(OH.
data(), OH.
size());
159 angle = acos(eigOO.dot(eigOH) / (eigOO.norm() * eigOH.norm()));
173 int n = inpVec.
size();
176 double firstQuartile, thirdQuartile;
178 double outlierLimLow, outlierLimHigh;
179 int numOfObservations = 0;
187 for (
int i = 0; i < n / 2; i++) {
196 int halfN = (n + 1) / 2;
198 for (
int i = 0; i < halfN; i++) {
213 iqr = thirdQuartile - firstQuartile;
221 outlierLimLow = firstQuartile - 1.5 * iqr;
222 outlierLimHigh = thirdQuartile + 1.5 * iqr;
225 for (
int i = 0; i < n; i++) {
227 if (inpVec[i] < outlierLimLow) {
230 else if (inpVec[i] > outlierLimHigh) {
242 avgVal /= numOfObservations;
245 if (numOfObservations == 0) {
248 for (
int i = 0; i <= n; i++) {
273 prod = quat1[0] * quat2[0] - quat1[1] * quat2[1] - quat1[2] * quat2[2] -
276 double angDist = 2 * acos(prod) * 180.0 / (
gen::pi);
File for containing generic or common functions.
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.
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)
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.
This contains a collection of points; contains information for a particular frame.
This contains per-particle information.