Commit dfa2c676 authored by mattijs's avatar mattijs
Browse files

ENH: Allow specification of defaultFaces boundary type

parent 300ac484
......@@ -577,21 +577,56 @@ Foam::polyMesh::polyMesh
<< "Found " << nFaces - defaultPatchStart
<< " undefined faces in mesh; adding to default patch." << endl;
boundary_.set
(
nAllPatches,
polyPatch::New
// Check if there already exists a defaultFaces patch as last patch
// and reuse it.
label patchI = findIndex(boundaryPatchNames, defaultBoundaryPatchName);
if (patchI != -1)
{
if (patchI != boundaryFaces.size()-1 || boundary_[patchI].size())
{
FatalErrorIn("polyMesh::polyMesh(... construct from shapes...)")
<< "Default patch " << boundary_[patchI].name()
<< " already has faces in it or is not"
<< " last in list of patches." << exit(FatalError);
}
WarningIn("polyMesh::polyMesh(... construct from shapes...)")
<< "Reusing existing patch " << patchI
<< " for undefined faces." << endl;
boundary_.set
(
defaultBoundaryPatchType,
defaultBoundaryPatchName,
nFaces - defaultPatchStart,
defaultPatchStart,
boundary_.size() - 1,
boundary_
)
);
patchI,
polyPatch::New
(
boundaryPatchTypes[patchI],
boundaryPatchNames[patchI],
nFaces - defaultPatchStart,
defaultPatchStart,
patchI,
boundary_
)
);
}
else
{
boundary_.set
(
nAllPatches,
polyPatch::New
(
defaultBoundaryPatchType,
defaultBoundaryPatchName,
nFaces - defaultPatchStart,
defaultPatchStart,
boundary_.size() - 1,
boundary_
)
);
nAllPatches++;
nAllPatches++;
}
}
// Reset the size of the boundary
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment