mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added check to ensure that all wall patches are specified
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user