mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: snappyHexMesh: allow empty refinement surfaces #1303
This commit is contained in:
@ -381,6 +381,13 @@ Foam::labelList Foam::meshRefinement::nearestPatch
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
|
|
||||||
|
labelList nearestAdaptPatch;
|
||||||
|
|
||||||
|
if (adaptPatchIDs.size())
|
||||||
|
{
|
||||||
|
nearestAdaptPatch.setSize(mesh_.nFaces(), adaptPatchIDs[0]);
|
||||||
|
|
||||||
|
|
||||||
// Count number of faces in adaptPatchIDs
|
// Count number of faces in adaptPatchIDs
|
||||||
label nFaces = 0;
|
label nFaces = 0;
|
||||||
forAll(adaptPatchIDs, i)
|
forAll(adaptPatchIDs, i)
|
||||||
@ -422,7 +429,6 @@ Foam::labelList Foam::meshRefinement::nearestPatch
|
|||||||
);
|
);
|
||||||
|
|
||||||
// And extract
|
// And extract
|
||||||
labelList nearestAdaptPatch(mesh_.nFaces(), adaptPatchIDs[0]);
|
|
||||||
|
|
||||||
bool haveWarned = false;
|
bool haveWarned = false;
|
||||||
forAll(faceData, faceI)
|
forAll(faceData, faceI)
|
||||||
@ -445,6 +451,12 @@ Foam::labelList Foam::meshRefinement::nearestPatch
|
|||||||
nearestAdaptPatch[faceI] = faceData[faceI].data();
|
nearestAdaptPatch[faceI] = faceData[faceI].data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Use patch 0
|
||||||
|
nearestAdaptPatch.setSize(mesh_.nFaces(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
return nearestAdaptPatch;
|
return nearestAdaptPatch;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user