mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: snappyHexMesh: revert to old behaviour. Fixes #2637
Curvature detection was switched on even without curvatureLevel switched on. Now reverts to v2206 behaviour.
This commit is contained in:
@ -1109,7 +1109,6 @@ Foam::label Foam::meshRefinement::countMatches
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//XXXXXX
|
|
||||||
//bool Foam::meshRefinement::highCurvature
|
//bool Foam::meshRefinement::highCurvature
|
||||||
//(
|
//(
|
||||||
// const scalar minCosAngle,
|
// const scalar minCosAngle,
|
||||||
@ -1143,7 +1142,7 @@ bool Foam::meshRefinement::highCurvature
|
|||||||
// Co-planar
|
// Co-planar
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else if (lengthScale > SMALL)
|
||||||
{
|
{
|
||||||
// Calculate radius of curvature
|
// Calculate radius of curvature
|
||||||
|
|
||||||
@ -1170,6 +1169,10 @@ bool Foam::meshRefinement::highCurvature
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//XXXXX
|
//XXXXX
|
||||||
|
|
||||||
@ -1249,6 +1252,10 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// If no curvature supplied behave as before
|
||||||
|
const bool hasCurvatureLevels = (max(surfaces_.maxCurvatureLevel()) > 0);
|
||||||
|
|
||||||
|
|
||||||
// Test for all intersections (with surfaces of higher max level than
|
// Test for all intersections (with surfaces of higher max level than
|
||||||
// minLevel) and cache per cell the interesting inter
|
// minLevel) and cache per cell the interesting inter
|
||||||
labelListList cellSurfLevels(mesh_.nCells());
|
labelListList cellSurfLevels(mesh_.nCells());
|
||||||
@ -1296,6 +1303,69 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
|||||||
pLevel = labelUIndList(pLevel, visitOrder);
|
pLevel = labelUIndList(pLevel, visitOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- At some point could just return the intersected surface+region
|
||||||
|
// and derive all the surface information (maxLevel, curvatureLevel)
|
||||||
|
// from that - we're now doing it inside refinementSurfaces itself.
|
||||||
|
//// Per segment the surfaces hit
|
||||||
|
//List<labelList> hitSurface;
|
||||||
|
//List<pointList> hitLocation;
|
||||||
|
//List<labelList> hitRegion;
|
||||||
|
//List<vectorField> hitNormal;
|
||||||
|
//surfaces_.findAllIntersections
|
||||||
|
//(
|
||||||
|
// identity(surfaces_.surfaces()), // all refinement geometries
|
||||||
|
// start,
|
||||||
|
// end,
|
||||||
|
//
|
||||||
|
// hitSurface,
|
||||||
|
// hitLocation,
|
||||||
|
// hitRegion,
|
||||||
|
// hitNormal
|
||||||
|
//);
|
||||||
|
//
|
||||||
|
//// Filter out levels. minLevel = (mesh) cellLevel (on inbetween face).
|
||||||
|
//// Ignore any surface with higher level
|
||||||
|
//const auto& maxLevel = surfaces_.maxLevel();
|
||||||
|
//labelList visitOrder;
|
||||||
|
//DynamicList<label> valid;
|
||||||
|
//forAll(hitSurface, segmenti)
|
||||||
|
//{
|
||||||
|
// const label meshLevel = minLevel[segmenti];
|
||||||
|
//
|
||||||
|
// auto& fSurface = hitSurface[segmenti];
|
||||||
|
// auto& fLocation = hitLocation[segmenti];
|
||||||
|
// auto& fRegion = hitRegion[segmenti];
|
||||||
|
// auto& fNormal = hitNormal[segmenti];
|
||||||
|
//
|
||||||
|
// // Sort the data according to intersection location. This will
|
||||||
|
// // guarantee
|
||||||
|
// // that on coupled faces both sides visit the intersections in
|
||||||
|
// // the same order so will decide the same
|
||||||
|
// sortedOrder(fLocation, visitOrder, normalLess(hfLocation));
|
||||||
|
// fLocation = List<point>(fLocation, visitOrder);
|
||||||
|
// fSurface = labelUIndList(fSurface, visitOrder);
|
||||||
|
// fRegion = labelUIndList(fRegion, visitOrder);
|
||||||
|
// fNormal = List<vector>(fNormal, visitOrder);
|
||||||
|
//
|
||||||
|
// // Filter out any intersections with surfaces outside cell level.
|
||||||
|
// // Note that min refinement level of surfaces is ignored.
|
||||||
|
// valid.clear();
|
||||||
|
// forAll(fSurface, hiti)
|
||||||
|
// {
|
||||||
|
// const label regioni =
|
||||||
|
// surfaces_.globalRegion(fSurface[hiti], fRegion[hiti]);
|
||||||
|
// if (meshLevel < maxLevel[regioni]) //&& >= minLevel(regioni)
|
||||||
|
// {
|
||||||
|
// valid.append(hiti);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// fLocation = List<point>(fLocation, valid);
|
||||||
|
// fSurface = labelUIndList(fSurface, valid);
|
||||||
|
// fRegion = labelUIndList(fRegion, valid);
|
||||||
|
// fNormal = List<vector>(fNormal, valid);
|
||||||
|
//}
|
||||||
|
|
||||||
// Clear out unnecessary data
|
// Clear out unnecessary data
|
||||||
start.clear();
|
start.clear();
|
||||||
end.clear();
|
end.clear();
|
||||||
@ -1387,13 +1457,16 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
|||||||
{
|
{
|
||||||
for (label j = i+1; !reachedLimit && j < normals.size(); j++)
|
for (label j = i+1; !reachedLimit && j < normals.size(); j++)
|
||||||
{
|
{
|
||||||
|
// TBD: calculate curvature size (if curvatureLevel specified)
|
||||||
|
// and pass in instead of cellSize
|
||||||
|
|
||||||
//if ((normals[i] & normals[j]) < curvature)
|
//if ((normals[i] & normals[j]) < curvature)
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
highCurvature
|
highCurvature
|
||||||
(
|
(
|
||||||
curvature,
|
curvature,
|
||||||
cellSize,
|
(hasCurvatureLevels ? cellSize : scalar(0)),
|
||||||
points[i],
|
points[i],
|
||||||
normals[i],
|
normals[i],
|
||||||
points[j],
|
points[j],
|
||||||
@ -1489,7 +1562,7 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
|||||||
highCurvature
|
highCurvature
|
||||||
(
|
(
|
||||||
curvature,
|
curvature,
|
||||||
cellSize,
|
(hasCurvatureLevels ? cellSize : scalar(0)),
|
||||||
ownPoints[i],
|
ownPoints[i],
|
||||||
ownNormals[i],
|
ownNormals[i],
|
||||||
neiPoints[j],
|
neiPoints[j],
|
||||||
@ -1610,7 +1683,7 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
|||||||
highCurvature
|
highCurvature
|
||||||
(
|
(
|
||||||
curvature,
|
curvature,
|
||||||
cellSize,
|
(hasCurvatureLevels ? cellSize : scalar(0)),
|
||||||
ownPoints[i],
|
ownPoints[i],
|
||||||
ownNormals[i],
|
ownNormals[i],
|
||||||
neiPoints[j],
|
neiPoints[j],
|
||||||
|
|||||||
@ -1412,8 +1412,6 @@ void Foam::refinementSurfaces::findAllIntersections
|
|||||||
|
|
||||||
// Work arrays
|
// Work arrays
|
||||||
List<List<pointIndexHit>> hitInfo;
|
List<List<pointIndexHit>> hitInfo;
|
||||||
labelList pRegions;
|
|
||||||
vectorField pNormals;
|
|
||||||
|
|
||||||
forAll(surfaces_, surfI)
|
forAll(surfaces_, surfI)
|
||||||
{
|
{
|
||||||
@ -1507,8 +1505,6 @@ void Foam::refinementSurfaces::findAllIntersections
|
|||||||
|
|
||||||
// Work arrays
|
// Work arrays
|
||||||
List<List<pointIndexHit>> hitInfo;
|
List<List<pointIndexHit>> hitInfo;
|
||||||
labelList pRegions;
|
|
||||||
vectorField pNormals;
|
|
||||||
|
|
||||||
forAll(surfaces_, surfI)
|
forAll(surfaces_, surfI)
|
||||||
{
|
{
|
||||||
@ -1579,6 +1575,88 @@ void Foam::refinementSurfaces::findAllIntersections
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//void Foam::refinementSurfaces::findAllIntersections
|
||||||
|
//(
|
||||||
|
// const labelList& surfacesToTest,
|
||||||
|
// const pointField& start,
|
||||||
|
// const pointField& end,
|
||||||
|
//
|
||||||
|
// List<labelList>& hitSurface, // surface index
|
||||||
|
// List<pointList>& hitLocation, // surface location
|
||||||
|
// List<labelList>& hitRegion,
|
||||||
|
// List<vectorField>& hitNormal
|
||||||
|
//) const
|
||||||
|
//{
|
||||||
|
// hitSurface.setSize(start.size());
|
||||||
|
// hitLocation.setSize(start.size());
|
||||||
|
// hitRegion.setSize(start.size());
|
||||||
|
// hitNormal.setSize(start.size());
|
||||||
|
//
|
||||||
|
// if (surfaces_.empty())
|
||||||
|
// {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // Work arrays
|
||||||
|
// List<List<pointIndexHit>> hitInfo;
|
||||||
|
//
|
||||||
|
// for (const label surfI : surfacesToTest)
|
||||||
|
// {
|
||||||
|
// const searchableSurface& surface = allGeometry_[surfaces_[surfI]];
|
||||||
|
//
|
||||||
|
// surface.findLineAll(start, end, hitInfo);
|
||||||
|
//
|
||||||
|
// // Repack hits for surface into flat list
|
||||||
|
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// // To avoid overhead of calling getRegion for every point
|
||||||
|
//
|
||||||
|
// label n = 0;
|
||||||
|
// forAll(hitInfo, pointI)
|
||||||
|
// {
|
||||||
|
// n += hitInfo[pointI].size();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// List<pointIndexHit> surfInfo(n);
|
||||||
|
// labelList pointMap(n);
|
||||||
|
// n = 0;
|
||||||
|
//
|
||||||
|
// forAll(hitInfo, pointI)
|
||||||
|
// {
|
||||||
|
// const List<pointIndexHit>& pHits = hitInfo[pointI];
|
||||||
|
//
|
||||||
|
// forAll(pHits, i)
|
||||||
|
// {
|
||||||
|
// surfInfo[n] = pHits[i];
|
||||||
|
// pointMap[n] = pointI;
|
||||||
|
// n++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// labelList surfRegion(n);
|
||||||
|
// vectorField surfNormal(n);
|
||||||
|
// surface.getRegion(surfInfo, surfRegion);
|
||||||
|
// surface.getNormal(surfInfo, surfNormal);
|
||||||
|
//
|
||||||
|
// surfInfo.clear();
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// // Extract back into pointwise
|
||||||
|
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
//
|
||||||
|
// forAll(surfRegion, i)
|
||||||
|
// {
|
||||||
|
// const label pointI = pointMap[i];
|
||||||
|
//
|
||||||
|
// // Append to pointI info
|
||||||
|
// hitSurface[pointI].append(surfI);
|
||||||
|
// hitRegion[pointI].append(globalRegion(surfI, surfRegion[i]));
|
||||||
|
// hitLocation[pointI].append(surfInfo[i].hitPoint());
|
||||||
|
// hitNormal[pointI].append(surfNormal[i]);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
void Foam::refinementSurfaces::findNearestIntersection
|
void Foam::refinementSurfaces::findNearestIntersection
|
||||||
(
|
(
|
||||||
const labelList& surfacesToTest,
|
const labelList& surfacesToTest,
|
||||||
|
|||||||
Reference in New Issue
Block a user