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.
This commit is contained in:
mattijs
2015-11-26 16:24:56 +00:00
parent 5d69e4ebaa
commit 62c80898d1
2 changed files with 24 additions and 4 deletions

View File

@ -514,12 +514,31 @@ void Foam::motionSmootherAlgo::setDisplacement
const labelList& cppMeshPoints = const labelList& cppMeshPoints =
mesh.globalData().coupledPatch().meshPoints(); mesh.globalData().coupledPatch().meshPoints();
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.
{
PackedBoolList isPatchPoint(mesh.nPoints());
isPatchPoint.set(ppMeshPoints);
syncTools::syncPointList
(
mesh,
isPatchPoint,
maxEqOp<unsigned int>(),
0
);
forAll(cppMeshPoints, i) forAll(cppMeshPoints, i)
{ {
displacement[cppMeshPoints[i]] = vector::zero; 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. // Set internal point data from displacement on combined patch points.
forAll(ppMeshPoints, patchPointI) forAll(ppMeshPoints, patchPointI)

View File

@ -56,7 +56,8 @@ Note
and/or edges but no faces of pp). Hence we have to be careful when e.g. 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 synchronising displacements that the value from the processor which has
faces of pp get priority. This is currently handled in setDisplacement 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 else. The combine operator used will give preference to non-zero
values. values.