mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: foamyHexMesh: surface conformation and initial point insertion
autoDensity: Change to reference and correct typo surfaceConformation: Include Delaunay cells that are entirely made up of boundary points. Also increase the length of the line to intersect.
This commit is contained in:
@ -1286,14 +1286,24 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceProtrusion
|
|||||||
if
|
if
|
||||||
(
|
(
|
||||||
is_infinite(c1) || is_infinite(c2)
|
is_infinite(c1) || is_infinite(c2)
|
||||||
|| !c1->hasInternalPoint() || !c2->hasInternalPoint()
|
|| (!c1->hasInternalPoint() && !c2->hasInternalPoint())
|
||||||
|| !c1->real() || !c2->real()
|
|| !c1->real() || !c2->real()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Foam::point edgeMid = 0.5*(c1->dual() + c2->dual());
|
// Foam::point endPt = 0.5*(c1->dual() + c2->dual());
|
||||||
|
Foam::point endPt = c1->dual();
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
magSqr(vert - c1->dual())
|
||||||
|
< magSqr(vert - c2->dual())
|
||||||
|
)
|
||||||
|
{
|
||||||
|
endPt = c2->dual();
|
||||||
|
}
|
||||||
|
|
||||||
pointIndexHit surfHit;
|
pointIndexHit surfHit;
|
||||||
label hitSurface;
|
label hitSurface;
|
||||||
@ -1301,7 +1311,7 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceProtrusion
|
|||||||
geometryToConformTo_.findSurfaceAnyIntersection
|
geometryToConformTo_.findSurfaceAnyIntersection
|
||||||
(
|
(
|
||||||
vert,
|
vert,
|
||||||
edgeMid,
|
endPt,
|
||||||
surfHit,
|
surfHit,
|
||||||
hitSurface
|
hitSurface
|
||||||
);
|
);
|
||||||
@ -1319,7 +1329,7 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceProtrusion
|
|||||||
const vector& n = norm[0];
|
const vector& n = norm[0];
|
||||||
|
|
||||||
const scalar normalProtrusionDistance =
|
const scalar normalProtrusionDistance =
|
||||||
(edgeMid - surfHit.hitPoint()) & n;
|
(endPt - surfHit.hitPoint()) & n;
|
||||||
|
|
||||||
if (normalProtrusionDistance > maxProtrusionDistance)
|
if (normalProtrusionDistance > maxProtrusionDistance)
|
||||||
{
|
{
|
||||||
@ -1382,14 +1392,24 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceIncursion
|
|||||||
if
|
if
|
||||||
(
|
(
|
||||||
is_infinite(c1) || is_infinite(c2)
|
is_infinite(c1) || is_infinite(c2)
|
||||||
|| !c1->hasInternalPoint() || !c2->hasInternalPoint()
|
|| (!c1->hasInternalPoint() && !c2->hasInternalPoint())
|
||||||
|| !c1->real() || !c2->real()
|
|| !c1->real() || !c2->real()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Foam::point edgeMid = 0.5*(c1->dual() + c2->dual());
|
// Foam::point endPt = 0.5*(c1->dual() + c2->dual());
|
||||||
|
Foam::point endPt = c1->dual();
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
magSqr(vert - c1->dual())
|
||||||
|
< magSqr(vert - c2->dual())
|
||||||
|
)
|
||||||
|
{
|
||||||
|
endPt = c2->dual();
|
||||||
|
}
|
||||||
|
|
||||||
pointIndexHit surfHit;
|
pointIndexHit surfHit;
|
||||||
label hitSurface;
|
label hitSurface;
|
||||||
@ -1397,7 +1417,7 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceIncursion
|
|||||||
geometryToConformTo_.findSurfaceAnyIntersection
|
geometryToConformTo_.findSurfaceAnyIntersection
|
||||||
(
|
(
|
||||||
vert,
|
vert,
|
||||||
edgeMid,
|
endPt,
|
||||||
surfHit,
|
surfHit,
|
||||||
hitSurface
|
hitSurface
|
||||||
);
|
);
|
||||||
@ -1414,8 +1434,7 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceIncursion
|
|||||||
|
|
||||||
const vector& n = norm[0];
|
const vector& n = norm[0];
|
||||||
|
|
||||||
scalar normalIncursionDistance =
|
scalar normalIncursionDistance = (endPt - surfHit.hitPoint()) & n;
|
||||||
(edgeMid - surfHit.hitPoint()) & n;
|
|
||||||
|
|
||||||
if (normalIncursionDistance < minIncursionDistance)
|
if (normalIncursionDistance < minIncursionDistance)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -350,7 +350,7 @@ bool Foam::autoDensity::fillBox
|
|||||||
|
|
||||||
if (!overlapping && !wellInside)
|
if (!overlapping && !wellInside)
|
||||||
{
|
{
|
||||||
// If this is an inside box then then it is possible to fill points very
|
// If this is an inside box then it is possible to fill points very
|
||||||
// close to the boundary, to prevent this, check the corners and sides
|
// close to the boundary, to prevent this, check the corners and sides
|
||||||
// of the box so ensure that they are "wellInside". If not, set as an
|
// of the box so ensure that they are "wellInside". If not, set as an
|
||||||
// overlapping box.
|
// overlapping box.
|
||||||
@ -644,7 +644,7 @@ bool Foam::autoDensity::fillBox
|
|||||||
{
|
{
|
||||||
trialPoints++;
|
trialPoints++;
|
||||||
|
|
||||||
point p = samplePoints[i];
|
const point& p = samplePoints[i];
|
||||||
|
|
||||||
scalar localSize = sampleSizes[i];
|
scalar localSize = sampleSizes[i];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user