mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: foamyHexMesh: Insert surface points if internal points are exposed
This commit is contained in:
@ -550,53 +550,130 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for
|
||||||
|
// (
|
||||||
|
// Delaunay::Finite_edges_iterator eit = finite_edges_begin();
|
||||||
|
// eit != finite_edges_end();
|
||||||
|
// ++eit
|
||||||
|
// )
|
||||||
|
// {
|
||||||
|
// Cell_handle c = eit->first;
|
||||||
|
// Vertex_handle vA = c->vertex(eit->second);
|
||||||
|
// Vertex_handle vB = c->vertex(eit->third);
|
||||||
|
//
|
||||||
|
// if
|
||||||
|
// (
|
||||||
|
// vA->referred()
|
||||||
|
// || vB->referred()
|
||||||
|
// )
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if
|
||||||
|
// (
|
||||||
|
// (vA->internalPoint() && vA->referred())
|
||||||
|
// || (vB->internalPoint() && vB->referred())
|
||||||
|
// )
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if
|
||||||
|
// (
|
||||||
|
// (vA->internalPoint() && vB->externalBoundaryPoint())
|
||||||
|
// || (vB->internalPoint() && vA->externalBoundaryPoint())
|
||||||
|
// || (vA->internalBoundaryPoint() && vB->internalBoundaryPoint())
|
||||||
|
// )
|
||||||
|
// {
|
||||||
|
// pointIndexHitAndFeatureDynList surfaceIntersections(0.5*AtoV);
|
||||||
|
// pointIndexHit surfHit;
|
||||||
|
// label hitSurface;
|
||||||
|
//
|
||||||
|
// geometryToConformTo_.findSurfaceNearest
|
||||||
|
// (
|
||||||
|
// (
|
||||||
|
// vA->internalPoint()
|
||||||
|
// ? topoint(vA->point())
|
||||||
|
// : topoint(vB->point())
|
||||||
|
// ),
|
||||||
|
// magSqr(topoint(vA->point()) - topoint(vB->point())),
|
||||||
|
// surfHit,
|
||||||
|
// hitSurface
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// if (surfHit.hit())
|
||||||
|
// {
|
||||||
|
// surfaceIntersections.append
|
||||||
|
// (
|
||||||
|
// pointIndexHitAndFeature(surfHit, hitSurface)
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// addSurfaceAndEdgeHits
|
||||||
|
// (
|
||||||
|
// (
|
||||||
|
// vA->internalPoint()
|
||||||
|
// ? topoint(vA->point())
|
||||||
|
// : topoint(vB->point())
|
||||||
|
// ),
|
||||||
|
// surfaceIntersections,
|
||||||
|
// surfacePtReplaceDistCoeffSqr,
|
||||||
|
// edgeSearchDistCoeffSqr,
|
||||||
|
// surfaceHits,
|
||||||
|
// featureEdgeHits,
|
||||||
|
// surfaceToTreeShape,
|
||||||
|
// edgeToTreeShape,
|
||||||
|
// surfacePtToEdgePtDist,
|
||||||
|
// false
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
Delaunay::Finite_edges_iterator eit = finite_edges_begin();
|
Delaunay::Finite_cells_iterator cit = finite_cells_begin();
|
||||||
eit != finite_edges_end();
|
cit != finite_cells_end();
|
||||||
++eit
|
++cit
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Cell_handle c = eit->first;
|
label nInternal = 0;
|
||||||
Vertex_handle vA = c->vertex(eit->second);
|
for (label vI = 0; vI < 4; vI++)
|
||||||
Vertex_handle vB = c->vertex(eit->third);
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
vA->referred()
|
|
||||||
|| vB->referred()
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
continue;
|
if (cit->vertex(vI)->internalPoint())
|
||||||
|
{
|
||||||
|
nInternal++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if
|
if (nInternal == 1 && cit->hasBoundaryPoint())
|
||||||
(
|
//if (cit->boundaryDualVertex() && !cit->hasReferredPoint())
|
||||||
(vA->internalPoint() && vA->referred())
|
|
||||||
|| (vB->internalPoint() && vB->referred())
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
continue;
|
const Foam::point& pt = cit->dual();
|
||||||
}
|
|
||||||
|
const Foam::point cellCentre =
|
||||||
|
topoint
|
||||||
|
(
|
||||||
|
CGAL::centroid
|
||||||
|
(
|
||||||
|
CGAL::Tetrahedron_3<baseK>
|
||||||
|
(
|
||||||
|
cit->vertex(0)->point(),
|
||||||
|
cit->vertex(1)->point(),
|
||||||
|
cit->vertex(2)->point(),
|
||||||
|
cit->vertex(3)->point()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
(vA->internalPoint() && vB->externalBoundaryPoint())
|
|
||||||
|| (vB->internalPoint() && vA->externalBoundaryPoint())
|
|
||||||
)
|
|
||||||
{
|
|
||||||
pointIndexHitAndFeatureDynList surfaceIntersections(0.5*AtoV);
|
pointIndexHitAndFeatureDynList surfaceIntersections(0.5*AtoV);
|
||||||
pointIndexHit surfHit;
|
pointIndexHit surfHit;
|
||||||
label hitSurface;
|
label hitSurface;
|
||||||
|
|
||||||
geometryToConformTo_.findSurfaceNearest
|
geometryToConformTo_.findSurfaceNearestIntersection
|
||||||
(
|
(
|
||||||
(
|
cellCentre,
|
||||||
vA->internalPoint()
|
pt,
|
||||||
? topoint(vA->point())
|
|
||||||
: topoint(vB->point())
|
|
||||||
),
|
|
||||||
magSqr(topoint(vA->point()) - topoint(vB->point())),
|
|
||||||
surfHit,
|
surfHit,
|
||||||
hitSurface
|
hitSurface
|
||||||
);
|
);
|
||||||
@ -610,11 +687,7 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation()
|
|||||||
|
|
||||||
addSurfaceAndEdgeHits
|
addSurfaceAndEdgeHits
|
||||||
(
|
(
|
||||||
(
|
pt,
|
||||||
vA->internalPoint()
|
|
||||||
? topoint(vA->point())
|
|
||||||
: topoint(vB->point())
|
|
||||||
),
|
|
||||||
surfaceIntersections,
|
surfaceIntersections,
|
||||||
surfacePtReplaceDistCoeffSqr,
|
surfacePtReplaceDistCoeffSqr,
|
||||||
edgeSearchDistCoeffSqr,
|
edgeSearchDistCoeffSqr,
|
||||||
|
|||||||
Reference in New Issue
Block a user