mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Moving test for surface hit near to an edge hit, so snap control to the edge,
inside the test for whether the edge point is too close to a feature point.
This commit is contained in:
@ -1138,6 +1138,13 @@ void Foam::conformalVoronoiMesh::addSurfaceAndEdgeHits
|
|||||||
autoPtr<indexedOctree<treeDataPoint> >& edgeLocationTree
|
autoPtr<indexedOctree<treeDataPoint> >& edgeLocationTree
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
bool keepSurfacePoint = true;
|
||||||
|
|
||||||
|
if (nearFeaturePt(surfHit.hitPoint()))
|
||||||
|
{
|
||||||
|
keepSurfacePoint = false;
|
||||||
|
}
|
||||||
|
|
||||||
List<pointIndexHit> edHits;
|
List<pointIndexHit> edHits;
|
||||||
|
|
||||||
labelList featuresHit;
|
labelList featuresHit;
|
||||||
@ -1152,13 +1159,6 @@ void Foam::conformalVoronoiMesh::addSurfaceAndEdgeHits
|
|||||||
featuresHit
|
featuresHit
|
||||||
);
|
);
|
||||||
|
|
||||||
bool keepSurfacePoint = true;
|
|
||||||
|
|
||||||
if (nearFeaturePt(surfHit.hitPoint()))
|
|
||||||
{
|
|
||||||
keepSurfacePoint = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gather edge locations but do not add them to newEdgeLocations inside the
|
// Gather edge locations but do not add them to newEdgeLocations inside the
|
||||||
// loop as they will prevent nearby edge locations of different types being
|
// loop as they will prevent nearby edge locations of different types being
|
||||||
// conformed to.
|
// conformed to.
|
||||||
@ -1173,21 +1173,21 @@ void Foam::conformalVoronoiMesh::addSurfaceAndEdgeHits
|
|||||||
|
|
||||||
if (edHit.hit())
|
if (edHit.hit())
|
||||||
{
|
{
|
||||||
if
|
|
||||||
(
|
|
||||||
magSqr(edHit.hitPoint() - surfHit.hitPoint())
|
|
||||||
< surfacePtReplaceDistCoeffSqr*targetCellSizeSqr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// If the point is within a given distance of a feature edge,
|
|
||||||
// give control to edge control points instead, this will
|
|
||||||
// prevent "pits" forming.
|
|
||||||
|
|
||||||
keepSurfacePoint = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!nearFeaturePt(edHit.hitPoint()))
|
if (!nearFeaturePt(edHit.hitPoint()))
|
||||||
{
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
magSqr(edHit.hitPoint() - surfHit.hitPoint())
|
||||||
|
< surfacePtReplaceDistCoeffSqr*targetCellSizeSqr
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// If the point is within a given distance of a feature
|
||||||
|
// edge, give control to edge control points instead, this
|
||||||
|
// will prevent "pits" forming.
|
||||||
|
|
||||||
|
keepSurfacePoint = false;
|
||||||
|
}
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!nearFeatureEdgeLocation
|
!nearFeatureEdgeLocation
|
||||||
@ -2030,6 +2030,39 @@ void Foam::conformalVoronoiMesh::conformToSurface()
|
|||||||
<< maxIterations << ") reached." << endl;
|
<< maxIterations << ") reached." << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Info<< nl << " After iterations, check penetrations" << endl;
|
||||||
|
|
||||||
|
// for
|
||||||
|
// (
|
||||||
|
// Triangulation::Finite_vertices_iterator vit =
|
||||||
|
// finite_vertices_begin();
|
||||||
|
// vit != finite_vertices_end();
|
||||||
|
// vit++
|
||||||
|
// )
|
||||||
|
// {
|
||||||
|
// if (vit->internalOrBoundaryPoint())
|
||||||
|
// {
|
||||||
|
// point vert(topoint(vit->point()));
|
||||||
|
// pointIndexHit surfHit;
|
||||||
|
// label hitSurface;
|
||||||
|
|
||||||
|
// dualCellLargestSurfaceProtrusion(vit, surfHit, hitSurface);
|
||||||
|
|
||||||
|
// if (surfHit.hit())
|
||||||
|
// {
|
||||||
|
// Info<< nl << "Residual penetration: " << nl
|
||||||
|
// << vit->index() << nl
|
||||||
|
// << vit->type() << nl
|
||||||
|
// << vit->ppMaster() << nl
|
||||||
|
// << "nearFeaturePt "
|
||||||
|
// << nearFeaturePt(surfHit.hitPoint()) << nl
|
||||||
|
// << vert << nl
|
||||||
|
// << surfHit.hitPoint()
|
||||||
|
// << endl;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2381,3 +2414,5 @@ void Foam::conformalVoronoiMesh::move()
|
|||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
||||||
|
// LocalWords: edHit
|
||||||
|
|||||||
Reference in New Issue
Block a user