From 62c80898d145f906540a04661056781ded8229fb Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Thu, 26 Nov 2015 16:24:56 +0000 Subject: [PATCH] BUG: motionSmoother: knock out displacement on points coupled to patch points Before was zeroing displacement on all coupled points before applying the displacement. This meant that we could not modify the internal displacement on coupled points before setting the patch displacement. Fixes #10. --- .../motionSmoother/motionSmootherAlgo.C | 25 ++++++++++++++++--- .../motionSmoother/motionSmootherAlgo.H | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C index d546ff86bb7..dbef33a6adf 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C +++ b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C @@ -514,12 +514,31 @@ void Foam::motionSmootherAlgo::setDisplacement const labelList& cppMeshPoints = mesh.globalData().coupledPatch().meshPoints(); - forAll(cppMeshPoints, i) + const labelList& ppMeshPoints = pp.meshPoints(); + + // Knock out displacement on points which are not on pp but are coupled + // to them since we want 'proper' values from displacement to take + // precedence. { - displacement[cppMeshPoints[i]] = vector::zero; + PackedBoolList isPatchPoint(mesh.nPoints()); + isPatchPoint.set(ppMeshPoints); + syncTools::syncPointList + ( + mesh, + isPatchPoint, + maxEqOp<unsigned int>(), + 0 + ); + forAll(cppMeshPoints, i) + { + label pointI = cppMeshPoints[i]; + if (isPatchPoint[pointI]) + { + displacement[pointI] = vector::zero; + } + } } - const labelList& ppMeshPoints = pp.meshPoints(); // Set internal point data from displacement on combined patch points. forAll(ppMeshPoints, patchPointI) diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H index 724658012e8..4cc17efdcd2 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H +++ b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H @@ -56,7 +56,8 @@ Note and/or edges but no faces of pp). Hence we have to be careful when e.g. synchronising displacements that the value from the processor which has faces of pp get priority. This is currently handled in setDisplacement - by resetting the internal displacement to zero before doing anything + by resetting the internal displacement to zero on coupled points + that are coupled to patch points before doing anything else. The combine operator used will give preference to non-zero values. -- GitLab