From 3fa3c77ecc8764380fffca207cb8be0e042d2af9 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 5 Jul 2010 16:44:42 +0100 Subject: [PATCH] ENH: surfaceSlipDisplacementPointPatchVectorField.C : added check for existence of pointZone --- .../surfaceSlipDisplacementPointPatchVectorField.C | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C index 96f5e9e05..08460b8cc 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C @@ -85,8 +85,17 @@ void surfaceSlipDisplacementPointPatchVectorField::calcProjection if (frozenPointsZone_.size() > 0) { const pointZoneMesh& pZones = mesh.pointZones(); + label zoneID = pZones.findZoneID(frozenPointsZone_); + if (zoneID == -1) + { + FatalErrorIn + ( + "surfaceSlipDisplacementPointPatchVectorField::calcProjection()" + ) << "Cannot find zone " << frozenPointsZone_ << endl + << "Valid zones are " << pZones.name() << exit(FatalError); + } - zonePtr = &pZones[pZones.findZoneID(frozenPointsZone_)]; + zonePtr = &pZones[zoneID]; Pout<< "surfaceSlipDisplacementPointPatchVectorField : Fixing all " << zonePtr->size() << " points in pointZone " << zonePtr->name() -- 2.11.4.GIT