diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C index 0cc827f4cb..24c45c239b 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C @@ -516,9 +516,6 @@ void Foam::conformalVoronoiMesh::calcDualMesh wordList& patchTypes, wordList& patchNames, PtrList& patchDicts, - //labelList& patchSizes, - //labelList& patchStarts, - //labelList& procNeighbours, pointField& cellCentres, labelList& cellToDelaunayVertex, labelListList& patchToDelaunayVertex, @@ -566,9 +563,6 @@ void Foam::conformalVoronoiMesh::calcDualMesh patchTypes, patchNames, patchDicts, -// patchSizes, -// patchStarts, -// procNeighbours, patchToDelaunayVertex, // from patch face to Delaunay vertex (slavePp) boundaryFacesToRemove, false @@ -1246,6 +1240,8 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints // Do not create empty processor patches if (totalPatchSize > 0) { + patchDicts[p].set("transform", "coincidentFullMatch"); + patches[nValidPatches] = new processorPolyPatch ( patchNames[p], @@ -1773,6 +1769,31 @@ void Foam::conformalVoronoiMesh::indexDualVertices pts[cit->cellIndex()] = cit->dual(); } + if (cit->featurePointDualVertex()) + { + pointFromPoint dual = cit->dual(); + + pointIndexHit fpHit; + label featureHit; + + // Find nearest feature point and compare + geometryToConformTo_.findFeaturePointNearest + ( + dual, + sqr(targetCellSize(dual)), + fpHit, + featureHit + ); + + if (fpHit.hit()) + { + Info<< "Dual = " << dual << nl + << " Nearest = " << fpHit.hitPoint() << endl; + + pts[cit->cellIndex()] = fpHit.hitPoint(); + } + } + if (cit->boundaryDualVertex()) { if (cit->featureEdgeDualVertex()) @@ -1973,11 +1994,11 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches if (patchDicts[patchI].found("neighbProcNo")) { procNeighbours[patchI] = - ( - patchDicts[patchI].found("neighbProcNo") - ? readLabel(patchDicts[patchI].lookup("neighbProcNo")) - : -1 - ); + ( + patchDicts[patchI].found("neighbProcNo") + ? readLabel(patchDicts[patchI].lookup("neighbProcNo")) + : -1 + ); } } @@ -2449,7 +2470,6 @@ void Foam::conformalVoronoiMesh::addPatches { patchDicts[p].set("nFaces", patchFaces[p].size()); patchDicts[p].set("startFace", nInternalFaces + nBoundaryFaces); - patchDicts[p].set("transform", "noOrdering"); nBoundaryFaces += patchFaces[p].size(); } diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.H index dd53a86537..52135e8ffe 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.H +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.H @@ -220,6 +220,9 @@ public: //- A dual vertex on a feature edge will result from this Delaunay cell inline bool featureEdgeDualVertex() const; + //- A dual vertex on a feature point will result from this Delaunay cell + inline bool featurePointDualVertex() const; + inline bool nearProcBoundary() const; inline bool potentialCoplanarCell() const; diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellI.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellI.H index 83434ba2f1..30c65801e6 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellI.H +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -432,6 +432,19 @@ inline bool CGAL::indexedCell::featureEdgeDualVertex() const } +template +inline bool CGAL::indexedCell::featurePointDualVertex() const +{ + return + ( + this->vertex(0)->featurePoint() + && this->vertex(1)->featurePoint() + && this->vertex(2)->featurePoint() + && this->vertex(3)->featurePoint() + ); +} + + template inline bool CGAL::indexedCell::nearProcBoundary() const {