mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Add enhanced edge conformation method
This commit is contained in:
@ -2183,54 +2183,59 @@ void Foam::conformalVoronoiMesh::addSurfaceAndEdgeHits
|
||||
pointIndexHitAndFeature(edHit, featureHit)
|
||||
);
|
||||
}
|
||||
// else if (firstPass)
|
||||
// {
|
||||
// label hitIndex = nearestEdgeHit.index();
|
||||
//
|
||||
// // Calc new edge location
|
||||
//// Foam::point newPt =
|
||||
//// 0.5
|
||||
//// *(
|
||||
//// nearestEdgeHit.hitPoint()
|
||||
//// + edHit.hitPoint()
|
||||
//// );
|
||||
//
|
||||
// pointIndexHit pHitOld =
|
||||
// edgeLocationTreePtr_().findNearest
|
||||
// (
|
||||
// nearestEdgeHit.hitPoint(), GREAT
|
||||
// );
|
||||
//
|
||||
// pointIndexHit pHitNew =
|
||||
// edgeLocationTreePtr_().findNearest
|
||||
// (
|
||||
// edHit.hitPoint(), GREAT
|
||||
// );
|
||||
//
|
||||
// if
|
||||
// (
|
||||
// pHitNew.hitPoint() - pHitOld.hitPoint()
|
||||
// )
|
||||
// {
|
||||
// edHit.setPoint(pHit.hitPoint());
|
||||
//
|
||||
// featureEdgeHits[hitIndex] =
|
||||
// pointIndexHitAndFeature(edHit, featureHit);
|
||||
//
|
||||
// existingEdgeLocations_[hitIndex] =
|
||||
// edHit.hitPoint();
|
||||
//
|
||||
// // Change edge location in featureEdgeHits
|
||||
// // remove index from edge tree
|
||||
// // reinsert new point into tree
|
||||
// edgeLocationTreePtr_().remove(hitIndex);
|
||||
// edgeLocationTreePtr_().insert
|
||||
// (
|
||||
// hitIndex,
|
||||
// hitIndex + 1
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
else if (firstPass)
|
||||
{
|
||||
label hitIndex = nearestEdgeHit.index();
|
||||
|
||||
// Calc new edge location
|
||||
Foam::point newPt =
|
||||
0.5
|
||||
*(
|
||||
nearestEdgeHit.hitPoint()
|
||||
+ edHit.hitPoint()
|
||||
);
|
||||
|
||||
pointIndexHit pHitOld =
|
||||
edgeLocationTreePtr_().findNearest
|
||||
(
|
||||
nearestEdgeHit.hitPoint(), GREAT
|
||||
);
|
||||
|
||||
pointIndexHit pHitNew =
|
||||
edgeLocationTreePtr_().findNearest
|
||||
(
|
||||
edHit.hitPoint(), GREAT
|
||||
);
|
||||
|
||||
if
|
||||
(
|
||||
magSqr(pHitNew.hitPoint() - edHit.hitPoint())
|
||||
< magSqr
|
||||
(
|
||||
pHitOld.hitPoint()
|
||||
- nearestEdgeHit.hitPoint()
|
||||
)
|
||||
)
|
||||
{
|
||||
edHit.setPoint(edHit.hitPoint());
|
||||
|
||||
featureEdgeHits[hitIndex] =
|
||||
pointIndexHitAndFeature(edHit, featureHit);
|
||||
|
||||
existingEdgeLocations_[hitIndex] =
|
||||
edHit.hitPoint();
|
||||
|
||||
// Change edge location in featureEdgeHits
|
||||
// remove index from edge tree
|
||||
// reinsert new point into tree
|
||||
edgeLocationTreePtr_().remove(hitIndex);
|
||||
edgeLocationTreePtr_().insert
|
||||
(
|
||||
hitIndex,
|
||||
hitIndex + 1
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user