Commit e5e100ab authored by mattijs's avatar mattijs
Browse files

ENH: motionSmoother: split off patch consistency

parent 2514121d
...@@ -678,34 +678,8 @@ void Foam::motionSmoother::correct() ...@@ -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 // Adapt the fixedValue bc's (i.e. copy internal point data to
// boundaryField for all affected patches) // boundaryField for all affected patches)
forAll(adaptPatchIDs_, i) forAll(adaptPatchIDs_, i)
...@@ -765,6 +739,42 @@ void Foam::motionSmoother::setDisplacement(pointField& patchDisp) ...@@ -765,6 +739,42 @@ void Foam::motionSmoother::setDisplacement(pointField& patchDisp)
displacement_.boundaryField()[patchI] == displacement_.boundaryField()[patchI] ==
displacement_.boundaryField()[patchI].patchInternalField(); 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) if (debug)
{ {
......
...@@ -385,6 +385,10 @@ public: ...@@ -385,6 +385,10 @@ public:
//- Take over existing mesh position. //- Take over existing mesh position.
void correct(); void correct();
//- Set patch fields on displacement to be consistent with
// internal values.
void setDisplacementPatchFields();
//- Set displacement field from displacement on patch points. //- Set displacement field from displacement on patch points.
// Modify provided displacement to be consistent with actual // Modify provided displacement to be consistent with actual
// boundary conditions on displacement. Note: resets the // boundary conditions on displacement. Note: resets the
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment