17 #include <icecream.hpp>
44 bool pointInSlice =
true;
53 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
55 if (yCloud->pts[iatom].type != atomTypeI) {
61 pointInSlice =
sinp::atomInSlice(yCloud->pts[iatom].x, yCloud->pts[iatom].y, yCloud->pts[iatom].z,
71 outCloud->pts.push_back(yCloud->pts[iatom]);
72 outCloud->idIndexMap[yCloud->pts[iatom].atomID] =
73 outCloud->pts.size() - 1;
77 outCloud->nop = outCloud->pts.size();
80 outCloud->box = yCloud->box;
81 outCloud->boxLow = yCloud->boxLow;
84 outCloud->currentFrame = yCloud->currentFrame;
103 bool clearPreviousSliceSelection,
107 bool pointInSlice =
true;
111 if (clearPreviousSliceSelection)
113 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
114 yCloud->pts[iatom].inSlice =
false;
120 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
122 pointInSlice =
sinp::atomInSlice(yCloud->pts[iatom].x, yCloud->pts[iatom].y, yCloud->pts[iatom].z,
123 coordLow, coordHigh);
125 yCloud->pts[iatom].inSlice = pointInSlice;
149 bool clearPreviousSliceSelection,
153 bool pointInSlice =
true;
167 if (clearPreviousSliceSelection)
169 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
170 yCloud->pts[iatom].inSlice =
false;
176 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
178 pointInSlice =
sinp::atomInSlice(yCloud->pts[iatom].x, yCloud->pts[iatom].y, yCloud->pts[iatom].z,
179 coordLow, coordHigh);
184 yCloud->pts[iatom].inSlice =
true;
186 iatomMolID = yCloud->pts[iatom].molID;
190 auto range = molIDAtomIDmap.
equal_range(iatomMolID);
192 for (
auto it = range.first; it != range.second; it++)
195 jatomID = it->second;
196 auto gotJ = yCloud->idIndexMap.find(jatomID);
197 jatomIndex = gotJ->second;
199 yCloud->pts[jatomIndex].inSlice =
true;
204 yCloud->pts[iatom].inSlice =
false;
228 int molID,
bool inSliceValue) {
237 for (
auto it = range.first; it != range.second; it++){
239 jatomID = it->second;
240 auto gotJ = yCloud->idIndexMap.find(jatomID);
241 jatomIndex = gotJ->second;
243 yCloud->pts[jatomIndex].inSlice = inSliceValue;
272 int jatomIndex, jatomID;
295 for (
int iatom = 0; iatom < oCloud->nop; iatom++) {
297 if (!oCloud->pts[iatom].inSlice)
304 for (
int iring = 0; iring < rings.size(); iring++)
307 if (ringInSlice[iring])
312 if(
std::find(rings[iring].begin(), rings[iring].end(), iatom)!=rings[iring].end()){
314 ringInSlice[iring] =
true;
319 for (
int j = 0; j < rings[iring].size(); j++)
321 jatomIndex = rings[iring][j];
323 oCloud->pts[jatomIndex].inSlice =
true;
324 jatomID = oCloud->pts[jatomIndex].atomID;
330 auto gotJ = yCloud->idIndexMap.find(jatomID);
331 jatomIndex1 = gotJ->second;
334 yCloud->pts[jatomIndex1].inSlice =
true;
337 yCloud->pts[jatomIndex1].molID,
true);
std::unordered_multimap< int, int > createMolIDAtomIDMultiMap(molSys::PointCloud< molSys::Point< double >, double > *yCloud)
molSys::PointCloud< molSys::Point< double >, double > clearPointCloud(molSys::PointCloud< molSys::Point< double >, double > *yCloud)
//! Function for clearing vectors in PointCloud after multiple usage
molSys::PointCloud< molSys::Point< double >, double > getPointCloudOneAtomType(molSys::PointCloud< molSys::Point< double >, double > *yCloud, molSys::PointCloud< molSys::Point< double >, double > *outCloud, int atomTypeI, bool isSlice=false, std::array< double, 3 > coordLow=std::array< double, 3 >{0, 0, 0}, std::array< double, 3 > coordHigh=std::array< double, 3 >{0, 0, 0})
void atomsInSingleSlice(molSys::PointCloud< molSys::Point< double >, double > *yCloud, bool clearPreviousSliceSelection=true, std::array< double, 3 > coordLow=std::array< double, 3 >{0, 0, 0}, std::array< double, 3 > coordHigh=std::array< double, 3 >{0, 0, 0})
void setAtomsWithSameMolID(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::unordered_multimap< int, int > molIDAtomIDmap, int molID, bool inSliceValue=true)
void moleculesInSingleSlice(molSys::PointCloud< molSys::Point< double >, double > *yCloud, bool clearPreviousSliceSelection=true, std::array< double, 3 > coordLow=std::array< double, 3 >{0, 0, 0}, std::array< double, 3 > coordHigh=std::array< double, 3 >{0, 0, 0})
void getEdgeMoleculesInRings(std::vector< std::vector< int >> rings, molSys::PointCloud< molSys::Point< double >, double > *oCloud, molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::array< double, 3 > coordLow, std::array< double, 3 > coordHigh, bool identicalCloud=false)
void printSliceGetEdgeMoleculesInRings(std::string path, std::vector< std::vector< int >> rings, molSys::PointCloud< molSys::Point< double >, double > *oCloud, molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::array< double, 3 > coordLow, std::array< double, 3 > coordHigh, bool identicalCloud=false)
bool atomInSlice(double x, double y, double z, std::array< double, 3 > coordLow, std::array< double, 3 > coordHigh)
int writeMoleculeIDsInSlice(std::string path, molSys::PointCloud< molSys::Point< double >, double > *yCloud)
int writeLAMMPSdumpSlice(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::string path)
int writeMoleculeIDsExpressionSelectOVITO(std::string path, molSys::PointCloud< molSys::Point< double >, double > *yCloud)
File containing functions used to define 'selections' in a given range, using ring information.
This contains a collection of points; contains information for a particular frame.
This contains per-particle information.