118 SimplexId cellCount = 0, verticesPerCell = offset[1] - offset[0];
119 std::vector<std::vector<SimplexId>> nodeCells(
nodeNumber_ + 1);
122 for(
SimplexId cid = 0; cid < cellNumber; cid++) {
124 for(
int j = 0; j < verticesPerCell; j++) {
125 cellArr[cellId + j] = vertexMap[cellArr[cellId + j]];
127 std::sort(cellArr + cellId, cellArr + cellId + verticesPerCell);
135 std::vector<LongSimplexId> newCellArray(verticesPerCell * cellNumber);
137 for(
SimplexId const cid : nodeCells[nid]) {
138 SimplexId const cellId = verticesPerCell * cid;
139 SimplexId const newCellId = verticesPerCell * cellCount;
140 for(
int j = 0; j < verticesPerCell; j++) {
141 newCellArray[newCellId + j] = connectivity[cellId + j];
156 for(
SimplexId i = 0; i < verticesPerCell * cellNumber; i++) {
157 const_cast<LongSimplexId *
>(connectivity)[i] = newCellArray[i];
166 SimplexId cellCount = 0, verticesPerCell = cellArray[0];
167 std::vector<std::vector<SimplexId>> nodeCells(
nodeNumber_ + 1);
171 SimplexId const cellId = (verticesPerCell + 1) * cid;
172 for(
int j = 1; j <= verticesPerCell; j++) {
173 cellArr[cellId + j] = vertexMap[cellArr[cellId + j]];
175 std::sort(cellArr + cellId + 1, cellArr + cellId + 1 + verticesPerCell);
183 std::vector<LongSimplexId> newCellArray((verticesPerCell + 1) *
cellNumber_);
185 for(
SimplexId const cid : nodeCells[nid]) {
186 SimplexId const cellId = (verticesPerCell + 1) * cid;
187 SimplexId const newCellId = (verticesPerCell + 1) * cellCount;
188 newCellArray[newCellId] = verticesPerCell;
189 for(
int j = 1; j <= verticesPerCell; j++) {
190 newCellArray[newCellId + j] = cellArray[cellId + j];
214 bool computeInternalEdgeList,
215 bool computeInternalEdgeMap)
const {
217#ifndef TTK_ENABLE_KAMIKAZE
218 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
224 if(!nodePtr->internalEdgeMap_.empty()) {
226 if(computeInternalEdgeList) {
227 nodePtr->internalEdgeList_ = std::vector<std::array<SimplexId, 2>>(
228 nodePtr->internalEdgeMap_.size());
229 for(
auto iter = nodePtr->internalEdgeMap_.begin();
230 iter != nodePtr->internalEdgeMap_.end(); iter++) {
231 nodePtr->internalEdgeList_[iter->second - 1] = iter->first;
240 std::array<SimplexId, 2> edgeIds;
243 for(
SimplexId j = 0; j < verticesPerCell - 1; j++) {
244 edgeIds[0] =
cellArray_->getCellVertex(cid, j);
249 for(
SimplexId k = j + 1; k < verticesPerCell; k++) {
250 edgeIds[1] =
cellArray_->getCellVertex(cid, k);
253 if(nodePtr->internalEdgeMap_.find(edgeIds)
254 == nodePtr->internalEdgeMap_.end()) {
256 nodePtr->internalEdgeMap_[edgeIds] = edgeCount;
264 std::array<SimplexId, 2> edgeIds;
267 for(
SimplexId j = 0; j < verticesPerCell - 1; j++) {
268 for(
SimplexId k = j + 1; k < verticesPerCell; k++) {
269 edgeIds[0] =
cellArray_->getCellVertex(cid, j);
270 edgeIds[1] =
cellArray_->getCellVertex(cid, k);
275 if(nodePtr->internalEdgeMap_.find(edgeIds)
276 == nodePtr->internalEdgeMap_.end()) {
278 (nodePtr->internalEdgeMap_)[edgeIds] = edgeCount;
285 if(computeInternalEdgeList) {
286 nodePtr->internalEdgeList_
287 = std::vector<std::array<SimplexId, 2>>(nodePtr->internalEdgeMap_.size());
288 for(
auto iter = nodePtr->internalEdgeMap_.begin();
289 iter != nodePtr->internalEdgeMap_.end(); iter++) {
290 nodePtr->internalEdgeList_[iter->second - 1] = iter->first;
294 if(!computeInternalEdgeMap) {
295 nodePtr->internalEdgeMap_.clear();
304#ifndef TTK_ENABLE_KAMIKAZE
305 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
310 boost::unordered_map<SimplexId, std::vector<std::array<SimplexId, 2>>>
315 std::array<SimplexId, 2> edgeIds;
319 for(
SimplexId j = 0; j < verticesPerCell - 1; j++) {
320 for(
SimplexId k = j + 1; k < verticesPerCell; k++) {
321 edgeIds[0] =
cellArray_->getCellVertex(cellId, j);
322 edgeIds[1] =
cellArray_->getCellVertex(cellId, k);
329 edgeNodes[nid].push_back(edgeIds);
336 std::vector<std::array<SimplexId, 2>>>::iterator iter;
337 for(iter = edgeNodes.begin(); iter != edgeNodes.end(); iter++) {
340 if(exnode->internalEdgeMap_.empty())
342 for(std::array<SimplexId, 2>
const edgePair : iter->second) {
343 (nodePtr->externalEdgeMap_)[edgePair]
344 = exnode->internalEdgeMap_.at(edgePair)
350 for(std::array<SimplexId, 2>
const edgePair : iter->second) {
351 (nodePtr->externalEdgeMap_)[edgePair]
352 = tmpCluster.internalEdgeMap_.at(edgePair)
363 bool computeInternalTriangleList,
364 bool computeInternalTriangleMap)
const {
366#ifndef TTK_ENABLE_KAMIKAZE
367 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
371 SimplexId triangleCount = 0, verticesPerCell = 4;
372 std::vector<std::vector<SimplexId>>
const localTriangleStars;
374 if(!nodePtr->internalTriangleMap_.empty()) {
375 if(computeInternalTriangleList) {
376 nodePtr->internalTriangleList_ = std::vector<std::array<SimplexId, 3>>(
377 nodePtr->internalTriangleMap_.size());
378 for(
auto iter = nodePtr->internalTriangleMap_.begin();
379 iter != nodePtr->internalTriangleMap_.end(); iter++) {
380 (nodePtr->internalTriangleList_)[iter->second - 1] = iter->first;
389 std::array<SimplexId, 3> triangleIds;
392 for(
SimplexId j = 0; j < verticesPerCell - 2; j++) {
393 triangleIds[0] =
cellArray_->getCellVertex(cid, j);
398 for(
SimplexId k = j + 1; k < verticesPerCell - 1; k++) {
399 for(
SimplexId l = k + 1; l < verticesPerCell; l++) {
400 triangleIds[1] =
cellArray_->getCellVertex(cid, k);
401 triangleIds[2] =
cellArray_->getCellVertex(cid, l);
403 if(nodePtr->internalTriangleMap_.find(triangleIds)
404 == nodePtr->internalTriangleMap_.end()) {
406 (nodePtr->internalTriangleMap_)[triangleIds] = triangleCount;
415 std::array<SimplexId, 3> triangleIds;
418 for(
SimplexId j = 0; j < verticesPerCell - 2; j++) {
419 triangleIds[0] =
cellArray_->getCellVertex(cid, j);
422 for(
SimplexId k = j + 1; k < verticesPerCell - 1; k++) {
423 for(
SimplexId l = k + 1; l < verticesPerCell; l++) {
424 triangleIds[1] =
cellArray_->getCellVertex(cid, k);
425 triangleIds[2] =
cellArray_->getCellVertex(cid, l);
427 if(nodePtr->internalTriangleMap_.find(triangleIds)
428 == nodePtr->internalTriangleMap_.end()) {
430 (nodePtr->internalTriangleMap_)[triangleIds] = triangleCount;
438 if(computeInternalTriangleList) {
439 nodePtr->internalTriangleList_ = std::vector<std::array<SimplexId, 3>>(
440 nodePtr->internalTriangleMap_.size());
441 for(
auto iter = nodePtr->internalTriangleMap_.begin();
442 iter != nodePtr->internalTriangleMap_.end(); iter++) {
443 (nodePtr->internalTriangleList_)[iter->second - 1] = iter->first;
447 if(!computeInternalTriangleMap) {
448 nodePtr->internalTriangleMap_.clear();
457#ifndef TTK_ENABLE_KAMIKAZE
458 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
463 boost::unordered_map<SimplexId, std::vector<std::array<SimplexId, 3>>>
468 std::array<SimplexId, 3> triangleIds;
471 for(
SimplexId j = 0; j < verticesPerCell - 2; j++) {
472 triangleIds[0] =
cellArray_->getCellVertex(cid, j);
474 for(
SimplexId k = j + 1; k < verticesPerCell - 1; k++) {
475 for(
SimplexId l = k + 1; l < verticesPerCell; l++) {
476 triangleIds[1] =
cellArray_->getCellVertex(cid, k);
477 triangleIds[2] =
cellArray_->getCellVertex(cid, l);
482 nodeTriangles[nodeNum].push_back(triangleIds);
486 nodeTriangles[nodeNum].push_back(triangleIds);
495 std::vector<std::array<SimplexId, 3>>>::iterator iter;
496 for(iter = nodeTriangles.begin(); iter != nodeTriangles.end(); iter++) {
499 if(exnode->internalTriangleMap_.empty())
501 for(std::array<SimplexId, 3>
const triangleVec : iter->second) {
502 (nodePtr->externalTriangleMap_)[triangleVec]
503 = exnode->internalTriangleMap_.at(triangleVec)
509 for(std::array<SimplexId, 3>
const triangleVec : iter->second) {
510 (nodePtr->externalTriangleMap_)[triangleVec]
511 = tmpCluster.internalTriangleMap_.at(triangleVec)
648#ifndef TTK_ENABLE_KAMIKAZE
649 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
653 std::vector<std::vector<SimplexId>> localCellNeighbors(
656 std::vector<std::vector<SimplexId>> localVertexStars;
658 if(nodePtr->vertexStars_.
empty()) {
662 nodePtr->vertexStars_.
copyTo(localVertexStars);
663 for(
size_t i = 0; i < localVertexStars.size(); i++) {
664 sort(localVertexStars[i].
begin(), localVertexStars[i].
end());
667 boost::unordered_map<SimplexId, std::vector<std::vector<SimplexId>>> nodeMaps;
670 for(
SimplexId j = 1; j < verticesPerCell; j++) {
674 if(nodeMaps.find(nodeId) == nodeMaps.end()) {
678 std::vector<std::vector<SimplexId>> tmpVec;
679 newNode.vertexStars_.
copyTo(tmpVec);
680 for(
size_t i = 0; i < tmpVec.size(); i++) {
681 sort(tmpVec[i].
begin(), tmpVec[i].
end());
683 nodeMaps[nodeId] = tmpVec;
699 std::vector<SimplexId> stars0, stars1;
701 stars0 = localVertexStars[localV0];
707 stars1 = localVertexStars[localV1];
720 if(stars1[pos1] > biggest) {
721 biggest = stars1[pos1];
725 if(stars0[l] < biggest) {
732 if(stars1[l] < biggest) {
743 if(stars0[pos0] == stars1[pos1]) {
744 if(stars0[pos0] != cid) {
745 intersection = stars0[pos0];
753 if(intersection != -1) {
755 .push_back(intersection);
775 std::vector<SimplexId> stars0, stars1, stars2;
777 stars0 = localVertexStars[localV0];
783 stars1 = localVertexStars[localV1];
789 stars2 = localVertexStars[localV2];
804 if(stars1[pos1] > biggest) {
805 biggest = stars1[pos1];
807 if(stars2[pos2] > biggest) {
808 biggest = stars2[pos2];
812 if(stars0[l] < biggest) {
819 if(stars1[l] < biggest) {
826 if(stars2[l] < biggest) {
838 if((stars0[pos0] == stars1[pos1]) && (stars0[pos0] == stars2[pos2])) {
839 if(stars0[pos0] != cid) {
840 intersection = stars0[pos0];
849 if(intersection != -1) {
851 .push_back(intersection);
857 nodePtr->cellNeighbors_.
fillFrom(localCellNeighbors);
864#ifndef TTK_ENABLE_KAMIKAZE
865 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
870 boost::unordered_map<SimplexId, std::vector<std::vector<SimplexId>>>
873 nodePtr->tetraTriangles_ = std::vector<std::array<SimplexId, 4>>(
876 if(nodePtr->internalTriangleMap_.empty()) {
882 std::array<SimplexId, 3> triangleVec;
884 triangleVec[0] =
cellArray_->getCellVertex(i, 0);
885 for(
SimplexId k = 1; k < verticesPerCell - 1; k++) {
886 triangleVec[1] =
cellArray_->getCellVertex(i, k);
887 for(
SimplexId l = k + 1; l < verticesPerCell; l++) {
888 triangleVec[2] =
cellArray_->getCellVertex(i, l);
889 (nodePtr->tetraTriangles_)[i -
cellIntervals_[nodePtr->nid - 1] - 1]
891 = nodePtr->internalTriangleMap_.at(triangleVec)
896 triangleVec[0] =
cellArray_->getCellVertex(i, 1);
897 triangleVec[1] =
cellArray_->getCellVertex(i, 2);
898 triangleVec[2] =
cellArray_->getCellVertex(i, 3);
900 (nodePtr->tetraTriangles_)[i -
cellIntervals_[nodePtr->nid - 1] - 1]
902 = nodePtr->internalTriangleMap_.at(triangleVec)
905 std::vector<SimplexId>
const triangleTuple
906 = {i, triangleVec[0], triangleVec[1], triangleVec[2]};
908 nodeTriangles[nodeNum].push_back(triangleTuple);
912 for(
auto iter = nodeTriangles.begin(); iter != nodeTriangles.end(); iter++) {
915 if(exnode->internalTriangleMap_.empty())
917 for(std::vector<SimplexId> triangleVec : iter->second) {
918 std::array<SimplexId, 3>
const triangle
919 = {triangleVec[1], triangleVec[2], triangleVec[3]};
920 (nodePtr->tetraTriangles_)[triangleVec[0]
923 = exnode->internalTriangleMap_.at(triangle)
929 for(std::vector<SimplexId> triangleVec : iter->second) {
930 std::array<SimplexId, 3>
const triangle
931 = {triangleVec[1], triangleVec[2], triangleVec[3]};
932 (nodePtr->tetraTriangles_)[triangleVec[0]
935 = tmpCluster.internalTriangleMap_.at(triangle)
947#ifndef TTK_ENABLE_KAMIKAZE
948 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
954 std::vector<SimplexId> offsets(localEdgeNum + 1, 0),
955 linksCount(localEdgeNum, 0);
958 if(nodePtr->edgeStars_.
empty()) {
962 boost::unordered_map<std::array<SimplexId, 2>,
SimplexId>::const_iterator
964 for(iter = nodePtr->internalEdgeMap_.begin();
965 iter != nodePtr->internalEdgeMap_.end(); iter++) {
966 for(
SimplexId j = 0; j < nodePtr->edgeStars_.
size(iter->second - 1);
968 SimplexId const cellId = nodePtr->edgeStars_.
get(iter->second - 1, j);
969 for(
int k = 0; k < 3; k++) {
971 if((vertexId != iter->first[0]) && (vertexId != iter->first[1])) {
972 offsets[iter->second]++;
980 for(
SimplexId i = 1; i <= localEdgeNum; i++) {
981 offsets[i] += offsets[i - 1];
985 std::vector<SimplexId> edgeLinkData(offsets.back());
988 for(iter = nodePtr->internalEdgeMap_.begin();
989 iter != nodePtr->internalEdgeMap_.end(); iter++) {
990 for(
SimplexId j = 0; j < nodePtr->edgeStars_.
size(iter->second - 1);
992 SimplexId const cellId = nodePtr->edgeStars_.
get(iter->second - 1, j);
993 for(
int k = 0; k < 3; k++) {
995 if((vertexId != iter->first[0]) && (vertexId != iter->first[1])) {
996 SimplexId const localEdgeId = iter->second - 1;
997 edgeLinkData[offsets[localEdgeId] + linksCount[localEdgeId]]
999 linksCount[localEdgeId]++;
1007 nodePtr->edgeLinks_.
setData(std::move(edgeLinkData), std::move(offsets));
1009 if(nodePtr->tetraEdges_.empty()) {
1012 if(nodePtr->internalEdgeMap_.empty()) {
1019 for(
SimplexId cid = 0; cid < localCellNum; cid++) {
1021 std::array<SimplexId, 4> vertexIds
1026 std::array<SimplexId, 2> edgePair;
1027 edgePair[0] = vertexIds[0];
1029 edgePair[1] = vertexIds[j];
1030 offsets[nodePtr->internalEdgeMap_.at(edgePair)]++;
1033 edgePair[0] = vertexIds[1];
1034 for(
int j = 2; j < 4; j++) {
1035 edgePair[1] = vertexIds[j];
1036 offsets[nodePtr->internalEdgeMap_.at(edgePair)]++;
1039 edgePair = {vertexIds[2], vertexIds[3]};
1040 offsets[nodePtr->internalEdgeMap_.at(edgePair)]++;
1047 std::array<SimplexId, 2> edgeIds;
1048 std::array<SimplexId, 4> vertexIds
1057 edgeIds[0] = vertexIds[j];
1058 edgeIds[1] = vertexIds[k];
1063 offsets[nodePtr->internalEdgeMap_.at(edgeIds)]++;
1070 for(
SimplexId i = 1; i <= localEdgeNum; i++) {
1071 offsets[i] += offsets[i - 1];
1075 std::vector<SimplexId> edgeLinkData(offsets.back());
1078 for(
SimplexId cid = 0; cid < localCellNum; cid++) {
1080 std::array<SimplexId, 4> vertexIds
1085 std::array<SimplexId, 2> edgePair;
1086 edgePair[0] = vertexIds[0];
1088 edgePair[1] = vertexIds[j];
1090 = nodePtr->internalEdgeMap_.at(edgePair) - 1;
1091 edgeLinkData[offsets[localEdgeId] + linksCount[localEdgeId]]
1092 = nodePtr->tetraEdges_.at(cid)[6 - j];
1093 linksCount[localEdgeId]++;
1096 edgePair[0] = vertexIds[1];
1097 for(
int j = 2; j < 4; j++) {
1098 edgePair[1] = vertexIds[j];
1100 = nodePtr->internalEdgeMap_.at(edgePair) - 1;
1101 edgeLinkData[offsets[localEdgeId] + linksCount[localEdgeId]]
1102 = nodePtr->tetraEdges_.at(cid)[4 - j];
1103 linksCount[localEdgeId]++;
1106 edgePair = {vertexIds[2], vertexIds[3]};
1108 = nodePtr->internalEdgeMap_.at(edgePair) - 1;
1109 edgeLinkData[offsets[localEdgeId] + linksCount[localEdgeId]]
1110 = nodePtr->tetraEdges_.at(cid)[0];
1111 linksCount[localEdgeId]++;
1117 boost::unordered_map<SimplexId, ImplicitCluster> nodeMaps;
1119 std::array<SimplexId, 4> vertexIds
1125 std::array<SimplexId, 2> edgeIds;
1129 edgeIds[0] = vertexIds[j];
1130 edgeIds[1] = vertexIds[k];
1135 std::array<SimplexId, 2> otherEdge = {-1, -1};
1136 for(
int i = 0; i < 4; i++) {
1137 if(vertexIds[i] != edgeIds[0] && vertexIds[i] != edgeIds[1]) {
1138 if(otherEdge[0] == -1) {
1139 otherEdge[0] = vertexIds[i];
1140 }
else if(otherEdge[1] == -1) {
1141 otherEdge[1] = vertexIds[i];
1143 printErr(
"[CompactTriangulation] More than two other "
1145 "found in the edge!\n");
1150 if(nodeMaps.find(nodeId) == nodeMaps.end()) {
1155 = nodePtr->internalEdgeMap_.at(edgeIds) - 1;
1156 edgeLinkData[offsets[localEdgeId] + linksCount[localEdgeId]]
1157 = nodeMaps[nodeId].internalEdgeMap_.at(otherEdge);
1158 linksCount[localEdgeId]++;
1165 nodePtr->edgeLinks_.
setData(std::move(edgeLinkData), std::move(offsets));
1174#ifndef TTK_ENABLE_KAMIKAZE
1175 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
1182 std::vector<SimplexId> offsets(localEdgeNum + 1, 0), starsCount(localEdgeNum);
1184 if(nodePtr->internalEdgeMap_.empty()) {
1192 std::array<SimplexId, 2> edgeIds;
1193 for(
SimplexId j = 0; j < verticesPerCell - 1; j++) {
1194 edgeIds[0] =
cellArray_->getCellVertex(cid, j);
1199 for(
SimplexId k = j + 1; k < verticesPerCell; k++) {
1200 edgeIds[1] =
cellArray_->getCellVertex(cid, k);
1201 offsets[nodePtr->internalEdgeMap_.at(edgeIds)]++;
1207 std::array<SimplexId, 2> edgeIds;
1208 for(
SimplexId j = 0; j < verticesPerCell - 1; j++) {
1209 for(
SimplexId k = j + 1; k < verticesPerCell; k++) {
1210 edgeIds[0] =
cellArray_->getCellVertex(cid, j);
1211 edgeIds[1] =
cellArray_->getCellVertex(cid, k);
1214 offsets[nodePtr->internalEdgeMap_.at(edgeIds)]++;
1221 for(
SimplexId i = 1; i <= localEdgeNum; i++) {
1222 offsets[i] += offsets[i - 1];
1226 std::vector<SimplexId> edgeStarData(offsets.back());
1232 std::array<SimplexId, 2> edgeIds;
1233 for(
SimplexId j = 0; j < verticesPerCell - 1; j++) {
1234 edgeIds[0] =
cellArray_->getCellVertex(cid, j);
1239 for(
SimplexId k = j + 1; k < verticesPerCell; k++) {
1240 edgeIds[1] =
cellArray_->getCellVertex(cid, k);
1241 SimplexId const localEdgeId = nodePtr->internalEdgeMap_.at(edgeIds) - 1;
1242 edgeStarData[offsets[localEdgeId] + starsCount[localEdgeId]] = cid;
1243 starsCount[localEdgeId]++;
1249 std::array<SimplexId, 2> edgeIds;
1250 for(
SimplexId j = 0; j < verticesPerCell - 1; j++) {
1251 for(
SimplexId k = j + 1; k < verticesPerCell; k++) {
1252 edgeIds[0] =
cellArray_->getCellVertex(cid, j);
1253 edgeIds[1] =
cellArray_->getCellVertex(cid, k);
1257 = nodePtr->internalEdgeMap_.at(edgeIds) - 1;
1258 edgeStarData[offsets[localEdgeId] + starsCount[localEdgeId]] = cid;
1259 starsCount[localEdgeId]++;
1266 nodePtr->edgeStars_.
setData(std::move(edgeStarData), std::move(offsets));
1274#ifndef TTK_ENABLE_KAMIKAZE
1275 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
1281 std::vector<SimplexId> offsets(localEdgeNum + 1, 0),
1282 trianglesCount(localEdgeNum, 0);
1284 if(nodePtr->internalEdgeMap_.empty()) {
1287 if(nodePtr->internalTriangleMap_.empty()) {
1290 if(nodePtr->externalTriangleMap_.empty()) {
1295 boost::unordered_map<std::array<SimplexId, 3>,
SimplexId>::iterator iter;
1296 for(iter = nodePtr->internalTriangleMap_.begin();
1297 iter != nodePtr->internalTriangleMap_.end(); iter++) {
1298 std::array<SimplexId, 2> edge1 = {iter->first[0], iter->first[1]};
1299 std::array<SimplexId, 2>
const edge2 = {iter->first[0], iter->first[2]};
1300 offsets[nodePtr->internalEdgeMap_.at(edge1)]++;
1301 offsets[nodePtr->internalEdgeMap_.at(edge2)]++;
1303 edge1 = {iter->first[1], iter->first[2]};
1304 offsets[nodePtr->internalEdgeMap_.at(edge1)]++;
1307 for(iter = nodePtr->externalTriangleMap_.begin();
1308 iter != nodePtr->externalTriangleMap_.end(); iter++) {
1309 std::array<SimplexId, 2> edge = {iter->first.at(1), iter->first.at(2)};
1312 offsets[nodePtr->internalEdgeMap_.at(edge)]++;
1317 for(
SimplexId i = 1; i <= localEdgeNum; i++) {
1318 offsets[i] += offsets[i - 1];
1322 std::vector<SimplexId> edgeTriangleData(offsets.back());
1325 for(iter = nodePtr->internalTriangleMap_.begin();
1326 iter != nodePtr->internalTriangleMap_.end(); iter++) {
1327 std::array<SimplexId, 2> edge1 = {iter->first[0], iter->first[1]};
1328 std::array<SimplexId, 2>
const edge2 = {iter->first[0], iter->first[2]};
1329 SimplexId localEdgeId = nodePtr->internalEdgeMap_.at(edge1) - 1;
1330 edgeTriangleData[offsets[localEdgeId] + trianglesCount[localEdgeId]]
1332 trianglesCount[localEdgeId]++;
1333 localEdgeId = nodePtr->internalEdgeMap_.at(edge2) - 1;
1334 edgeTriangleData[offsets[localEdgeId] + trianglesCount[localEdgeId]]
1336 trianglesCount[localEdgeId]++;
1339 edge1 = {iter->first[1], iter->first[2]};
1340 localEdgeId = nodePtr->internalEdgeMap_.at(edge1) - 1;
1341 edgeTriangleData[offsets[localEdgeId] + trianglesCount[localEdgeId]]
1343 trianglesCount[localEdgeId]++;
1348 for(iter = nodePtr->externalTriangleMap_.begin();
1349 iter != nodePtr->externalTriangleMap_.end(); iter++) {
1350 std::array<SimplexId, 2> edge = {iter->first.at(1), iter->first.at(2)};
1353 SimplexId const localEdgeId = nodePtr->internalEdgeMap_.at(edge) - 1;
1354 edgeTriangleData[offsets[localEdgeId] + trianglesCount[localEdgeId]]
1356 trianglesCount[localEdgeId]++;
1361 nodePtr->edgeTriangles_.
setData(
1362 std::move(edgeTriangleData), std::move(offsets));
1370#ifndef TTK_ENABLE_KAMIKAZE
1371 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
1376 nodePtr->tetraEdges_ = std::vector<std::array<SimplexId, 6>>(
1378 boost::unordered_map<SimplexId, std::vector<std::vector<SimplexId>>>
1381 if(nodePtr->internalEdgeMap_.empty()) {
1389 for(
SimplexId k = 1; k < verticesPerCell; k++) {
1390 std::array<SimplexId, 2>
const edgePair
1393 (nodePtr->tetraEdges_)[i -
cellIntervals_[nodePtr->nid - 1] - 1][cnt++]
1394 = nodePtr->internalEdgeMap_.at(edgePair)
1397 for(
SimplexId j = 1; j < verticesPerCell - 1; j++) {
1398 for(
SimplexId k = j + 1; k < verticesPerCell; k++) {
1399 std::array<SimplexId, 2> edgePair
1405 = nodePtr->internalEdgeMap_.at(edgePair)
1410 std::vector<SimplexId>
const edgeTuple{
1411 i, cnt++, edgePair[0], edgePair[1]};
1413 edgeNodes[nodeNum].push_back(edgeTuple);
1419 for(
auto iter = edgeNodes.begin(); iter != edgeNodes.end(); iter++) {
1422 if(exnode->internalEdgeMap_.empty())
1424 for(std::vector<SimplexId> edgeTuple : iter->second) {
1425 std::array<SimplexId, 2>
const edgePair = {edgeTuple[2], edgeTuple[3]};
1426 (nodePtr->tetraEdges_)[edgeTuple[0] -
cellIntervals_[nodePtr->nid - 1]
1428 = exnode->internalEdgeMap_.at(edgePair)
1434 for(std::vector<SimplexId> edgeTuple : iter->second) {
1435 std::array<SimplexId, 2>
const edgePair = {edgeTuple[2], edgeTuple[3]};
1436 (nodePtr->tetraEdges_)[edgeTuple[0] -
cellIntervals_[nodePtr->nid - 1]
1438 = tmpCluster.internalEdgeMap_.at(edgePair)
1450#ifndef TTK_ENABLE_KAMIKAZE
1451 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
1454 nodePtr->triangleEdges_ = std::vector<std::array<SimplexId, 3>>(
1456 boost::unordered_map<SimplexId, std::vector<std::vector<SimplexId>>>
1459 if(nodePtr->internalEdgeMap_.empty()) {
1467 std::array<SimplexId, 2> edgePair
1470 (nodePtr->triangleEdges_)[i -
cellIntervals_[nodePtr->nid - 1] - 1][0]
1471 = nodePtr->internalEdgeMap_.at(edgePair)
1474 edgePair[1] =
cellArray_->getCellVertex(i, 2);
1475 (nodePtr->triangleEdges_)[i -
cellIntervals_[nodePtr->nid - 1] - 1][1]
1476 = nodePtr->internalEdgeMap_.at(edgePair)
1479 edgePair[0] =
cellArray_->getCellVertex(i, 1);
1481 (nodePtr->triangleEdges_)[i -
cellIntervals_[nodePtr->nid - 1] - 1][2]
1482 = nodePtr->internalEdgeMap_.at(edgePair)
1487 std::vector<SimplexId>
const edgeTuple{i, edgePair[0], edgePair[1]};
1489 edgeNodes[nodeNum].push_back(edgeTuple);
1493 for(
auto iter = edgeNodes.begin(); iter != edgeNodes.end(); iter++) {
1496 if(exnode->internalEdgeMap_.empty())
1498 for(std::vector<SimplexId> edgeTuple : iter->second) {
1499 std::array<SimplexId, 2>
const edgePair
1500 = {edgeTuple[1], edgeTuple[2]};
1501 (nodePtr->triangleEdges_)[edgeTuple[0]
1503 = exnode->internalEdgeMap_.at(edgePair)
1509 for(std::vector<SimplexId> edgeTuple : iter->second) {
1510 std::array<SimplexId, 2>
const edgePair
1511 = {edgeTuple[1], edgeTuple[2]};
1512 (nodePtr->triangleEdges_)[edgeTuple[0]
1514 = tmpCluster.internalEdgeMap_.at(edgePair)
1520 if(nodePtr->internalTriangleMap_.empty()) {
1524 for(
auto iter = nodePtr->internalTriangleMap_.begin();
1525 iter != nodePtr->internalTriangleMap_.end(); iter++) {
1527 std::array<SimplexId, 2> edgePair = {iter->first[0], iter->first[1]};
1528 (nodePtr->triangleEdges_)[iter->second - 1][0]
1529 = nodePtr->internalEdgeMap_.at(edgePair)
1531 edgePair[1] = iter->first[2];
1532 (nodePtr->triangleEdges_)[iter->second - 1][1]
1533 = nodePtr->internalEdgeMap_.at(edgePair)
1535 edgePair[0] = iter->first[1];
1538 (nodePtr->triangleEdges_)[iter->second - 1][2]
1539 = nodePtr->internalEdgeMap_.at(edgePair)
1542 std::vector<SimplexId>
const edgeTuple{
1543 iter->second - 1, edgePair[0], edgePair[1]};
1545 edgeNodes[nodeNum].push_back(edgeTuple);
1549 for(
auto iter = edgeNodes.begin(); iter != edgeNodes.end(); iter++) {
1552 if(exnode->internalEdgeMap_.empty())
1554 for(std::vector<SimplexId> edgeTuple : iter->second) {
1555 std::array<SimplexId, 2>
const edgePair
1556 = {edgeTuple[1], edgeTuple[2]};
1557 (nodePtr->triangleEdges_)[edgeTuple[0]][2]
1558 = exnode->internalEdgeMap_.at(edgePair)
1564 for(std::vector<SimplexId> edgeTuple : iter->second) {
1565 std::array<SimplexId, 2>
const edgePair
1566 = {edgeTuple[1], edgeTuple[2]};
1567 (nodePtr->triangleEdges_)[edgeTuple[0]][2]
1568 = tmpCluster.internalEdgeMap_.at(edgePair)
1581#ifndef TTK_ENABLE_KAMIKAZE
1582 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
1588 std::vector<SimplexId> offsets(localTriangleNum + 1, 0),
1589 linksCount(localTriangleNum, 0);
1591 if(nodePtr->triangleStars_.
empty()) {
1596 boost::unordered_map<std::array<SimplexId, 3>,
SimplexId>::const_iterator
1598 for(iter = nodePtr->internalTriangleMap_.begin();
1599 iter != nodePtr->internalTriangleMap_.end(); iter++) {
1600 for(
SimplexId i = 0; i < nodePtr->triangleStars_.
size(iter->second - 1);
1602 SimplexId const cellId = nodePtr->triangleStars_.
get(iter->second - 1, i);
1603 for(
int j = 0; j < 4; j++) {
1605 if((vertexId != iter->first[0]) && (vertexId != iter->first[1])
1606 && (vertexId != iter->first[2])) {
1607 offsets[iter->second]++;
1615 for(
SimplexId i = 1; i <= localTriangleNum; i++) {
1616 offsets[i] += offsets[i - 1];
1620 std::vector<SimplexId> triangleLinkData(offsets.back());
1623 for(iter = nodePtr->internalTriangleMap_.begin();
1624 iter != nodePtr->internalTriangleMap_.end(); iter++) {
1625 for(
SimplexId i = 0; i < nodePtr->triangleStars_.
size(iter->second - 1);
1627 SimplexId const cellId = nodePtr->triangleStars_.
get(iter->second - 1, i);
1628 for(
int j = 0; j < 4; j++) {
1630 if((vertexId != iter->first[0]) && (vertexId != iter->first[1])
1631 && (vertexId != iter->first[2])) {
1632 triangleLinkData[offsets[iter->second - 1]
1633 + linksCount[iter->second - 1]]
1635 linksCount[iter->second - 1]++;
1643 nodePtr->triangleLinks_.
setData(
1644 std::move(triangleLinkData), std::move(offsets));
1652#ifndef TTK_ENABLE_KAMIKAZE
1653 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
1660 std::vector<SimplexId> offsets(localTriangleNum + 1, 0),
1661 starsCount(localTriangleNum, 0);
1663 if(nodePtr->internalTriangleMap_.empty()) {
1671 std::array<SimplexId, 3> triangleIds;
1672 for(
SimplexId j = 0; j < verticesPerCell - 2; j++) {
1673 triangleIds[0] =
cellArray_->getCellVertex(cid, j);
1677 for(
SimplexId k = j + 1; k < verticesPerCell - 1; k++) {
1678 for(
SimplexId l = k + 1; l < verticesPerCell; l++) {
1679 triangleIds[1] =
cellArray_->getCellVertex(cid, k);
1680 triangleIds[2] =
cellArray_->getCellVertex(cid, l);
1681 offsets[nodePtr->internalTriangleMap_.at(triangleIds)]++;
1688 std::array<SimplexId, 3> triangleIds;
1689 for(
SimplexId j = 0; j < verticesPerCell - 2; j++) {
1690 triangleIds[0] =
cellArray_->getCellVertex(cid, j);
1693 for(
SimplexId k = j + 1; k < verticesPerCell - 1; k++) {
1694 for(
SimplexId l = k + 1; l < verticesPerCell; l++) {
1695 triangleIds[1] =
cellArray_->getCellVertex(cid, k);
1696 triangleIds[2] =
cellArray_->getCellVertex(cid, l);
1697 offsets[nodePtr->internalTriangleMap_.at(triangleIds)]++;
1705 for(
SimplexId i = 1; i <= localTriangleNum; i++) {
1706 offsets[i] += offsets[i - 1];
1710 std::vector<SimplexId> triangleStarData(offsets.back());
1716 std::array<SimplexId, 3> triangleIds;
1717 for(
SimplexId j = 0; j < verticesPerCell - 2; j++) {
1718 triangleIds[0] =
cellArray_->getCellVertex(cid, j);
1723 for(
SimplexId k = j + 1; k < verticesPerCell - 1; k++) {
1724 for(
SimplexId l = k + 1; l < verticesPerCell; l++) {
1725 triangleIds[1] =
cellArray_->getCellVertex(cid, k);
1726 triangleIds[2] =
cellArray_->getCellVertex(cid, l);
1728 = nodePtr->internalTriangleMap_.at(triangleIds) - 1;
1729 triangleStarData[offsets[localTriangleId]
1730 + starsCount[localTriangleId]]
1732 starsCount[localTriangleId]++;
1739 std::array<SimplexId, 3> triangleIds;
1742 for(
SimplexId j = 0; j < verticesPerCell - 2; j++) {
1743 triangleIds[0] =
cellArray_->getCellVertex(cid, j);
1746 for(
SimplexId k = j + 1; k < verticesPerCell - 1; k++) {
1747 for(
SimplexId l = k + 1; l < verticesPerCell; l++) {
1748 triangleIds[1] =
cellArray_->getCellVertex(cid, k);
1749 triangleIds[2] =
cellArray_->getCellVertex(cid, l);
1751 = nodePtr->internalTriangleMap_.at(triangleIds) - 1;
1752 triangleStarData[offsets[localTriangleId]
1753 + starsCount[localTriangleId]]
1755 starsCount[localTriangleId]++;
1763 nodePtr->triangleStars_.
setData(
1764 std::move(triangleStarData), std::move(offsets));
1772#ifndef TTK_ENABLE_KAMIKAZE
1773 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
1779 std::vector<SimplexId> offsets(localVertexNum + 1, 0),
1780 edgesCount(localVertexNum, 0);
1782 if(nodePtr->internalEdgeMap_.empty()) {
1785 if(nodePtr->externalEdgeMap_.empty()) {
1790 boost::unordered_map<std::array<SimplexId, 2>,
SimplexId>::iterator iter;
1791 for(iter = nodePtr->internalEdgeMap_.begin();
1792 iter != nodePtr->internalEdgeMap_.end(); iter++) {
1798 for(iter = nodePtr->externalEdgeMap_.begin();
1799 iter != nodePtr->externalEdgeMap_.end(); iter++) {
1803 for(
SimplexId i = 1; i <= localVertexNum; i++) {
1804 offsets[i] += offsets[i - 1];
1808 std::vector<SimplexId> vertexEdgeData(offsets.back());
1811 for(iter = nodePtr->internalEdgeMap_.begin();
1812 iter != nodePtr->internalEdgeMap_.end(); iter++) {
1815 vertexEdgeData[offsets[localVertexId] + edgesCount[localVertexId]]
1817 edgesCount[localVertexId]++;
1820 vertexEdgeData[offsets[localVertexId] + edgesCount[localVertexId]]
1822 edgesCount[localVertexId]++;
1825 for(iter = nodePtr->externalEdgeMap_.begin();
1826 iter != nodePtr->externalEdgeMap_.end(); iter++) {
1829 vertexEdgeData[offsets[localVertexId] + edgesCount[localVertexId]]
1831 edgesCount[localVertexId]++;
1835 nodePtr->vertexEdges_.
setData(std::move(vertexEdgeData), std::move(offsets));
1843#ifndef TTK_ENABLE_KAMIKAZE
1844 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
1850 std::vector<SimplexId> offsets(localVertexNum + 1, 0),
1851 linksCount(localVertexNum, 0);
1852 boost::unordered_map<SimplexId, ImplicitCluster> nodeMaps;
1855 if(nodePtr->internalEdgeMap_.empty()) {
1883 for(
SimplexId i = 1; i <= localVertexNum; i++) {
1884 offsets[i] += offsets[i - 1];
1888 std::vector<SimplexId> vertexLinkData(offsets.back());
1893 std::array<SimplexId, 3> vertexIds
1898 std::array<SimplexId, 2> edgePair = {vertexIds[1], vertexIds[2]};
1900 if(nodeMaps.find(nodeId) == nodeMaps.end()) {
1906 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
1907 = nodeMaps[nodeId].internalEdgeMap_.at(edgePair)
1909 linksCount[localVertexId]++;
1912 edgePair[0] = vertexIds[0];
1914 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
1915 = nodePtr->internalEdgeMap_.at(edgePair)
1917 linksCount[localVertexId]++;
1920 edgePair[1] = vertexIds[1];
1921 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
1922 = nodePtr->internalEdgeMap_.at(edgePair)
1924 linksCount[localVertexId]++;
1929 std::array<SimplexId, 3> vertexIds
1933 std::array<SimplexId, 2> edgePair = {vertexIds[0], vertexIds[2]};
1935 if(nodeMaps.find(nodeId) == nodeMaps.end()) {
1943 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
1944 = nodeMaps[nodeId].internalEdgeMap_.at(edgePair)
1946 linksCount[localVertexId]++;
1950 edgePair[1] = vertexIds[1];
1952 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
1953 = nodeMaps[nodeId].internalEdgeMap_.at(edgePair)
1955 linksCount[localVertexId]++;
1960 nodePtr->vertexLinks_.
setData(
1961 std::move(vertexLinkData), std::move(offsets));
1966 if(nodePtr->internalTriangleMap_.empty()) {
1994 for(
SimplexId i = 1; i <= localVertexNum; i++) {
1995 offsets[i] += offsets[i - 1];
1999 std::vector<SimplexId> vertexLinkData(offsets.back());
2004 std::array<SimplexId, 4> vertexIds
2011 std::array<SimplexId, 3> triangleVec
2012 = {vertexIds[1], vertexIds[2], vertexIds[3]};
2014 if(nodeMaps.find(nodeId) == nodeMaps.end()) {
2020 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
2021 = nodeMaps[nodeId].internalTriangleMap_.at(triangleVec)
2023 linksCount[localVertexId]++;
2026 triangleVec[0] = vertexIds[0];
2028 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
2029 = nodePtr->internalTriangleMap_.at(triangleVec)
2031 linksCount[localVertexId]++;
2034 triangleVec[1] = vertexIds[1];
2036 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
2037 = nodePtr->internalTriangleMap_.at(triangleVec)
2039 linksCount[localVertexId]++;
2043 triangleVec[2] = vertexIds[2];
2045 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
2046 = nodePtr->internalTriangleMap_.at(triangleVec)
2048 linksCount[localVertexId]++;
2055 std::array<SimplexId, 4> vertexIds
2061 std::array<SimplexId, 3> triangleVec
2062 = {vertexIds[0], vertexIds[2], vertexIds[3]};
2064 if(nodeMaps.find(nodeId) == nodeMaps.end()) {
2072 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
2073 = nodeMaps[nodeId].internalTriangleMap_.at(triangleVec)
2075 linksCount[localVertexId]++;
2079 triangleVec[1] = vertexIds[1];
2081 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
2082 = nodeMaps[nodeId].internalTriangleMap_.at(triangleVec)
2084 linksCount[localVertexId]++;
2088 triangleVec[1] = vertexIds[1];
2089 triangleVec[2] = vertexIds[2];
2091 vertexLinkData[offsets[localVertexId] + linksCount[localVertexId]]
2092 = nodeMaps[nodeId].internalTriangleMap_.at(triangleVec)
2094 linksCount[localVertexId]++;
2099 nodePtr->vertexLinks_.
setData(
2100 std::move(vertexLinkData), std::move(offsets));
2109#ifndef TTK_ENABLE_KAMIKAZE
2110 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
2117 std::vector<SimplexId> vertexNeighborData, offsets(localVertexNum + 1, 0);
2120 std::vector<boost::unordered_set<SimplexId>> vertexNeighborSet(
2126 for(
SimplexId j = 0; j < verticesPerCell - 1; j++) {
2129 for(
SimplexId k = j + 1; k < verticesPerCell; k++) {
2144 for(
SimplexId j = 0; j < verticesPerCell - 1; j++) {
2145 for(
SimplexId k = j + 1; k < verticesPerCell; k++) {
2160 for(
SimplexId i = 1; i <= localVertexNum; i++) {
2161 offsets[i] = offsets[i - 1] + vertexNeighborSet[i - 1].size();
2162 vertexNeighborData.insert(vertexNeighborData.end(),
2163 vertexNeighborSet[i - 1].begin(),
2164 vertexNeighborSet[i - 1].end());
2167 nodePtr->vertexNeighbors_.
setData(
2168 std::move(vertexNeighborData), std::move(offsets));
2175#ifndef TTK_ENABLE_KAMIKAZE
2176 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
2183 std::vector<SimplexId> offsets(localVertexNum + 1, 0),
2184 starsCount(localVertexNum, 0);
2191 for(
SimplexId j = 1; j < verticesPerCell; j++) {
2192 vertexId =
cellArray_->getCellVertex(cid, j);
2200 for(
SimplexId j = 1; j < verticesPerCell; j++) {
2210 for(
SimplexId i = 1; i <= localVertexNum; i++) {
2211 offsets[i] += offsets[i - 1];
2215 std::vector<SimplexId> vertexStarData(offsets.back());
2222 vertexStarData[offsets[localVertexId] + starsCount[localVertexId]] = cid;
2223 starsCount[localVertexId]++;
2224 for(
SimplexId j = 1; j < verticesPerCell; j++) {
2230 vertexStarData[offsets[localVertexId] + starsCount[localVertexId]]
2232 starsCount[localVertexId]++;
2237 for(
SimplexId j = 0; j < verticesPerCell; j++) {
2244 vertexStarData[offsets[localVertexId] + starsCount[localVertexId]]
2246 starsCount[localVertexId]++;
2252 nodePtr->vertexStars_.
setData(std::move(vertexStarData), std::move(offsets));
2260#ifndef TTK_ENABLE_KAMIKAZE
2261 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
2267 std::vector<SimplexId> offsets(localVertexNum + 1, 0),
2268 trianglesCount(localVertexNum, 0);
2270 if(nodePtr->internalTriangleMap_.empty()) {
2273 if(nodePtr->externalTriangleMap_.empty()) {
2278 boost::unordered_map<std::array<SimplexId, 3>,
SimplexId>::iterator iter;
2279 for(iter = nodePtr->internalTriangleMap_.begin();
2280 iter != nodePtr->internalTriangleMap_.end(); iter++) {
2287 for(iter = nodePtr->externalTriangleMap_.begin();
2288 iter != nodePtr->externalTriangleMap_.end(); iter++) {
2297 for(
SimplexId i = 1; i <= localVertexNum; i++) {
2298 offsets[i] += offsets[i - 1];
2302 std::vector<SimplexId> vertexTriangleData(offsets.back());
2305 for(iter = nodePtr->internalTriangleMap_.begin();
2306 iter != nodePtr->internalTriangleMap_.end(); iter++) {
2312 vertexTriangleData[offsets[localVertexId]
2313 + trianglesCount[localVertexId]]
2315 trianglesCount[localVertexId]++;
2319 for(iter = nodePtr->externalTriangleMap_.begin();
2320 iter != nodePtr->externalTriangleMap_.end(); iter++) {
2326 vertexTriangleData[offsets[localVertexId]
2327 + trianglesCount[localVertexId]]
2329 trianglesCount[localVertexId]++;
2335 nodePtr->vertexTriangles_.
setData(
2336 std::move(vertexTriangleData), std::move(offsets));
2344#ifndef TTK_ENABLE_KAMIKAZE
2345 if(nodePtr->nid <= 0 || nodePtr->nid >
nodeNumber_)
2352 if(nodePtr->boundaryEdges_.empty()) {
2353 nodePtr->boundaryEdges_ = std::vector<bool>(localEdgeNum,
false);
2354 if(nodePtr->edgeStars_.
empty()) {
2357 for(
SimplexId i = 0; i < localEdgeNum; i++) {
2358 if(nodePtr->edgeStars_.
size(i) == 1) {
2359 nodePtr->boundaryEdges_.at(i) =
true;
2364 if(dim == 0 && nodePtr->boundaryVertices_.empty()) {
2365 nodePtr->boundaryVertices_ = std::vector<bool>(
2368 if(nodePtr->externalEdgeMap_.empty()) {
2372 for(
auto iter = nodePtr->internalEdgeMap_.begin();
2373 iter != nodePtr->internalEdgeMap_.end(); iter++) {
2374 if((nodePtr->boundaryEdges_)[iter->second - 1]) {
2375 (nodePtr->boundaryVertices_)[iter->first[0]
2380 ->boundaryVertices_)[iter->first[1]
2387 boost::unordered_map<SimplexId, ImplicitCluster> nodeMaps;
2388 for(
auto iter = nodePtr->externalEdgeMap_.begin();
2389 iter != nodePtr->externalEdgeMap_.end(); iter++) {
2391 if(nodeMaps.find(nodeId) == nodeMaps.end()) {
2395 if((nodeMaps[nodeId]
2397 (nodePtr->boundaryVertices_)[iter->first[1]
2407 if(nodePtr->boundaryTriangles_.empty()) {
2408 nodePtr->boundaryTriangles_ = std::vector<bool>(localTriangleNum,
false);
2409 if(nodePtr->triangleStars_.
empty()) {
2412 for(
SimplexId i = 0; i < localTriangleNum; i++) {
2413 if(nodePtr->triangleStars_.
size(i) == 1) {
2414 (nodePtr->boundaryTriangles_)[i] =
true;
2419 if(dim == 1 && nodePtr->boundaryEdges_.empty()) {
2420 nodePtr->boundaryEdges_ = std::vector<bool>(
2422 if(nodePtr->externalTriangleMap_.empty()) {
2425 if(nodePtr->internalEdgeMap_.empty()) {
2429 for(
auto iter = nodePtr->internalTriangleMap_.begin();
2430 iter != nodePtr->internalTriangleMap_.end(); iter++) {
2431 if((nodePtr->boundaryTriangles_)[iter->second - 1]) {
2432 std::array<SimplexId, 2> edgePair = {iter->first[0], iter->first[1]};
2433 (nodePtr->boundaryEdges_)[nodePtr->internalEdgeMap_.at(edgePair) - 1]
2435 edgePair[1] = iter->first[2];
2436 (nodePtr->boundaryEdges_)[nodePtr->internalEdgeMap_.at(edgePair) - 1]
2439 edgePair[0] = iter->first[1];
2441 ->boundaryEdges_)[nodePtr->internalEdgeMap_.at(edgePair) - 1]
2447 boost::unordered_map<SimplexId, ImplicitCluster> nodeMaps;
2448 for(
auto iter = nodePtr->externalTriangleMap_.begin();
2449 iter != nodePtr->externalTriangleMap_.end(); iter++) {
2451 if(nodeMaps.find(nodeId) == nodeMaps.end()) {
2455 if((nodeMaps[nodeId]
2460 std::array<SimplexId, 2>
const edgePair
2461 = {iter->first[1], iter->first[2]};
2463 ->boundaryEdges_)[nodePtr->internalEdgeMap_.at(edgePair) - 1]
2471 else if(dim == 0 && nodePtr->boundaryVertices_.empty()) {
2472 nodePtr->boundaryVertices_ = std::vector<bool>(
2475 if(nodePtr->externalTriangleMap_.empty()) {
2479 for(
auto iter = nodePtr->internalTriangleMap_.begin();
2480 iter != nodePtr->internalTriangleMap_.end(); iter++) {
2481 if((nodePtr->boundaryTriangles_)[iter->second - 1]) {
2482 for(
int j = 0; j < 3; j++) {
2494 boost::unordered_map<SimplexId, ImplicitCluster> nodeMaps;
2495 for(
auto iter = nodePtr->externalTriangleMap_.begin();
2496 iter != nodePtr->externalTriangleMap_.end(); iter++) {
2498 if(nodeMaps.find(nodeId) == nodeMaps.end()) {
2503 if((nodeMaps[nodeId]
2509 ->boundaryVertices_)[iter->first[1]
2516 ->boundaryVertices_)[iter->first[2]