From 66619e25253a47ae2cd32fd4bbfd53ef50cff7c5 Mon Sep 17 00:00:00 2001 From: graham Date: Fri, 8 Jan 2010 11:39:33 +0000 Subject: [PATCH] Removing commented out old 'consume face from longest edge based' collapse mechanism. This commit is available for reference in future. --- .../conformalVoronoiMeshCalcDualMesh.C | 234 ------------------ 1 file changed, 234 deletions(-) diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C index cd4de439fd..058d8101d4 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C @@ -702,240 +702,6 @@ Foam::label Foam::conformalVoronoiMesh::collapseFaces } } - // ------> OLD, FOR REFERENCE - - // scalar smallEdgeLengthCoeff = 1e-3; - // scalar smallFaceAreaCoeff = sqr(smallEdgeLengthCoeff); - // scalar collapseToEdgeCoeff = 0.02; - // scalar longestEdgeLengthRatio = 0.35; - - // for - // ( - // Triangulation::Finite_edges_iterator eit = finite_edges_begin(); - // eit != finite_edges_end(); - // ++eit - // ) - // { - // Cell_circulator ccStart = incident_cells(*eit); - // Cell_circulator cc = ccStart; - - // do - // { - // if (dualPtIndexMap.found(cc->cellIndex())) - // { - // // One of the points of this face has already been - // // collapsed this sweep, leave for next sweep - // continue; - // } - - // } while (++cc != ccStart); - - // Cell_handle c = eit->first; - // Vertex_handle vA = c->vertex(eit->second); - // Vertex_handle vB = c->vertex(eit->third); - - // if - // ( - // vA->internalOrBoundaryPoint() - // || vB->internalOrBoundaryPoint() - // ) - // { - // face dualFace = buildDualFace(eit); - - // if (dualFace.size() < 3) - // { - // // This face has been collapsed already - // continue; - // } - - // scalar area = dualFace.mag(pts); - - // scalar targetFaceSize = averageAnyCellSize(vA, vB); - // scalar targetArea = sqr(targetFaceSize); - - // if (area < smallFaceAreaCoeff*targetArea) - // { - // // Collapse the dual face - - // // Determine if the face should be collapsed to a line or a - // // point - - // const edgeList& eds = dualFace.edges(); - - // label longestEdgeI = -1; - - // scalar longestEdgeLength = -SMALL; - - // scalar perimeter = 0.0; - - // forAll(eds, edI) - // { - // scalar edgeLength = eds[edI].mag(pts); - - // perimeter += edgeLength; - - // if (edgeLength > longestEdgeLength) - // { - // longestEdgeI = edI; - - // longestEdgeLength = edgeLength; - // } - // } - - // if - // ( - // longestEdgeLength > collapseToEdgeCoeff*targetFaceSize - // && longestEdgeLength/perimeter > longestEdgeLengthRatio - // ) - // { - // // Collapse to edge - - // // Start at either end of the longest edge and consume the - // // rest of the points of the face - - // const edge& longestEd = eds[longestEdgeI]; - - // label longestEdStartPtI = longestEd.start(); - // label longestEdEndPtI = longestEd.end(); - - // label revEdI = longestEdgeI; - // label fwdEdI = longestEdgeI; - - // point revPt = pts[longestEdStartPtI]; - // point fwdPt = pts[longestEdEndPtI]; - - // dualPtIndexMap.insert(longestEdStartPtI, longestEdStartPtI); - // dualPtIndexMap.insert(longestEdEndPtI, longestEdEndPtI); - - // for (label fcI = 1; fcI <= label(eds.size()/2); fcI++) - // { - // revEdI = eds.rcIndex(revEdI); - // fwdEdI = eds.fcIndex(fwdEdI); - - // const edge& revEd = eds[revEdI]; - // const edge& fwdEd = eds[fwdEdI]; - - // if (fcI < label(eds.size()/2)) - // { - // revPt += pts[revEd.start()]; - // fwdPt += pts[fwdEd.end()]; - - // dualPtIndexMap.insert - // ( - // revEd.start(), - // longestEdStartPtI - // ); - - // dualPtIndexMap.insert - // ( - // fwdEd.end(), - // longestEdEndPtI - // ); - // } - // else - // { - // // Final circulation - - // if - // ( - // eds.size() % 2 == 1 - // && revEd.start() == fwdEd.end() - // ) - // { - // // Odd number of edges, give final point to - // // the edge direction that has the shorter - // // final edge - - // if (fwdEd.mag(pts) < revEd.mag(pts)) - // { - // fwdPt += pts[fwdEd.end()]; - - // dualPtIndexMap.insert - // ( - // fwdEd.end(), - // longestEdEndPtI - // ); - - // revPt /= fcI; - // fwdPt /= (fcI + 1); - // } - // else - // { - // revPt += pts[revEd.start()]; - - // dualPtIndexMap.insert - // ( - // revEd.start(), - // longestEdStartPtI - // ); - - // revPt /= (fcI + 1); - // fwdPt /= fcI; - // } - // } - // else if - // ( - // eds.size() % 2 == 0 - // && revEd.start() == fwdEd.start() - // && revEd.end() == fwdEd.end() - // ) - // { - // // Even number of edges - - // revPt /= fcI; - // fwdPt /= fcI; - // } - // else - // { - // FatalErrorIn - // ( - // "Foam::conformalVoronoiMesh::collapseFace" - // ) - // << "Face circulation failed for face " - // << dualFace << nl - // << exit(FatalError); - // } - // } - // } - - // // Move the position of the accumulated points - // pts[longestEdStartPtI] = revPt; - // pts[longestEdEndPtI] = fwdPt; - - // nCollapsedFaces++; - // } - // else if - // ( - // longestEdgeLength <= collapseToEdgeCoeff*targetFaceSize - // ) - // { - // // Collapse to point - - // point resultantPt = vector::zero; - - // label collapseToPtI = dualFace[0]; - - // forAll(dualFace, fPtI) - // { - // label ptI = dualFace[fPtI]; - - // resultantPt += pts[ptI]; - - // dualPtIndexMap.insert(ptI, collapseToPtI); - // } - - // resultantPt /= dualFace.size(); - - // pts[collapseToPtI] = resultantPt; - - // nCollapsedFaces++; - // } - // } - // } - // } - - // <------ OLD, FOR REFERENCE - return nCollapsedFaces; }