28 int ringSize = rings[0].
size();
30 bool padAtoms =
false;
37 if (rings.size() == 0) {
43 const char *path =
"../output";
53 total_size = rings.size() * ringSize;
57 for (
int iring = 0; iring < rings.size(); iring++) {
58 std::move(rings[iring].begin(), rings[iring].end(),
70 if (atoms.
size() != yCloud->nop) {
75 outputFile.
open(
"../output/" + filename);
105 outputFile <<
"Written out by D-SEAMS\n";
107 outputFile << atoms[atoms.
size() - 1] <<
" "
111 outputFile << bonds.size() <<
" bonds"
113 outputFile <<
"0 angles\n0 dihedrals\n0 impropers\n";
116 outputFile <<
"2 atom types\n";
118 outputFile <<
"1 atom types\n";
121 <<
"1 bond types\n0 angle types\n0 dihedral types\n0 improper types\n";
123 outputFile <<
"0 " << yCloud->box[0] <<
" xlo xhi\n";
124 outputFile <<
"0 " << yCloud->box[1] <<
" ylo yhi\n";
125 outputFile <<
"0 " << yCloud->box[2] <<
" zlo zhi\n";
127 outputFile <<
"\nMasses\n\n";
128 outputFile <<
"1 15.999400 # O\n";
130 outputFile <<
"2 1.0 # dummy\n";
133 outputFile <<
"\nAtoms\n\n";
137 for (
int i = 0; i < atoms.
size(); i++) {
138 iatom = atoms[i] - 1;
142 if (atoms[i] != prevAtomID + 1) {
143 dummyAtoms = atoms[i] - prevAtomID - 1;
144 dummyID = prevAtomID;
146 for (
int j = 0; j < dummyAtoms; j++) {
150 outputFile << dummyID <<
" " << yCloud->pts[jatom].molID <<
" 2 0 "
151 << yCloud->pts[jatom].x <<
" " << yCloud->pts[jatom].y <<
" "
152 << yCloud->pts[jatom].z <<
"\n";
158 outputFile << atoms[i] <<
" " << yCloud->pts[iatom].molID <<
" 1 0 "
159 << yCloud->pts[iatom].x <<
" " << yCloud->pts[iatom].y <<
" "
160 << yCloud->pts[iatom].z <<
"\n";
162 prevAtomID = atoms[i];
166 outputFile <<
"\nBonds\n\n";
168 for (
int ibond = 0; ibond < bonds.size(); ibond++) {
169 outputFile << ibond + 1 <<
" 1 " << bonds[ibond][0] <<
" "
170 << bonds[ibond][1] <<
"\n";
187 const char *path =
"../output";
194 outputFile.
open(
"../output/" + filename);
199 for (
int iring = 0; iring < rings.size(); iring++) {
201 for (
int k = 0; k < rings[iring].size(); k++) {
202 outputFile << rings[iring][k] <<
" ";
228 const char *path =
"../output/prisms";
235 outputFile.
open(
"../output/prisms/" + filename);
241 for (
int iring = 0; iring < ringSize; iring++) {
242 iatomIndex = (*basal1)[iring];
244 outputFile << yCloud->pts[iatomIndex].x <<
" ";
245 outputFile << yCloud->pts[iatomIndex].y <<
" ";
246 outputFile << yCloud->pts[iatomIndex].z <<
" ";
252 for (
int iring = 0; iring < ringSize; iring++) {
253 iatomIndex = (*basal2)[iring];
255 outputFile << yCloud->pts[iatomIndex].x <<
" ";
256 outputFile << yCloud->pts[iatomIndex].y <<
" ";
257 outputFile << yCloud->pts[iatomIndex].z <<
" ";
266 outputFile.
open(
"../output/prisms/singleRing.dat");
268 for (
int iring = 0; iring < ringSize; iring++) {
269 iatomIndex = (*basal1)[iring];
271 outputFile << yCloud->pts[iatomIndex].x <<
" ";
272 outputFile << yCloud->pts[iatomIndex].y <<
" ";
273 outputFile << yCloud->pts[iatomIndex].z <<
" ";
295 int totalCages = (*cageList).size();
300 if (totalCages == 0) {
301 std::cerr <<
"There are no cages to print.\n";
311 for (
int icage = 0; icage < totalCages; icage++) {
312 type = (*cageList)[icage].type;
335 std::cerr <<
"The cage is of the wrong type\n";
363 strcpy(cageChar,
"../output/cages/hexCages");
364 actualCageType =
"hexCages";
366 strcpy(cageChar,
"../output/cages/doubleDiaCages");
367 actualCageType =
"doubleDiaCages";
370 std::cerr <<
"The cage is of the wrong type. Exit\n";
376 const char *path =
"../output/cages";
384 const fs::path path1(cageChar);
389 "../output/cages/" + actualCageType +
"/" + filename;
390 outputFile.
open(fileOutNameFull);
399 for (
int i = 0; i < 2; i++) {
400 iring = currentCage[i];
402 for (
int j = 0; j < ringSize; j++) {
403 iatomIndex = rings[iring][j] - 1;
405 outputFile << yCloud->pts[iatomIndex].x <<
" ";
406 outputFile << yCloud->pts[iatomIndex].y <<
" ";
407 outputFile << yCloud->pts[iatomIndex].z <<
" ";
416 for (
int i = 0; i < currentCage.
size(); i++) {
417 iring = currentCage[i];
419 for (
int j = 0; j < ringSize; j++) {
420 iatomIndex = rings[iring][j] - 1;
422 outputFile << yCloud->pts[iatomIndex].x <<
" ";
423 outputFile << yCloud->pts[iatomIndex].y <<
" ";
424 outputFile << yCloud->pts[iatomIndex].z <<
" ";
446 std::string filename =
"basalRings" + number +
".dat";
478 const char *path =
"../output/cages";
486 const fs::path path1(
"../output/cages/hexBasalRings");
490 std::string fileOutNameFull =
"../output/cages/hexBasalRings/" + filename;
491 outputFile.
open(fileOutNameFull);
496 outputFile <<
"# Particle IDs in the two basal rings\n";
500 basal1 = rings[currentCage[0]];
501 unOrderedBasal2 = rings[currentCage[1]];
503 for (
int i = 0; i < basal1.
size(); i++) {
508 for (
int k = 0; k < unOrderedBasal2.
size(); k++) {
516 for (
int n = 1; n < nList[iatom - 1].size(); n++) {
517 natom = nList[iatom - 1][n];
519 if (findAtom == natom) {
543 for (
int i = 0; i < 2; i++) {
544 if (basal2[i] != 0) {
552 for (
int i = 0; i < unOrderedBasal2.
size(); i++) {
553 if (unOrderedBasal2[i] == needle) {
561 nextElement = startHayStack + 2;
562 if (nextElement >= ringSize) {
563 nextElement -= ringSize;
570 if (basal2[startNeedle + 2] == unOrderedBasal2[nextElement]) {
573 for (
int i = 1; i < ringSize; i += 2) {
574 iatom = startNeedle + i;
575 jatom = startHayStack + i;
577 if (iatom >= ringSize) {
580 if (jatom >= ringSize) {
584 basal2[iatom] = unOrderedBasal2[jatom];
596 iatom = startNeedle + 2;
597 jatom = startHayStack - 2;
602 if (basal2[iatom] == unOrderedBasal2[jatom]) {
604 for (
int i = 1; i < ringSize; i += 2) {
605 iatom = startNeedle + i;
606 jatom = startHayStack - i;
608 if (iatom > ringSize) {
615 basal2[iatom] = unOrderedBasal2[jatom];
619 std::cerr <<
"Something is wrong with your HCs.\n";
630 for (
int i = 0; i < basal1.
size(); i++) {
631 outputFile << basal1[i] <<
" ";
636 for (
int i = 0; i < basal2.
size(); i++) {
637 outputFile << basal2[i] <<
" ";
657 std::string filename =
"basalRings" + number +
".dat";
664 int currentIatom, currentJatom;
675 const char *path =
"../output/deformed";
683 const fs::path path1(
"../output/deformed/basalRings");
687 std::string fileOutNameFull =
"../output/deformed/basalRings/" + filename;
688 outputFile.
open(fileOutNameFull);
691 const char *path =
"../output/perfect";
699 const fs::path path1(
"../output/perfect/basalRings");
703 std::string fileOutNameFull =
"../output/perfect/basalRings/" + filename;
704 outputFile.
open(fileOutNameFull);
710 outputFile <<
"# Particle IDs in the two basal rings\n";
718 for (
int l = 0; l < ringSize; l++) {
723 for (
int m = 0; m < ringSize; m++) {
727 auto it =
std::find(nList[l_k].begin() + 1, nList[l_k].end(), m_k);
730 if (it != nList[l_k].end()) {
745 std::cerr <<
"Something is wrong with your deformed prism.\n";
754 int tempJfor, tempJback;
756 tempJfor = jatom + 1;
757 tempJback = jatom - 1;
759 if (jatom == ringSize - 1) {
761 tempJback = ringSize - 2;
765 tempJback = ringSize - 1;
768 int forwardJ = (*basal2)[tempJfor];
769 int backwardJ = (*basal2)[tempJback];
770 int currentI = (*basal1)[iatom];
777 if (distClock < distAntiClock) {
781 if (distAntiClock < distClock) {
785 if (isClock ==
false && isAntiClock ==
false) {
791 for (
int i = 0; i < ringSize; i++) {
792 currentIatom = iatom + i;
793 if (currentIatom >= ringSize) {
794 currentIatom -= ringSize;
799 currentJatom = jatom + i;
800 if (currentJatom >= ringSize) {
801 currentJatom -= ringSize;
805 currentJatom = jatom - i;
806 if (currentJatom < 0) {
807 currentJatom += ringSize;
812 matchedBasal1.
push_back((*basal1)[currentIatom]);
813 matchedBasal2.
push_back((*basal2)[currentJatom]);
821 for (
int i = 0; i < matchedBasal1.
size(); i++) {
822 outputFile << matchedBasal1[i] <<
" ";
827 for (
int i = 0; i < matchedBasal2.
size(); i++) {
828 outputFile << matchedBasal2[i] <<
" ";
841 int largestCluster,
int numOfClusters,
842 int smallestCluster,
double avgClusterSize,
850 outputFile.
open(path +
"clusterStats.dat",
851 std::ios_base::app | std::ios_base::out);
859 if (currentFrame == firstFrame) {
860 outputFile <<
"Frame largestCluster numOfClusters smallestCluster "
865 outputFile << currentFrame <<
" " << largestCluster <<
" " << numOfClusters
866 <<
" " << smallestCluster <<
" " << avgClusterSize <<
"\n";
884 int prevElem, currentElem;
885 int lastPrintedElemSeries;
893 outputFile.
open(path +
"selection/IDtextFiles/" + filename);
898 for (
int iatom = 0; iatom < yCloud->nop; iatom++)
901 if (yCloud->pts[iatom].inSlice)
903 idVec.
push_back(yCloud->pts[iatom].molID);
920 outputFile <<
"# Molecule IDs in slice\n";
921 outputFile <<
"# LAMMPS command : group groupName molecule 100:10000 \n";
927 outputFile << idVec[0];
929 lastPrintedElemSeries = idVec[0];
933 for (
int i=1; i<idVec.
size(); i++)
935 currentElem = idVec[i];
938 if (currentElem-prevElem>1 || i==idVec.
size()-1)
940 if (lastPrintedElemSeries!=prevElem)
942 outputFile <<
":" << prevElem <<
" " << currentElem;
943 lastPrintedElemSeries = currentElem;
946 outputFile <<
" " << currentElem;
947 lastPrintedElemSeries = currentElem;
952 prevElem = currentElem;
968 "ovito-molIDSelect-" +
std::to_string(yCloud->currentFrame) +
".dat";
971 int prevElem, currentElem;
972 int lastPrintedElemSeries;
980 outputFile.
open(path +
"selection/IDovitoFiles/" + filename);
985 for (
int iatom = 0; iatom < yCloud->nop; iatom++)
988 if (yCloud->pts[iatom].inSlice)
990 idVec.
push_back(yCloud->pts[iatom].molID);
1007 outputFile <<
"# Molecule IDs in slice\n";
1008 outputFile <<
"# OVITO Expression select command \n";
1012 for (
int i=0; i<idVec.
size()-1; i++)
1014 currentElem = idVec[i];
1016 outputFile <<
"MoleculeIdentifier == " << currentElem <<
" || ";
1021 outputFile <<
"MoleculeIdentifier == " << idVec.
back();
1034 int currentFrame,
int firstFrame) {
1044 outputFile.
open(path +
"topoINT/nPrisms.dat",
1045 std::ios_base::app | std::ios_base::out);
1049 if (currentFrame == firstFrame) {
1050 outputFile <<
"Frame RingSize Num_of_prisms Height% RingSize ... Height\n";
1057 outputFile << currentFrame <<
" ";
1059 for (
int ringSize = 3; ringSize <= maxDepth; ringSize++) {
1060 totalPrisms = nPrisms[ringSize - 3] + nDefPrisms[ringSize - 3];
1062 outputFile << ringSize <<
" " << totalPrisms <<
" "
1063 << nDefPrisms[ringSize - 3] <<
" " << heightPercent[ringSize - 3]
1089 std::string outputDirName = path +
"topoMonolayer";
1094 outputFileXY.
open(path +
"topoMonolayer/coverageAreaXY.dat",
1095 std::ios_base::app | std::ios_base::out);
1103 if (currentFrame == firstFrame) {
1104 outputFileXY <<
"Frame RingSize Num_of_rings CoverageAreaXY% RingSize ... "
1105 "CoverageAreaXY%\n";
1109 outputFileXY << currentFrame <<
" ";
1111 for (
int ringSize = 3; ringSize <= maxDepth; ringSize++) {
1112 outputFileXY << ringSize <<
" " << nRings[ringSize - 3] <<
" "
1113 << coverageAreaXY[ringSize - 3] <<
" ";
1116 outputFileXY <<
"\n";
1118 outputFileXY.
close();
1122 outputFileXZ.
open(path +
"topoMonolayer/coverageAreaXZ.dat",
1123 std::ios_base::app | std::ios_base::out);
1127 if (currentFrame == firstFrame) {
1128 outputFileXZ <<
"Frame RingSize Num_of_rings CoverageAreaXZ% RingSize ... "
1129 "CoverageAreaXZ%\n";
1137 outputFileXZ << currentFrame <<
" ";
1139 for (
int ringSize = 3; ringSize <= maxDepth; ringSize++) {
1140 outputFileXZ << ringSize <<
" " << nRings[ringSize - 3] <<
" "
1141 << coverageAreaXZ[ringSize - 3] <<
" ";
1144 outputFileXZ <<
"\n";
1146 outputFileXZ.
close();
1150 outputFileYZ.
open(path +
"topoMonolayer/coverageAreaYZ.dat",
1151 std::ios_base::app | std::ios_base::out);
1155 if (currentFrame == firstFrame) {
1156 outputFileYZ <<
"Frame RingSize Num_of_rings CoverageAreaYZ% RingSize ... "
1157 "CoverageAreaYZ%\n";
1165 outputFileYZ << currentFrame <<
" ";
1167 for (
int ringSize = 3; ringSize <= maxDepth; ringSize++) {
1168 outputFileYZ << ringSize <<
" " << nRings[ringSize - 3] <<
" "
1169 << coverageAreaYZ[ringSize - 3] <<
" ";
1172 outputFileYZ <<
"\n";
1174 outputFileYZ.
close();
1195 outputFile.
open(path +
"bulkTopo/num_rings.dat",
1196 std::ios_base::app | std::ios_base::out);
1204 if (currentFrame == firstFrame) {
1205 outputFile <<
"Frame RingSize Num_of_rings RingSize Num_of_rings...\n";
1209 outputFile << currentFrame <<
" ";
1211 for (
int ringSize = 3; ringSize <= maxDepth; ringSize++) {
1212 outputFile << ringSize <<
" " << nRings[ringSize - 3] <<
" ";
1227 double binwidth,
int nbin) {
1233 outputFile.
open(fileName, std::ios_base::app | std::ios_base::out);
1236 for (
int ibin = 0; ibin < nbin; ibin++) {
1238 r = binwidth * (ibin + 0.5);
1239 outputFile << r <<
" " << (*rdfValues)[ibin] <<
"\n";
1252 int numDDC,
int mixedRings,
int basalRings,
1253 int prismaticRings,
int firstFrame) {
1263 outputFile.
open(path +
"bulkTopo/cageData.dat",
1264 std::ios_base::app | std::ios_base::out);
1271 if (currentFrame == firstFrame) {
1272 outputFile <<
"Frame HCnumber DDCnumber MixedRingNumber PrismaticRings "
1276 outputFile << currentFrame <<
" " << numHC <<
" " << numDDC <<
" "
1277 << mixedRings <<
" " << prismaticRings <<
" " << basalRings
1298 std::string outputDirName = path +
"bulkTopo/dumpFiles";
1302 if (yCloud->currentFrame == firstFrame) {
1303 outputFile.
open(path +
"bulkTopo/typeInfo.dat");
1304 outputFile <<
"Atom types in the dump files are:\n";
1305 outputFile <<
" Type 0 (dummy) = unidentified phase\n";
1306 outputFile <<
" Type 1 (hc) = atom belonging to a Hexagonal Cage.\n";
1307 outputFile <<
" Type 2 (ddc) = atom belonging to a Double-Diamond Cage\n";
1308 outputFile <<
" Type 3 (mixed) = atom belonging to a mixed ring shared by "
1311 <<
" Type 4 (pnc) = atom belonging to a pair of pentagonal rings\n";
1312 outputFile <<
" Type 5 (mixed2) = atom belonging to a pentagonal "
1313 "nanochannel, shared by DDCs/HCs\n";
1318 outputFile.
open(path +
"bulkTopo/dumpFiles/" + filename);
1336 outputFile <<
"ITEM: TIMESTEP\n";
1338 outputFile << yCloud->currentFrame <<
"\n";
1340 outputFile <<
"ITEM: NUMBER OF ATOMS\n";
1342 outputFile << yCloud->pts.size() <<
"\n";
1344 outputFile <<
"ITEM: BOX BOUNDS pp pp pp\n";
1346 outputFile << yCloud->boxLow[0] <<
" " << yCloud->boxLow[0] + yCloud->box[0]
1348 outputFile << yCloud->boxLow[1] <<
" " << yCloud->boxLow[1] + yCloud->box[1]
1350 outputFile << yCloud->boxLow[2] <<
" " << yCloud->boxLow[2] + yCloud->box[2]
1353 outputFile <<
"ITEM: ATOMS id mol type x y z rmsd\n";
1360 for (
int i = 0; i < yCloud->pts.size(); i++) {
1362 yCloud->pts[i].atomID;
1364 outputFile << iatom <<
" " << yCloud->pts[i].molID <<
" " << atomTypes[i]
1365 <<
" " << yCloud->pts[i].x <<
" " << yCloud->pts[i].y <<
" "
1366 << yCloud->pts[i].z <<
" " << rmsdPerAtom[i] <<
"\n";
1389 std::string outputDirName = path +
"topoINT/dumpFiles";
1393 outputFile.
open(path +
"topoINT/dumpFiles/" + filename);
1411 outputFile <<
"ITEM: TIMESTEP\n";
1413 outputFile << yCloud->currentFrame <<
"\n";
1415 outputFile <<
"ITEM: NUMBER OF ATOMS\n";
1417 outputFile << yCloud->pts.size() <<
"\n";
1419 outputFile <<
"ITEM: BOX BOUNDS pp pp pp\n";
1421 outputFile << yCloud->boxLow[0] <<
" " << yCloud->boxLow[0] + yCloud->box[0]
1423 outputFile << yCloud->boxLow[1] <<
" " << yCloud->boxLow[1] + yCloud->box[1]
1425 outputFile << yCloud->boxLow[2] <<
" " << yCloud->boxLow[2] + yCloud->box[2]
1428 outputFile <<
"ITEM: ATOMS id mol type x y z rmsd\n";
1435 for (
int i = 0; i < yCloud->pts.size(); i++) {
1437 yCloud->pts[i].atomID;
1439 outputFile << iatom <<
" " << yCloud->pts[i].molID <<
" " << atomTypes[i]
1440 <<
" " << yCloud->pts[i].x <<
" " << yCloud->pts[i].y <<
" "
1441 << yCloud->pts[i].z <<
" " << rmsdPerAtom[i] <<
"\n";
1463 std::string outputDirName = path +
"selection/dumpFiles";
1467 outputFile.
open(path +
"selection/dumpFiles/" + filename);
1485 outputFile <<
"ITEM: TIMESTEP\n";
1487 outputFile << yCloud->currentFrame <<
"\n";
1489 outputFile <<
"ITEM: NUMBER OF ATOMS\n";
1491 outputFile << yCloud->pts.size() <<
"\n";
1493 outputFile <<
"ITEM: BOX BOUNDS pp pp pp\n";
1495 outputFile << yCloud->boxLow[0] <<
" " << yCloud->boxLow[0] + yCloud->box[0]
1497 outputFile << yCloud->boxLow[1] <<
" " << yCloud->boxLow[1] + yCloud->box[1]
1499 outputFile << yCloud->boxLow[2] <<
" " << yCloud->boxLow[2] + yCloud->box[2]
1502 outputFile <<
"ITEM: ATOMS id mol type x y z inSlice\n";
1509 for (
int i = 0; i < yCloud->pts.size(); i++) {
1511 yCloud->pts[i].atomID;
1513 outputFile << iatom <<
" " << yCloud->pts[i].molID <<
" " << yCloud->pts[i].type
1514 <<
" " << yCloud->pts[i].x <<
" " << yCloud->pts[i].y <<
" "
1515 << yCloud->pts[i].z <<
" " << yCloud->pts[i].inSlice <<
"\n";
1530 int maxDepth,
std::string path,
bool doShapeMatching) {
1539 "system-prisms-" +
std::to_string(yCloud->currentFrame) +
".data";
1550 outputDirName = path +
"topoINT/dataFiles/";
1554 outputFile.
open(path +
"topoINT/dataFiles/" + filename);
1584 outputFile <<
"Written out by D-SEAMS\n";
1586 outputFile << yCloud->pts.size() <<
" "
1590 outputFile << bonds.
size() <<
" bonds"
1592 outputFile <<
"0 angles\n0 dihedrals\n0 impropers\n";
1594 if (doShapeMatching) {
1595 outputFile << 2 * maxDepth - 2 <<
" atom types\n";
1597 outputFile << maxDepth <<
" atom types\n";
1602 <<
" bond types\n0 angle types\n0 dihedral types\n0 improper types\n";
1604 outputFile << yCloud->boxLow[0] <<
" " << yCloud->boxLow[0] + yCloud->box[0]
1606 outputFile << yCloud->boxLow[1] <<
" " << yCloud->boxLow[1] + yCloud->box[1]
1608 outputFile << yCloud->boxLow[2] <<
" " << yCloud->boxLow[2] + yCloud->box[2]
1611 outputFile <<
"\nMasses\n\n";
1612 outputFile <<
"1 15.999400 # dummy\n";
1613 outputFile <<
"2 1.0 # mixedRings \n";
1615 for (
int ringSize = 3; ringSize <= maxDepth; ringSize++) {
1616 outputFile << ringSize <<
" 15.999400 # prism" << ringSize <<
"\n";
1619 if (doShapeMatching) {
1620 for (
int ringSize = maxDepth + 1; ringSize <= 2 * maxDepth - 2;
1622 int p = ringSize - maxDepth + 2;
1623 outputFile << ringSize <<
" 15.999400 # deformPrism" << p <<
"\n";
1627 outputFile <<
"\nAtoms\n\n";
1631 for (
int i = 0; i < yCloud->pts.size(); i++) {
1633 yCloud->pts[i].atomID;
1636 outputFile << iatom <<
" " << yCloud->pts[i].molID <<
" " << atomTypes[i]
1637 <<
" 0 " << yCloud->pts[i].x <<
" " << yCloud->pts[i].y <<
" "
1638 << yCloud->pts[i].z <<
"\n";
1643 outputFile <<
"\nBonds\n\n";
1645 for (
int ibond = 0; ibond < bonds.
size(); ibond++) {
1647 outputFile << ibond + 1 <<
" 1 " << bonds[ibond][0] <<
" "
1648 << bonds[ibond][1] <<
"\n";
1664 int maxDepth,
std::string path,
bool isMonolayer) {
1673 "system-rings-" +
std::to_string(yCloud->currentFrame) +
".data";
1684 pathFolder =
"topoMonolayer";
1685 pathName =
"topoMonolayer/dataFiles/";
1687 pathFolder =
"bulkTopo";
1688 pathName =
"bulkTopo/dataFiles/";
1694 outputDirName = path + pathName;
1698 outputFile.
open(path + pathName + filename);
1729 outputFile <<
"Written out by D-SEAMS\n";
1731 outputFile << yCloud->pts.size() <<
" "
1735 outputFile << bonds.
size() <<
" bonds"
1737 outputFile <<
"0 angles\n0 dihedrals\n0 impropers\n";
1739 outputFile << maxDepth <<
" atom types\n";
1743 <<
" bond types\n0 angle types\n0 dihedral types\n0 improper types\n";
1745 outputFile << yCloud->boxLow[0] <<
" " << yCloud->boxLow[0] + yCloud->box[0]
1747 outputFile << yCloud->boxLow[1] <<
" " << yCloud->boxLow[1] + yCloud->box[1]
1749 outputFile << yCloud->boxLow[2] <<
" " << yCloud->boxLow[2] + yCloud->box[2]
1752 outputFile <<
"\nMasses\n\n";
1753 outputFile <<
"1 15.999400 # dummy\n";
1754 outputFile <<
"2 1.0 # \n";
1756 for (
int ringSize = 3; ringSize <= maxDepth; ringSize++) {
1757 outputFile << ringSize <<
" 15.999400 # ring" << ringSize <<
"\n";
1760 outputFile <<
"\nAtoms\n\n";
1764 for (
int i = 0; i < yCloud->pts.size(); i++) {
1766 yCloud->pts[i].atomID;
1769 outputFile << iatom <<
" " << yCloud->pts[i].molID <<
" " << atomTypes[i]
1770 <<
" 0 " << yCloud->pts[i].x <<
" " << yCloud->pts[i].y <<
" "
1771 << yCloud->pts[i].z <<
"\n";
1776 outputFile <<
"\nBonds\n\n";
1778 for (
int ibond = 0; ibond < bonds.
size(); ibond++) {
1780 outputFile << ibond + 1 <<
" 1 " << bonds[ibond][0] <<
" "
1781 << bonds[ibond][1] <<
"\n";
1800 int ringSize = rings[0].
size();
1802 bool padAtoms =
false;
1811 bool atomOne, atomTwo;
1816 if (listPrism.
size() == 0) {
1833 const char *path =
"../output";
1841 size_t total_size{0};
1843 total_size = listPrism.
size() * ringSize;
1847 for (
int iring = 0; iring < listPrism.
size(); iring++) {
1848 std::move(rings[listPrism[iring]].begin(), rings[listPrism[iring]].end(),
1860 if (atoms.
size() != yCloud->nop) {
1866 outputFile.
open(
"../output/" + filename);
1896 outputFile <<
"Written out by D-SEAMS\n";
1898 outputFile << yCloud->pts.size() <<
" "
1902 outputFile << bonds.
size() <<
" bonds"
1904 outputFile <<
"0 angles\n0 dihedrals\n0 impropers\n";
1907 outputFile <<
"2 atom types\n";
1909 outputFile <<
"1 atom types\n";
1913 <<
" bond types\n0 angle types\n0 dihedral types\n0 improper types\n";
1915 outputFile <<
"0 " << yCloud->box[0] <<
" xlo xhi\n";
1916 outputFile <<
"0 " << yCloud->box[1] <<
" ylo yhi\n";
1917 outputFile <<
"0 " << yCloud->box[2] <<
" zlo zhi\n";
1919 outputFile <<
"\nMasses\n\n";
1920 outputFile <<
"1 15.999400 # O\n";
1922 outputFile <<
"2 1.0 # dummy\n";
1925 outputFile <<
"\nAtoms\n\n";
1929 for (
int i = 0; i < atoms.
size(); i++) {
1930 iatom = atoms[i] - 1;
1934 if (atoms[i] != prevAtomID + 1) {
1935 dummyAtoms = atoms[i] - prevAtomID - 1;
1936 dummyID = prevAtomID;
1938 for (
int j = 0; j < dummyAtoms; j++) {
1940 jatom = dummyID - 1;
1942 outputFile << dummyID <<
" " << yCloud->pts[jatom].molID <<
" 2 0 "
1943 << yCloud->pts[jatom].x <<
" " << yCloud->pts[jatom].y <<
" "
1944 << yCloud->pts[jatom].z <<
"\n";
1950 outputFile << atoms[i] <<
" " << yCloud->pts[iatom].molID <<
" 1 0 "
1951 << yCloud->pts[iatom].x <<
" " << yCloud->pts[iatom].y <<
" "
1952 << yCloud->pts[iatom].z <<
"\n";
1954 prevAtomID = atoms[i];
1958 if (atoms[atoms.
size() - 1] != yCloud->nop) {
1960 for (
int id = atoms[atoms.
size() - 1] + 1; id <= yCloud->nop;
id++) {
1962 outputFile <<
id <<
" " << yCloud->pts[jatom].molID <<
" 2 0 "
1963 << yCloud->pts[jatom].x <<
" " << yCloud->pts[jatom].y <<
" "
1964 << yCloud->pts[jatom].z <<
"\n";
1969 outputFile <<
"\nBonds\n\n";
1971 for (
int ibond = 0; ibond < bonds.
size(); ibond++) {
1973 isPrismBond =
false;
1979 if (it != atoms.
end()) {
1981 }
else if (bonds[ibond][0] == atoms[0]) {
1983 }
else if (bonds[ibond][0] == atoms[atoms.
size() - 1]) {
1988 if (it1 != atoms.
end()) {
1990 }
else if (bonds[ibond][1] == atoms[0]) {
1992 }
else if (bonds[ibond][1] == atoms[atoms.
size() - 1]) {
1996 if (atomOne ==
false || atomTwo ==
false) {
1997 isPrismBond =
false;
2004 outputFile << ibond + 1 <<
" 1 " << bonds[ibond][0] <<
" "
2005 << bonds[ibond][1] <<
"\n";
2008 outputFile << ibond + 1 <<
" 2 " << bonds[ibond][0] <<
" "
2009 << bonds[ibond][1] <<
"\n";
2029 int ringSize = rings[0].
size();
2031 bool padAtoms =
false;
2046 if ((*cageList).size() == 0) {
2051 if (numCages == 0) {
2061 const char *path =
"../output";
2069 size_t total_size{0};
2071 total_size = nRings * ringSize;
2076 for (
int icage = 0; icage < (*cageList).size(); icage++) {
2078 if ((*cageList)[icage].type != type) {
2082 for (
int k = 0; k < (*cageList)[icage].rings.size(); k++) {
2083 iring = (*cageList)[icage].rings[k];
2084 std::move(rings[iring].begin(), rings[iring].end(),
2098 if (atoms.
size() != yCloud->nop) {
2104 outputFile.
open(
"../output/" + filename);
2134 outputFile <<
"Written out by D-SEAMS\n";
2136 outputFile << yCloud->pts.size() <<
" "
2140 outputFile << bonds.
size() <<
" bonds"
2142 outputFile <<
"0 angles\n0 dihedrals\n0 impropers\n";
2145 outputFile <<
"2 atom types\n";
2147 outputFile <<
"1 atom types\n";
2151 <<
" bond types\n0 angle types\n0 dihedral types\n0 improper types\n";
2153 outputFile <<
"0 " << yCloud->box[0] <<
" xlo xhi\n";
2154 outputFile <<
"0 " << yCloud->box[1] <<
" ylo yhi\n";
2155 outputFile <<
"0 " << yCloud->box[2] <<
" zlo zhi\n";
2157 outputFile <<
"\nMasses\n\n";
2160 actualCageType =
"HC";
2162 actualCageType =
"DDC";
2164 actualCageType =
"error";
2167 outputFile <<
"1 15.999400 # " << actualCageType <<
"\n";
2169 outputFile <<
"2 1.0 # dummy\n";
2172 outputFile <<
"\nAtoms\n\n";
2176 for (
int i = 0; i < atoms.
size(); i++) {
2177 iatom = atoms[i] - 1;
2181 if (atoms[i] != prevAtomID + 1) {
2182 dummyAtoms = atoms[i] - prevAtomID - 1;
2183 dummyID = prevAtomID;
2185 for (
int j = 0; j < dummyAtoms; j++) {
2187 jatom = dummyID - 1;
2189 outputFile << dummyID <<
" " << yCloud->pts[jatom].molID <<
" 2 0 "
2190 << yCloud->pts[jatom].x <<
" " << yCloud->pts[jatom].y <<
" "
2191 << yCloud->pts[jatom].z <<
"\n";
2197 outputFile << atoms[i] <<
" " << yCloud->pts[iatom].molID <<
" 1 0 "
2198 << yCloud->pts[iatom].x <<
" " << yCloud->pts[iatom].y <<
" "
2199 << yCloud->pts[iatom].z <<
"\n";
2201 prevAtomID = atoms[i];
2205 if (atoms[atoms.
size() - 1] != yCloud->nop) {
2207 for (
int id = atoms[atoms.
size() - 1] + 1; id <= yCloud->nop;
id++) {
2209 outputFile <<
id <<
" " << yCloud->pts[jatom].molID <<
" 2 0 "
2210 << yCloud->pts[jatom].x <<
" " << yCloud->pts[jatom].y <<
" "
2211 << yCloud->pts[jatom].z <<
"\n";
2216 outputFile <<
"\nBonds\n\n";
2218 for (
int ibond = 0; ibond < bonds.
size(); ibond++) {
2220 outputFile << ibond + 1 <<
" 1 " << bonds[ibond][0] <<
" "
2221 << bonds[ibond][1] <<
"\n";
2243 outputFile.
open(path + outFile, std::ios_base::app);
2260 outputFile <<
"ITEM: TIMESTEP\n";
2261 outputFile << yCloud->currentFrame <<
"\n";
2262 outputFile <<
"ITEM: NUMBER OF ATOMS\n";
2263 outputFile << yCloud->nop <<
"\n";
2264 outputFile <<
"ITEM: BOX BOUNDS pp pp pp\n";
2265 for (
int k = 0; k < yCloud->boxLow.size(); k++) {
2266 outputFile << yCloud->boxLow[k] <<
" "
2267 << yCloud->boxLow[k] + yCloud->box[k];
2269 if (yCloud->box.size() == 2 * yCloud->boxLow.size()) {
2271 << yCloud->box[k + yCloud->boxLow.size()];
2276 outputFile <<
"ITEM: ATOMS id mol type x y z\n";
2279 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
2280 outputFile << yCloud->pts[iatom].atomID <<
" " << yCloud->pts[iatom].molID;
2284 outputFile <<
" Ic " << yCloud->pts[iatom].x <<
" "
2285 << yCloud->pts[iatom].y <<
" " << yCloud->pts[iatom].z <<
"\n";
2289 outputFile <<
" Ih " << yCloud->pts[iatom].x <<
" "
2290 << yCloud->pts[iatom].y <<
" " << yCloud->pts[iatom].z <<
"\n";
2294 outputFile <<
" wat " << yCloud->pts[iatom].x <<
" "
2295 << yCloud->pts[iatom].y <<
" " << yCloud->pts[iatom].z <<
"\n";
2299 outputFile <<
" intFc " << yCloud->pts[iatom].x <<
" "
2300 << yCloud->pts[iatom].y <<
" " << yCloud->pts[iatom].z <<
"\n";
2304 outputFile <<
" clathrate " << yCloud->pts[iatom].x <<
" "
2305 << yCloud->pts[iatom].y <<
" " << yCloud->pts[iatom].z <<
"\n";
2309 outputFile <<
" interClathrate " << yCloud->pts[iatom].x <<
" "
2310 << yCloud->pts[iatom].y <<
" " << yCloud->pts[iatom].z <<
"\n";
2314 outputFile <<
" unclassified " << yCloud->pts[iatom].x <<
" "
2315 << yCloud->pts[iatom].y <<
" " << yCloud->pts[iatom].z <<
"\n";
2319 outputFile <<
" reIc " << yCloud->pts[iatom].x <<
" "
2320 << yCloud->pts[iatom].y <<
" " << yCloud->pts[iatom].z <<
"\n";
2324 outputFile <<
" reIh " << yCloud->pts[iatom].x <<
" "
2325 << yCloud->pts[iatom].y <<
" " << yCloud->pts[iatom].z <<
"\n";
2349 cijFile.
open(
"cij.txt", std::ofstream::out | std::ofstream::app);
2350 q3File.
open(
"q3.txt", std::ofstream::out | std::ofstream::app);
2351 q6File.
open(
"q6.txt", std::ofstream::out | std::ofstream::app);
2353 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
2354 if (yCloud->pts[iatom].type != 1) {
2358 nNumNeighbours = nList[iatom].size() - 1;
2360 for (
int j = 0; j < nNumNeighbours; j++) {
2361 cijFile << yCloud->pts[iatom].c_ij[j].c_value <<
"\n";
2362 avgQ3 += yCloud->pts[iatom].c_ij[j].c_value;
2364 avgQ3 /= nNumNeighbours;
2365 q3File << avgQ3 <<
"\n";
2366 q6File << avgQ6[iatom] <<
"\n";
2385 clusterFile.
open(fileName, std::ofstream::out | std::ofstream::app);
2388 clusterFile.
close();
2404 int currentAtomType;
2405 int numAtomTypes = 6;
2415 if (bondsBetweenDummy) {
2427 outputDirName = path +
"bulkTopo/dataFiles/";
2431 outputFile.
open(path +
"bulkTopo/dataFiles/" + filename);
2461 outputFile <<
"Written out by D-SEAMS\n";
2463 outputFile << yCloud->pts.size() <<
" "
2467 outputFile << bonds.
size() <<
" bonds"
2469 outputFile <<
"0 angles\n0 dihedrals\n0 impropers\n";
2471 outputFile << numAtomTypes <<
" atom types\n";
2475 <<
" bond types\n0 angle types\n0 dihedral types\n0 improper types\n";
2477 outputFile << yCloud->boxLow[0] <<
" " << yCloud->boxLow[0] + yCloud->box[0]
2479 outputFile << yCloud->boxLow[1] <<
" " << yCloud->boxLow[1] + yCloud->box[1]
2481 outputFile << yCloud->boxLow[2] <<
" " << yCloud->boxLow[2] + yCloud->box[2]
2484 outputFile <<
"\nMasses\n\n";
2485 outputFile <<
"1 15.999400 # dummy\n";
2486 outputFile <<
"2 15.999400 # hc \n";
2487 outputFile <<
"3 15.999400 # ddc \n";
2488 outputFile <<
"4 15.999400 # mixed \n";
2489 outputFile <<
"5 15.999400 # pnc \n";
2490 outputFile <<
"6 15.999400 # pncHexaMixed \n";
2492 outputFile <<
"\nAtoms\n\n";
2496 for (
int i = 0; i < yCloud->pts.size(); i++) {
2498 yCloud->pts[i].atomID;
2503 currentAtomType = 2;
2506 currentAtomType = 3;
2510 currentAtomType = 4;
2514 currentAtomType = 5;
2518 currentAtomType = 6;
2522 currentAtomType = 1;
2527 outputFile << iatom <<
" " << yCloud->pts[i].molID <<
" " << currentAtomType
2528 <<
" 0 " << yCloud->pts[i].x <<
" " << yCloud->pts[i].y <<
" "
2529 << yCloud->pts[i].z <<
"\n";
2534 outputFile <<
"\nBonds\n\n";
2536 for (
int ibond = 0; ibond < bonds.
size(); ibond++) {
2538 outputFile << ibond + 1 <<
" 1 " << bonds[ibond][0] <<
" "
2539 << bonds[ibond][1] <<
"\n";
2556 int nAtoms = atoms.
size();
2563 outputDirName = path +
"bulkTopo/clusterXYZ/";
2565 outputDirName = path +
"bulkTopo/clusterXYZ/frame-" +
2570 outputFile.
open(path +
"bulkTopo/clusterXYZ/frame-" +
2578 outputFile << nAtoms <<
"\n";
2580 <<
"Generated by d-SEAMS. 0 type=hc and 1 type =ddc\n";
2583 for (
int i = 0; i < nAtoms; i++) {
2586 outputFile << static_cast<int>(type) <<
" " << yCloud->pts[iatom].x <<
" "
2587 << yCloud->pts[iatom].y <<
" " << yCloud->pts[iatom].z <<
"\n";
T back_inserter(T... args)
std::vector< std::vector< int > > populateBonds(std::vector< std::vector< int >> nList, molSys::PointCloud< molSys::Point< double >, double > *yCloud)
std::vector< std::vector< int > > createBondsFromCages(std::vector< std::vector< int >> rings, std::vector< cage::Cage > *cageList, cage::cageType type, int *nRings)
int largestIceCluster(std::string path, molSys::PointCloud< molSys::Point< double >, double > *yCloud, molSys::PointCloud< molSys::Point< double >, double > *iceCloud, std::vector< std::vector< int >> nList, std::vector< bool > *isIce, std::vector< int > *clusterID, std::vector< int > *nClusters, std::unordered_map< int, int > *indexNumber, int firstFrame)
Finds the largest ice cluster.
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,...
@ hexagonal
Ih, or particle type signifying Hexagonal Ice.
@ reCubic
Reclassified as cubic ice, according to the order parameter.
@ interfacial
Interfacial ice: ice-like molecules which do not fulfill the strict criteria of the Ic or Ih phases.
@ cubic
Ic, or particle type signifying Cubic Ice.
@ interClathrate
Interfacial clathrate ice phase.
@ water
Liquid/amorphous phase.
@ clathrate
Clathrate ice phase.
@ unclassified
Not classified into any other category.
std::vector< std::vector< int > > readBonds(std::string filename)
Reads bonds into a vector of vectors from a file with a specific format.
int writeBasalRingsPrism(std::vector< int > *basal1, std::vector< int > *basal2, int prismNum, std::vector< std::vector< int >> nList, molSys::PointCloud< molSys::Point< double >, double > *yCloud, bool isDeformed)
Write out the basal rings for a particular prism.
int writeLAMMPSdata(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int >> rings, std::vector< std::vector< int >> bonds, std::string filename="system-rings.data")
Write a data file for rings.
int writeMoleculeIDsInSlice(std::string path, molSys::PointCloud< molSys::Point< double >, double > *yCloud)
int writeAllCages(std::string path, std::vector< cage::Cage > *cageList, std::vector< std::vector< int >> rings, std::vector< std::vector< int >> nList, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int currentFrame)
int writePrismNum(std::string path, std::vector< int > nPrisms, std::vector< int > nDefPrisms, std::vector< double > heightPercent, int maxDepth, int currentFrame, int firstFrame)
int writeRingNumBulk(std::string path, int currentFrame, std::vector< int > nRings, int maxDepth, int firstFrame)
int writeLAMMPSdumpSlice(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::string path)
int writeRingNum(std::string path, int currentFrame, std::vector< int > nRings, std::vector< double > coverageAreaXY, std::vector< double > coverageAreaXZ, std::vector< double > coverageAreaYZ, int maxDepth, int firstFrame)
int makePath(const std::string &path)
int writeLAMMPSdataAllRings(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int >> nList, std::vector< int > atomTypes, int maxDepth, std::string path, bool isMonolayer=true)
Write a data file for rings of every type for a monolayer.
int writeLAMMPSdataCages(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int >> rings, std::vector< cage::Cage > *cageList, cage::cageType type, int numCages, std::string filename="system-cages.data")
int writeTopoBulkData(std::string path, int currentFrame, int numHC, int numDDC, int mixedRings, int basalRings, int prismaticRings, int firstFrame)
int writeDump(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::string path, std::string outFile)
Generic function for writing out to a dump file.
int writeLAMMPSdumpINT(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< double > rmsdPerAtom, std::vector< int > atomTypes, int maxDepth, std::string path)
Write out a LAMMPS dump file containing the RMSD per atom.
int writeBasalRingsHex(std::vector< int > currentCage, int cageNum, std::vector< std::vector< int >> nList, std::vector< std::vector< int >> rings)
Write out the basal rings of a particular Hexagonal cage.
int writePrisms(std::vector< int > *basal1, std::vector< int > *basal2, int prismNum, molSys::PointCloud< molSys::Point< double >, double > *yCloud)
Function for writing out each prism.
int printRDF(std::string fileName, std::vector< double > *rdfValues, double binwidth, int nbin)
Function for printing out the RDF, given the filename.
int writeMoleculeIDsExpressionSelectOVITO(std::string path, molSys::PointCloud< molSys::Point< double >, double > *yCloud)
int writeLAMMPSdataPrisms(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int >> rings, bool useBondFile, std::string bondFile, std::vector< int > listPrism, std::vector< std::vector< int >> nList, std::string filename="system-prisms.data")
Write a data file for prisms of a single type.
int writeLAMMPSdataTopoBulk(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int >> nList, std::vector< cage::iceType > atomTypes, std::string path, bool bondsBetweenDummy=false)
int writeRings(std::vector< std::vector< int >> rings, std::string filename="rings.dat")
Function for printing out ring info, when there is no volume slice.
int writeLAMMPSdumpCages(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< double > rmsdPerAtom, std::vector< int > atomTypes, std::string path, int firstFrame)
Write out a LAMMPS dump file containing the RMSD per atom for bulk ice.
int writeXYZcluster(std::string path, molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< int > atoms, int clusterID, cage::cageType type)
Function for writing out the XYZ files for each cluster.
int writeLAMMPSdataAllPrisms(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int >> nList, std::vector< int > atomTypes, int maxDepth, std::string path, bool doShapeMatching=false)
Write a data file for prisms of every type.
int writeEachCage(std::vector< int > currentCage, int cageNum, cage::cageType type, std::vector< std::vector< int >> rings, molSys::PointCloud< molSys::Point< double >, double > *yCloud)
Write out a particular cage to a file.
int writeCluster(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::string fileName="cluster.txt", bool isSlice=false, int largestIceCluster=0)
Function for printing the largest ice cluster.
int writeClusterStats(std::string path, int currentFrame, int largestCluster, int numOfClusters, int smallestCluster, double avgClusterSize, int firstFrame)
Function for writing out cluster statistics.
int writeHisto(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int >> nList, std::vector< double > avgQ6)
This contains a collection of points; contains information for a particular frame.
This contains per-particle information.