topoparam Namespace Reference

Functions

double normHeightPercent (molSys::PointCloud< molSys::Point< double >, double > *yCloud, int nPrisms, double avgPrismHeight)
 
std::vector< double > calcCoverageArea (molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int >> rings, double sheetArea)
 
std::vector< double > projAreaSingleRing (molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< int > ring)
 Calculates the projected area on the XY, YZ and XZ planes. More...
 

Function Documentation

◆ calcCoverageArea()

std::vector< double > topoparam::calcCoverageArea ( molSys::PointCloud< molSys::Point< double >, double > *  yCloud,
std::vector< std::vector< int >>  rings,
double  sheetArea 
)

Calculates the coverage area%, an area-based measure of relative proportion of monolayer ices.

The average height of prism blocks remains relatively constant. We have observed a average prism heights of 2.7-2.85 Angstrom for prisms irrespective of the number of nodes. The equation is given by:

\[ Height_{n}% = \frac{N_n}{N_{max}} \times 100 \]

Here, \(N_{max} = H_{SWCT}/h_{avg}f$ and \)N_{n}$ is the number of prism blocks for n-sided prismatic phase.

This means that the normalization factor, is the same for every node number \(n\).

Definition at line 70 of file order_parameter.cpp.

72  {
73  //
74  double areaXY, areaXZ, areaYZ; // Total coverage area
75  std::vector<double> singleAreas; // Area of single rings
76 
77  // ---------------------------------------
78  // Initialization
79  areaXY = 0.0;
80  areaXZ = 0.0;
81  areaYZ = 0.0;
82  // ---------------------------------------
83  // Loop through all the rings
84  for (int iring = 0; iring < rings.size(); iring++) {
85  // Get the coverage area for the current ring
86  singleAreas = topoparam::projAreaSingleRing(yCloud, rings[iring]);
87  // Add these to the total coverage area
88  areaXY += singleAreas[0];
89  areaXZ += singleAreas[1];
90  areaYZ += singleAreas[2];
91  } // end of loop through all the rings
92  // ---------------------------------------
93  // Normalize the coverage area by the sheet area
94  areaXY = areaXY / sheetArea * 100.0;
95  areaXZ = areaXZ / sheetArea * 100.0;
96  areaYZ = areaYZ / sheetArea * 100.0;
97 
98  return {areaXY, areaXZ, areaYZ};
99 }
std::vector< double > projAreaSingleRing(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< int > ring)
Calculates the projected area on the XY, YZ and XZ planes.
T size(T... args)

◆ normHeightPercent()

double topoparam::normHeightPercent ( molSys::PointCloud< molSys::Point< double >, double > *  yCloud,
int  nPrisms,
double  avgPrismHeight 
)

Calculates the height%, an average measure of filled volume. The average height of a prism can be taken to be 2.75-2.85 Angstrom. (Koga et. al., 2001)

The average height of prism blocks remains relatively constant. We have observed a average prism heights of 2.7-2.85 Angstrom for prisms irrespective of the number of nodes. The equation is given by:

\[ Height_{n}% = \frac{N_n}{N_{max}} \times 100 \]

Here, \(N_{max} = H_{SWCT}/h_{avg}f$ and \)N_{n}$ is the number of prism blocks for n-sided prismatic phase.

This means that the normalization factor, is the same for every node number \(n\).

Definition at line 32 of file order_parameter.cpp.

34  {
35  //
36  double hPercent; // Normalized height percent
37  double nanoTubeHeight; // Height of the SWCT
38  double numberMax; // Maximum number possible, given the average prism height
39 
40  // ---------------------------------------
41  // Calculate the height of the SWCT
42  // This is the longest dimension of the simulation box
43  nanoTubeHeight = *max_element(yCloud->box.begin(), yCloud->box.end());
44  // ---------------------------------------
45  // Calculate the maximum possible height, given the average prism height
46  // and the height of the nanotube
47  numberMax = nanoTubeHeight / avgPrismHeight;
48  // ---------------------------------------
49  // Calculate the normalized height percentage
50  hPercent = nPrisms / numberMax * 100.0;
51 
52  return hPercent;
53 }
std::vector< T > box
Number of atoms.
Definition: mol_sys.hpp:174
T max_element(T... args)

◆ projAreaSingleRing()

std::vector< double > topoparam::projAreaSingleRing ( molSys::PointCloud< molSys::Point< double >, double > *  yCloud,
std::vector< int >  ring 
)

Calculates the projected area on the XY, YZ and XZ planes.

Calculates the coverage area/ projected area of a single ring given the ring and the PointCloud.

Definition at line 105 of file order_parameter.cpp.

107  {
108  //
109  int iatomIndex, jatomIndex; // Atom indices of the i^th and j^th atoms
110  int ringSize = ring.size(); // Number of nodes in the ring
111  double areaXY, areaXZ, areaYZ;
112  double x_iatom, y_iatom, z_iatom; // Coordinates of iatom
113  double x_jatom, y_jatom, z_jatom; // Coordinates of jatom
114  // ----------------------------------------
115  // Calculate projected area onto the XY, YZ and XZ planes for basal1
116 
117  // Init the projected area
118  areaXY = 0.0;
119  areaXZ = 0.0;
120  areaYZ = 0.0;
121 
122  jatomIndex = ring[0];
123 
124  // All points except the first pair
125  for (int k = 1; k < ringSize; k++) {
126  iatomIndex = ring[k]; // Current vertex
127 
128  // --------------------------------------------------------------------
129  // SHIFT PARTICLES TEMPORARILY (IN CASE OF UNWRAPPED COORDINATES)
130  gen::unwrappedCoordShift(yCloud, iatomIndex, jatomIndex, &x_iatom, &y_iatom,
131  &z_iatom, &x_jatom, &y_jatom, &z_jatom);
132  // --------------------------------------------------------------------
133 
134  // Add to the polygon area
135  // ------
136  // XY plane
137  areaXY += (x_jatom + x_iatom) * (y_jatom - y_iatom);
138  // ------
139  // XZ plane
140  areaXZ += (x_jatom + x_iatom) * (z_jatom - z_iatom);
141  // ------
142  // YZ plane
143  areaYZ += (y_jatom + y_iatom) * (z_jatom - z_iatom);
144  // ------
145  jatomIndex = iatomIndex;
146  }
147 
148  // Closure point
149  iatomIndex = ring[0];
150  // Unwrapped coordinates needed
151  gen::unwrappedCoordShift(yCloud, iatomIndex, jatomIndex, &x_iatom, &y_iatom,
152  &z_iatom, &x_jatom, &y_jatom, &z_jatom);
153  // ------
154  // XY plane
155  areaXY += (x_jatom + x_iatom) * (y_jatom - y_iatom);
156  // ------
157  // XZ plane
158  areaXZ += (x_jatom + x_iatom) * (z_jatom - z_iatom);
159  // ------
160  // YZ plane
161  areaYZ += (y_jatom + y_iatom) * (z_jatom - z_iatom);
162  // ------
163  // The actual projected area is half of this
164  areaXY *= 0.5;
165  areaXZ *= 0.5;
166  areaYZ *= 0.5;
167 
168  // Absolute area
169  areaXY = fabs(areaXY);
170  areaXZ = fabs(areaXZ);
171  areaYZ = fabs(areaYZ);
172 
173  return {areaXY, areaYZ, areaXZ};
174 }
T fabs(T... args)
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)
Definition: generic.cpp:71
Topological network criteria functions.
Definition: ring.hpp:64