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:
parent
d8aced9070
commit
f2dbdd66bf
@ -1286,14 +1286,24 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceProtrusion
|
||||
if
|
||||
(
|
||||
is_infinite(c1) || is_infinite(c2)
|
||||
|| !c1->hasInternalPoint() || !c2->hasInternalPoint()
|
||||
|| (!c1->hasInternalPoint() && !c2->hasInternalPoint())
|
||||
|| !c1->real() || !c2->real()
|
||||
)
|
||||
{
|
||||
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;
|
||||
label hitSurface;
|
||||
@ -1301,7 +1311,7 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceProtrusion
|
||||
geometryToConformTo_.findSurfaceAnyIntersection
|
||||
(
|
||||
vert,
|
||||
edgeMid,
|
||||
endPt,
|
||||
surfHit,
|
||||
hitSurface
|
||||
);
|
||||
@ -1319,7 +1329,7 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceProtrusion
|
||||
const vector& n = norm[0];
|
||||
|
||||
const scalar normalProtrusionDistance =
|
||||
(edgeMid - surfHit.hitPoint()) & n;
|
||||
(endPt - surfHit.hitPoint()) & n;
|
||||
|
||||
if (normalProtrusionDistance > maxProtrusionDistance)
|
||||
{
|
||||
@ -1382,14 +1392,24 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceIncursion
|
||||
if
|
||||
(
|
||||
is_infinite(c1) || is_infinite(c2)
|
||||
|| !c1->hasInternalPoint() || !c2->hasInternalPoint()
|
||||
|| (!c1->hasInternalPoint() && !c2->hasInternalPoint())
|
||||
|| !c1->real() || !c2->real()
|
||||
)
|
||||
{
|
||||
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;
|
||||
label hitSurface;
|
||||
@ -1397,7 +1417,7 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceIncursion
|
||||
geometryToConformTo_.findSurfaceAnyIntersection
|
||||
(
|
||||
vert,
|
||||
edgeMid,
|
||||
endPt,
|
||||
surfHit,
|
||||
hitSurface
|
||||
);
|
||||
@ -1414,8 +1434,7 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceIncursion
|
||||
|
||||
const vector& n = norm[0];
|
||||
|
||||
scalar normalIncursionDistance =
|
||||
(edgeMid - surfHit.hitPoint()) & n;
|
||||
scalar normalIncursionDistance = (endPt - surfHit.hitPoint()) & n;
|
||||
|
||||
if (normalIncursionDistance < minIncursionDistance)
|
||||
{
|
||||
|
@ -350,7 +350,7 @@ bool Foam::autoDensity::fillBox
|
||||
|
||||
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
|
||||
// of the box so ensure that they are "wellInside". If not, set as an
|
||||
// overlapping box.
|
||||
@ -644,7 +644,7 @@ bool Foam::autoDensity::fillBox
|
||||
{
|
||||
trialPoints++;
|
||||
|
||||
point p = samplePoints[i];
|
||||
const point& p = samplePoints[i];
|
||||
|
||||
scalar localSize = sampleSizes[i];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user