diff --git a/src/dynamicMesh/motionSmoother/motionSmoother.C b/src/dynamicMesh/motionSmoother/motionSmoother.C index c7d5d28e765ada2e25f0562519b16b5b5c7c4d7d..dad3ea59774e79359825640844dcd9ce9d83a3b1 100644 --- a/src/dynamicMesh/motionSmoother/motionSmoother.C +++ b/src/dynamicMesh/motionSmoother/motionSmoother.C @@ -678,34 +678,8 @@ void Foam::motionSmoother::correct() } -void Foam::motionSmoother::setDisplacement(pointField& patchDisp) +void Foam::motionSmoother::setDisplacementPatchFields() { - // See comment in .H file about shared points. - const polyBoundaryMesh& patches = mesh_.boundaryMesh(); - - forAll(patches, patchI) - { - const polyPatch& pp = patches[patchI]; - - if (pp.coupled()) - { - const labelList& meshPoints = pp.meshPoints(); - - forAll(meshPoints, i) - { - displacement_[meshPoints[i]] = vector::zero; - } - } - } - - const labelList& ppMeshPoints = pp_.meshPoints(); - - // Set internal point data from displacement on combined patch points. - forAll(ppMeshPoints, patchPointI) - { - displacement_[ppMeshPoints[patchPointI]] = patchDisp[patchPointI]; - } - // Adapt the fixedValue bc's (i.e. copy internal point data to // boundaryField for all affected patches) forAll(adaptPatchIDs_, i) @@ -765,6 +739,42 @@ void Foam::motionSmoother::setDisplacement(pointField& patchDisp) displacement_.boundaryField()[patchI] == displacement_.boundaryField()[patchI].patchInternalField(); } +} + + +void Foam::motionSmoother::setDisplacement(pointField& patchDisp) +{ + // See comment in .H file about shared points. + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + + if (pp.coupled()) + { + const labelList& meshPoints = pp.meshPoints(); + + forAll(meshPoints, i) + { + displacement_[meshPoints[i]] = vector::zero; + } + } + } + + const labelList& ppMeshPoints = pp_.meshPoints(); + + // Set internal point data from displacement on combined patch points. + forAll(ppMeshPoints, patchPointI) + { + displacement_[ppMeshPoints[patchPointI]] = patchDisp[patchPointI]; + } + + + // Adapt the fixedValue bc's (i.e. copy internal point data to + // boundaryField for all affected patches) + setDisplacementPatchFields(); + if (debug) { diff --git a/src/dynamicMesh/motionSmoother/motionSmoother.H b/src/dynamicMesh/motionSmoother/motionSmoother.H index ee5432ad4ec4218768f8226a95770ecd71915897..fff07c4b94a8a73c1490ef084024a93bb73f8a3b 100644 --- a/src/dynamicMesh/motionSmoother/motionSmoother.H +++ b/src/dynamicMesh/motionSmoother/motionSmoother.H @@ -385,6 +385,10 @@ public: //- Take over existing mesh position. void correct(); + //- Set patch fields on displacement to be consistent with + // internal values. + void setDisplacementPatchFields(); + //- Set displacement field from displacement on patch points. // Modify provided displacement to be consistent with actual // boundary conditions on displacement. Note: resets the