ENH: snappyHexMesh: allow empty refinement surfaces #1303

This commit is contained in:
mattijs
2014-05-22 16:45:44 +01:00
committed by Andrew Heather
parent c571442368
commit b73b8e7610

View File

@ -381,6 +381,13 @@ Foam::labelList Foam::meshRefinement::nearestPatch
{
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
labelList nearestAdaptPatch;
if (adaptPatchIDs.size())
{
nearestAdaptPatch.setSize(mesh_.nFaces(), adaptPatchIDs[0]);
// Count number of faces in adaptPatchIDs
label nFaces = 0;
forAll(adaptPatchIDs, i)
@ -422,7 +429,6 @@ Foam::labelList Foam::meshRefinement::nearestPatch
);
// And extract
labelList nearestAdaptPatch(mesh_.nFaces(), adaptPatchIDs[0]);
bool haveWarned = false;
forAll(faceData, faceI)
@ -445,6 +451,12 @@ Foam::labelList Foam::meshRefinement::nearestPatch
nearestAdaptPatch[faceI] = faceData[faceI].data();
}
}
}
else
{
// Use patch 0
nearestAdaptPatch.setSize(mesh_.nFaces(), 0);
}
return nearestAdaptPatch;
}