From 47e65edf73a8c51a9bac463b8f3cb84e68c88f77 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 29 May 2009 10:40:52 +0100 Subject: [PATCH] added check to ensure that all wall patches are specified --- .../LocalInteraction/LocalInteraction.C | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C index deee624c17..efc5b33f05 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C @@ -57,18 +57,37 @@ Foam::LocalInteraction::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 badWalls; + forAll(bMesh, patchI) + { + if (isA(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); + } }