mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: snappyHexMesh: Cleanup of parallel cyclics. See #1731.
This commit is contained in:
@ -28,6 +28,8 @@ License
|
||||
#include "weightedPosition.H"
|
||||
#include "vectorTensorTransform.H"
|
||||
#include "coupledPolyPatch.H"
|
||||
#include "polyMesh.H"
|
||||
#include "syncTools.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -150,4 +152,54 @@ void Foam::weightedPosition::operator()
|
||||
}
|
||||
|
||||
|
||||
void Foam::weightedPosition::syncPoints
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
List<weightedPosition>& fld
|
||||
)
|
||||
{
|
||||
if (fld.size() != mesh.nPoints())
|
||||
{
|
||||
FatalErrorInFunction << "Size of field " << fld.size()
|
||||
<< " does not correspond to the number of points in the mesh "
|
||||
<< mesh.nPoints() << exit(FatalError);
|
||||
}
|
||||
|
||||
syncTools::syncPointList
|
||||
(
|
||||
mesh,
|
||||
fld,
|
||||
weightedPosition::plusEqOp, // combine op
|
||||
pTraits<weightedPosition>::zero,// null value (not used)
|
||||
pTraits<weightedPosition>::zero // transform class
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::weightedPosition::syncPoints
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelUList& meshPoints,
|
||||
List<weightedPosition>& fld
|
||||
)
|
||||
{
|
||||
if (fld.size() != meshPoints.size())
|
||||
{
|
||||
FatalErrorInFunction << "Size of field " << fld.size()
|
||||
<< " does not correspond to the number of points supplied "
|
||||
<< meshPoints.size() << exit(FatalError);
|
||||
}
|
||||
|
||||
syncTools::syncPointList
|
||||
(
|
||||
mesh,
|
||||
meshPoints,
|
||||
fld,
|
||||
weightedPosition::plusEqOp, // combine op
|
||||
pTraits<weightedPosition>::zero,// null value (not used)
|
||||
pTraits<weightedPosition>::zero // transform class
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -79,6 +79,7 @@ namespace Foam
|
||||
class weightedPosition;
|
||||
class vectorTensorTransform;
|
||||
class coupledPolyPatch;
|
||||
class polyMesh;
|
||||
|
||||
//- pTraits
|
||||
template<>
|
||||
@ -160,6 +161,22 @@ public:
|
||||
const coupledPolyPatch& cpp,
|
||||
Container<weightedPosition>& map
|
||||
) const;
|
||||
|
||||
|
||||
//- Synchronisation for mesh point positions
|
||||
static void syncPoints
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
List<weightedPosition>&
|
||||
);
|
||||
|
||||
//- Synchronisation for patch point positions
|
||||
static void syncPoints
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const labelUList& meshPoints,
|
||||
List<weightedPosition>&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -255,15 +255,8 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::smoothInternalDisplacement
|
||||
}
|
||||
}
|
||||
|
||||
// Sum
|
||||
syncTools::syncPointList
|
||||
(
|
||||
mesh,
|
||||
sumLocation,
|
||||
weightedPosition::plusEqOp, // combine op
|
||||
pTraits<weightedPosition>::zero,// null value (not used)
|
||||
pTraits<weightedPosition>::zero // transform class
|
||||
);
|
||||
// Add coupled contributions
|
||||
weightedPosition::syncPoints(mesh, sumLocation);
|
||||
|
||||
tmp<pointField> tdisplacement(new pointField(mesh.nPoints(), Zero));
|
||||
pointField& displacement = tdisplacement.ref();
|
||||
@ -384,15 +377,8 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::smoothPatchDisplacement
|
||||
}
|
||||
}
|
||||
|
||||
syncTools::syncPointList
|
||||
(
|
||||
mesh,
|
||||
pp.meshPoints(),
|
||||
avgBoundary,
|
||||
weightedPosition::plusEqOp, // combine op
|
||||
pTraits<weightedPosition>::zero,// null value (not used)
|
||||
pTraits<weightedPosition>::zero // transform class
|
||||
);
|
||||
// Add coupled contributions
|
||||
weightedPosition::syncPoints(mesh, pp.meshPoints(), avgBoundary);
|
||||
|
||||
// Normalise
|
||||
forAll(avgBoundary, i)
|
||||
@ -464,15 +450,8 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::smoothPatchDisplacement
|
||||
}
|
||||
}
|
||||
|
||||
syncTools::syncPointList
|
||||
(
|
||||
mesh,
|
||||
globalSum,
|
||||
weightedPosition::plusEqOp, // combine op
|
||||
pTraits<weightedPosition>::zero,// null value (not used)
|
||||
pTraits<weightedPosition>::zero // transform class
|
||||
);
|
||||
|
||||
// Add coupled contributions
|
||||
weightedPosition::syncPoints(mesh, globalSum);
|
||||
|
||||
avgInternal.setSize(meshPoints.size());
|
||||
|
||||
@ -1010,15 +989,8 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::avgCellCentres
|
||||
}
|
||||
}
|
||||
|
||||
syncTools::syncPointList
|
||||
(
|
||||
mesh,
|
||||
pp.meshPoints(),
|
||||
avgBoundary,
|
||||
weightedPosition::plusEqOp, // combine op
|
||||
pTraits<weightedPosition>::zero,// null value (not used)
|
||||
pTraits<weightedPosition>::zero // transform class
|
||||
);
|
||||
// Add coupled contributions
|
||||
weightedPosition::syncPoints(mesh, pp.meshPoints(), avgBoundary);
|
||||
|
||||
tmp<pointField> tavgBoundary(new pointField(avgBoundary.size()));
|
||||
weightedPosition::getPoints(avgBoundary, tavgBoundary.ref());
|
||||
|
||||
Reference in New Issue
Block a user