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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015,2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -74,15 +74,20 @@ Foam::triSurfaceRegionSearch::treeByRegion() const
|
|||||||
{
|
{
|
||||||
if (treeByRegion_.empty())
|
if (treeByRegion_.empty())
|
||||||
{
|
{
|
||||||
Map<label> regionSizes;
|
label maxRegion = -1;
|
||||||
forAll(surface(), fI)
|
forAll(surface(), fI)
|
||||||
{
|
{
|
||||||
const label regionI = surface()[fI].region();
|
const label regionI = surface()[fI].region();
|
||||||
|
maxRegion = max(maxRegion, regionI);
|
||||||
regionSizes(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);
|
indirectRegionPatches_.setSize(nRegions);
|
||||||
treeByRegion_.setSize(nRegions);
|
treeByRegion_.setSize(nRegions);
|
||||||
@ -91,15 +96,12 @@ Foam::triSurfaceRegionSearch::treeByRegion() const
|
|||||||
|
|
||||||
forAll(regionsAddressing, regionI)
|
forAll(regionsAddressing, regionI)
|
||||||
{
|
{
|
||||||
regionsAddressing[regionI] = labelList(regionSizes[regionI], -1);
|
regionsAddressing[regionI].setSize(nFacesInRegions[regionI]);
|
||||||
}
|
}
|
||||||
|
nFacesInRegions = Zero;
|
||||||
labelList nFacesInRegions(nRegions, Zero);
|
|
||||||
|
|
||||||
forAll(surface(), fI)
|
forAll(surface(), fI)
|
||||||
{
|
{
|
||||||
const label regionI = surface()[fI].region();
|
const label regionI = surface()[fI].region();
|
||||||
|
|
||||||
regionsAddressing[regionI][nFacesInRegions[regionI]++] = fI;
|
regionsAddressing[regionI][nFacesInRegions[regionI]++] = fI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user