added check to ensure that all wall patches are specified

This commit is contained in:
andy
2009-05-29 10:40:52 +01:00
parent 765178f0c4
commit 47e65edf73

View File

@ -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);
}
}