51 const extendedFeatureEdgeMesh& feMesh,
56 const labelList& edgeInormals = feMesh.edgeNormals()[edgeI];
57 const labelList& nextEdgeInormals = feMesh.edgeNormals()[nextEdgeI];
59 const vector& A1 = feMesh.normals()[edgeInormals[0]];
60 const vector& A2 = feMesh.normals()[edgeInormals[1]];
62 const vector& B1 = feMesh.normals()[nextEdgeInormals[0]];
63 const vector& B2 = feMesh.normals()[nextEdgeInormals[1]];
70 const scalar A1B1 =
mag((A1 & B1) - 1.0);
71 const scalar A1B2 =
mag((A1 & B2) - 1.0);
72 const scalar A2B1 =
mag((A2 & B1) - 1.0);
73 const scalar A2B2 =
mag((A2 & B2) - 1.0);
80 if (A1B1 < A1B2 && A1B1 < A2B1 && A1B1 < A2B2)
84 else if (A1B2 < A1B1 && A1B2 < A2B1 && A1B2 < A2B2)
88 else if (A2B1 < A1B1 && A2B1 < A1B2 && A2B1 < A2B2)
119 const DynamicList<Foam::point>& masterPoints,
120 const DynamicList<Foam::indexedVertexEnum::vertexType>& masterPointsTypes,
121 const Map<DynamicList<autoPtr<plane> > >& masterPointReflections,
122 DynamicList<Vb>& pts,
126 typedef DynamicList<autoPtr<plane> > planeDynList;
134 const vertexType masterType = masterPointsTypes[pI];
143 foamyHexMesh_.vertexCount() + pts.size(),
149 const label masterIndex = pts.last().index();
153 const planeDynList& masterPointPlanes = masterPointReflections[pI];
155 forAll(masterPointPlanes, planeI)
159 const plane& reflPlane = masterPointPlanes[planeI]();
161 const Foam::point slavePt = reflPlane.mirror(masterPt);
165 const vertexType slaveType =
167 masterType == Vb::vtInternalFeaturePoint
168 ? Vb::vtExternalFeaturePoint
169 : Vb::vtInternalFeaturePoint
177 foamyHexMesh_.vertexCount() + pts.size(),
183 ftPtPairs_.addPointPair
197 const extendedFeatureEdgeMesh& feMesh,
202 typedef DynamicList<autoPtr<plane> > planeDynList;
212 && !foamyHexMesh_.decomposition().positionOnThisProcessor(featPt)
214 || geometryToConformTo_.outside(featPt)
220 const scalar ppDist = foamyHexMesh_.pointPairDistance(featPt);
223 DynamicList<Foam::point> masterPoints;
224 DynamicList<vertexType> masterPointsTypes;
225 Map<planeDynList> masterPointReflections;
227 const labelList& featPtEdges = feMesh.featurePointEdges()[ptI];
229 pointFeatureEdgesTypes pointEdgeTypes(feMesh, ptI);
232 pointEdgeTypes.calcPointFeatureEdgesTypes();
236 ConstCirculator<labelList> circ(featPtEdges);
242 const edgeStatus eStatusCurr = feMesh.getEdgeStatus(circ());
257 const vector n = sharedFaceNormal(feMesh, circ(), circ.next());
259 const vector pointMotionDirection =
sign*0.5*ppDist*
n;
265 if (masterPoints.empty())
270 planeDynList firstPlane;
271 firstPlane.append(autoPtr<plane>(
new plane(featPt,
n)));
273 masterPoints.append(pt);
275 masterPointsTypes.append
278 ? Vb::vtExternalFeaturePoint
279 : Vb::vtInternalFeaturePoint
290 masterPointReflections.insert
292 masterPoints.size() - 1,
335 masterPoints.last() += pointMotionDirection;
337 masterPointReflections[masterPoints.size() - 1].append
339 autoPtr<plane>(
new plane(featPt,
n))
345 addMasterAndSlavePoints
349 masterPointReflections,
361 if (foamyHexMeshControls_.mixedFeaturePointPPDistanceCoeff() < 0)
364 <<
"Skipping specialised handling for mixed feature points" <<
endl;
369 const PtrList<extendedFeatureEdgeMesh>& feMeshes
371 geometryToConformTo_.features()
376 const extendedFeatureEdgeMesh& feMesh = feMeshes[i];
382 label ptI = feMesh.mixedStart();
383 ptI < feMesh.nonFeatureStart();
392 && !foamyHexMesh_.decomposition().positionOnThisProcessor(featPt))
397 const labelList& pEds = pointsEdges[ptI];
399 pointFeatureEdgesTypes pFEdgeTypes(feMesh, ptI);
402 pFEdgeTypes.calcPointFeatureEdgesTypes();
404 bool specialisedSuccess =
false;
406 if (foamyHexMeshControls_.specialiseFeaturePoints())
409 createSpecialisedFeaturePoint
411 feMesh, pEds, pFEdgeTypes, allEdStat, ptI, pts
415 if (!specialisedSuccess && foamyHexMeshControls_.edgeAiming())
457 const scalar edgeGroupDistance =
458 foamyHexMesh_.mixedFeaturePointDistance(pt);
462 const label edgeI = pEds[
e];
465 pt + edgeGroupDistance*feMesh.edgeDirection(edgeI, ptI);
469 foamyHexMesh_.createEdgePointGroup(feMesh, edgeHit, pts);
479 const PtrList<extendedFeatureEdgeMesh>& feMeshes
481 geometryToConformTo_.features()
486 const extendedFeatureEdgeMesh& feMesh(feMeshes[i]);
490 label ptI = feMesh.convexStart();
491 ptI < feMesh.mixedStart();
496 createMasterAndSlavePoints(feMesh, ptI, pts);
499 if (foamyHexMeshControls_.guardFeaturePoints())
504 label ptI = feMesh.mixedStart();
505 ptI < feMesh.nonFeatureStart();
513 feMesh.points()[ptI],
527 const conformalVoronoiMesh& foamyHexMesh
530 foamyHexMesh_(foamyHexMesh),
531 foamyHexMeshControls_(foamyHexMesh.foamyHexMeshControls()),
532 geometryToConformTo_(foamyHexMesh.geometryToConformTo()),
533 featurePointVertices_(),
534 ftPtPairs_(foamyHexMesh)
537 <<
"Conforming to feature points" <<
endl;
540 <<
indent <<
"Circulating edges is: "
542 <<
indent <<
"Guarding feature points is: "
544 <<
indent <<
"Snapping to feature points is: "
546 <<
indent <<
"Specialising feature points is: "
553 createFeaturePoints(pts);
555 createMixedFeaturePoints(pts);
568 pt.
type() = Vb::vtInternalFeaturePoint;
572 pt.
type() = Vb::vtExternalFeaturePoint;
582 featurePointVertices_.transfer(pts);
596 const backgroundMeshDecomposition& decomposition
600 decomposition.distributePoints(featurePointVertices_);
603 forAll(featurePointVertices_, vI)
614 const Map<label>& oldToNewIndices
617 forAll(featurePointVertices_, vI)
619 const label currentIndex = featurePointVertices_[vI].index();
622 oldToNewIndices.find(currentIndex);
624 if (newIndexIter != oldToNewIndices.end())
626 featurePointVertices_[vI].index() = newIndexIter();
630 ftPtPairs_.reIndex(oldToNewIndices);