Skip to content
Snippets Groups Projects
Commit 47e65edf authored by Andrew Heather's avatar Andrew Heather
Browse files

added check to ensure that all wall patches are specified

parent 765178f0
No related branches found
No related tags found
No related merge requests found
......@@ -57,18 +57,37 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
patchIds_(patchData_.size())
{
const polyMesh& mesh = cloud.mesh();
const polyBoundaryMesh& bMesh = mesh.boundaryMesh();
forAll(patchData_, patchI)
{
const word& patchName = patchData_[patchI].patchName();
patchIds_[patchI] = mesh.boundaryMesh().findPatchID(patchName);
patchIds_[patchI] = bMesh.findPatchID(patchName);
if (patchIds_[patchI] < 0)
{
FatalErrorIn("LocalInteraction(const dictionary&, CloudType&)")
<< "Patch " << patchName << " not found. Available patches "
<< "are: " << mesh.boundaryMesh().names() << endl;
<< "are: " << bMesh.names() << exit(FatalError);
}
}
// check that all walls are specified
DynamicList<word> badWalls;
forAll(bMesh, patchI)
{
if (isA<wallPolyPatch>(bMesh[patchI]) && !applyToPatch(bMesh[patchI]))
{
badWalls.append(bMesh[patchI].name());
}
}
if (badWalls.size() > 0)
{
FatalErrorIn("LocalInteraction(const dictionary&, CloudType&)")
<< "All wall patches must be specified when employing local patch "
<< "interaction. Please specify data for patches:" << nl
<< badWalls << nl << exit(FatalError);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment