From b384b14bac4967588219c28b6b0ab0f1404984a4 Mon Sep 17 00:00:00 2001 From: graham Date: Fri, 8 Jan 2010 11:36:00 +0000 Subject: [PATCH] Removing commented out old edge based filtering mechanism. This commit is available for reference in future. --- .../conformalVoronoiMeshCalcDualMesh.C | 226 ------------------ 1 file changed, 226 deletions(-) diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C index 26e0436460..cd4de439fd 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C @@ -46,232 +46,6 @@ void Foam::conformalVoronoiMesh::calcDualMesh timeCheck(); - // ------> OLD, FOR REFERENCE - // // ~~~~~~~~~~~ removing short edges by indexing dual vertices ~~~~~~~~~~~~~~ - - // for - // ( - // Triangulation::Finite_cells_iterator cit = finite_cells_begin(); - // cit != finite_cells_end(); - // ++cit - // ) - // { - // cit->cellIndex() = -1; - // } - - // points.setSize(number_of_cells()); - - // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - // label dualVertI = 0; - - // // Scanning by number of short (dual) edges (nSE) attached to the - // // circumcentre of each Delaunay tet. A Delaunay tet may only have four - // // dual edges emanating from its circumcentre, assigning positions and - // // indices to those with 4 short edges attached first, then >= 3, then >= 2 - // // etc. - // for (label nSE = 4; nSE >= 0; nSE--) - // { - // Info<< nl << "Scanning for dual vertices with >= " - // << nSE - // << " short edges attached." << endl; - - // for - // ( - // Triangulation::Finite_cells_iterator cit = finite_cells_begin(); - // cit != finite_cells_end(); - // ++cit - // ) - // { - // // If the Delaunay tet has an index already then it has either - // // evaluated itself and taken action or has had its index dictated - // // by a neighbouring tet with more short edges attached. - - // if (cit->cellIndex() == -1) - // { - // point dualVertex = topoint(dual(cit)); - - // label shortEdges = 0; - - // List edgeIsShort(4, false); - - // List neighbourAlreadyIndexed(4, false); - - // // Loop over the four facets of the Delaunay tet - // for (label f = 0; f < 4; f++) - // { - // // Check that at least one of the vertices of the facet is - // // an internal or boundary point - // if - // ( - // cit->vertex(vertex_triple_index(f, 0))-> - // internalOrBoundaryPoint() - // || cit->vertex(vertex_triple_index(f, 1))-> - // internalOrBoundaryPoint() - // || cit->vertex(vertex_triple_index(f, 2))-> - // internalOrBoundaryPoint() - // ) - // { - // point neighDualVertex; - - // label cNI = cit->neighbor(f)->cellIndex(); - - // if (cNI == -1) - // { - // neighDualVertex = topoint(dual(cit->neighbor(f))); - // } - // else - // { - // neighDualVertex = points[cNI]; - // } - - // if - // ( - // magSqr(dualVertex - neighDualVertex) - // < sqr - // ( - // minimumEdgeLength - // ( - // 0.5*(dualVertex + neighDualVertex) - // ) - // ) - // ) - // { - // edgeIsShort[f] = true; - - // if (cNI > -1) - // { - // neighbourAlreadyIndexed[f] = true; - // } - - // shortEdges++; - // } - // } - // } - - // if (nSE == 0 && shortEdges == 0) - // { - // // Final iteration and no short edges are found, index - // // remaining dual vertices. - - // if - // ( - // cit->vertex(0)->internalOrBoundaryPoint() - // || cit->vertex(1)->internalOrBoundaryPoint() - // || cit->vertex(2)->internalOrBoundaryPoint() - // || cit->vertex(3)->internalOrBoundaryPoint() - // ) - // { - // cit->cellIndex() = dualVertI; - // points[dualVertI] = dualVertex; - // dualVertI++; - // } - // } - // else if - // ( - // shortEdges >= nSE - // ) - // { - // // Info<< neighbourAlreadyIndexed << ' ' - // // << edgeIsShort << endl; - - // label numUnindexedNeighbours = 1; - - // for (label f = 0; f < 4; f++) - // { - // if (edgeIsShort[f] && !neighbourAlreadyIndexed[f]) - // { - // dualVertex += topoint(dual(cit->neighbor(f))); - - // numUnindexedNeighbours++; - // } - // } - - // dualVertex /= numUnindexedNeighbours; - - // label nearestExistingIndex = -1; - - // point nearestIndexedNeighbourPos = vector::zero; - - // scalar minDistSqrToNearestIndexedNeighbour = VGREAT; - - // for (label f = 0; f < 4; f++) - // { - // if (edgeIsShort[f] && neighbourAlreadyIndexed[f]) - // { - // label cNI = cit->neighbor(f)->cellIndex(); - - // point indexedNeighbourPos = points[cNI]; - - // if - // ( - // magSqr(indexedNeighbourPos - dualVertex) - // < minDistSqrToNearestIndexedNeighbour - // ) - // { - // nearestExistingIndex = cNI; - - // nearestIndexedNeighbourPos = - // indexedNeighbourPos; - - // minDistSqrToNearestIndexedNeighbour = - // magSqr(indexedNeighbourPos - dualVertex); - // } - // } - // } - - // if - // ( - // nearestExistingIndex > -1 - // && minDistSqrToNearestIndexedNeighbour - // < sqr - // ( - // minimumEdgeLength - // ( - // 0.5*(nearestIndexedNeighbourPos + dualVertex) - // ) - // ) - // ) - // { - // points[nearestExistingIndex] = - // 0.5*(dualVertex + nearestIndexedNeighbourPos); - - // for (label f = 0; f < 4; f++) - // { - // if (edgeIsShort[f] && !neighbourAlreadyIndexed[f]) - // { - // cit->neighbor(f)->cellIndex() = - // nearestExistingIndex; - // } - // } - - // cit->cellIndex() = nearestExistingIndex; - // } - // else - // { - // for (label f = 0; f < 4; f++) - // { - // if (edgeIsShort[f] && !neighbourAlreadyIndexed[f]) - // { - // cit->neighbor(f)->cellIndex() = dualVertI; - // } - // } - - // cit->cellIndex() = dualVertI; - - // points[dualVertI] = dualVertex; - - // dualVertI++; - // } - // } - // } - // } - // } - - // points.setSize(dualVertI); - - // <------ OLD, FOR REFERENCE - // Dual cell indexing // Assign an index to the Delaunay vertices which will be the dual cell