mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: snappyHexMesh: deal with non-compact regions. Fixes #1221.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2015,2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -74,15 +74,20 @@ Foam::triSurfaceRegionSearch::treeByRegion() const
|
||||
{
|
||||
if (treeByRegion_.empty())
|
||||
{
|
||||
Map<label> regionSizes;
|
||||
label maxRegion = -1;
|
||||
forAll(surface(), fI)
|
||||
{
|
||||
const label regionI = surface()[fI].region();
|
||||
|
||||
regionSizes(regionI)++;
|
||||
maxRegion = max(maxRegion, regionI);
|
||||
}
|
||||
const label nRegions = maxRegion+1;
|
||||
|
||||
label nRegions = regionSizes.size();
|
||||
labelList nFacesInRegions(nRegions, 0);
|
||||
forAll(surface(), fI)
|
||||
{
|
||||
const label regionI = surface()[fI].region();
|
||||
nFacesInRegions[regionI]++;
|
||||
}
|
||||
|
||||
indirectRegionPatches_.setSize(nRegions);
|
||||
treeByRegion_.setSize(nRegions);
|
||||
@ -91,15 +96,12 @@ Foam::triSurfaceRegionSearch::treeByRegion() const
|
||||
|
||||
forAll(regionsAddressing, regionI)
|
||||
{
|
||||
regionsAddressing[regionI] = labelList(regionSizes[regionI], -1);
|
||||
regionsAddressing[regionI].setSize(nFacesInRegions[regionI]);
|
||||
}
|
||||
|
||||
labelList nFacesInRegions(nRegions, Zero);
|
||||
|
||||
nFacesInRegions = Zero;
|
||||
forAll(surface(), fI)
|
||||
{
|
||||
const label regionI = surface()[fI].region();
|
||||
|
||||
regionsAddressing[regionI][nFacesInRegions[regionI]++] = fI;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user