diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C index 27461fe3bf9250da0e0c1424dfe04502c2631b5a..be7c7d2bfccbf6ea2acccb0d6a93ccbc4f98465d 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C @@ -74,6 +74,7 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io) false ) ), + zoneID_(-1), pointIDs_() { word cellZoneName = @@ -81,11 +82,11 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io) if (cellZoneName != "none") { - label zoneI = cellZones().findZoneID(cellZoneName); + zoneID_ = cellZones().findZoneID(cellZoneName); Info<< "Applying solid body motion to cellZone " << cellZoneName << endl; - const cellZone& cz = cellZones()[zoneI]; + const cellZone& cz = cellZones()[zoneID_]; // collect point IDs of points in cell zone @@ -139,7 +140,7 @@ bool Foam::solidBodyMotionFvMesh::update() { static bool hasWarned = false; - if (pointIDs_.size() > 0) + if (zoneID_ != -1) { pointField transformedPts(undisplacedPoints_); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.H index f84cfab0fc86f925cb225ac60eb028e8f2efde46..f6b9725fa0552d16f089b4e35abae6917531a1a8 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.H @@ -57,7 +57,7 @@ class solidBodyMotionFvMesh // Private data //- Dictionary of motion control parameters - dictionary dynamicMeshCoeffs_; + const dictionary dynamicMeshCoeffs_; //- The motion control function autoPtr<solidBodyMotionFunction> SBMFPtr_; @@ -65,6 +65,9 @@ class solidBodyMotionFvMesh //- The reference points which are transformed pointIOField undisplacedPoints_; + //- Specified cellZone or -1 for whole-body + label zoneID_; + //- Points to move when cell zone is supplied labelList pointIDs_;