use relaxed mesh checks in shrinking as well as layering

This commit is contained in:
mattijs
2009-04-28 12:14:05 +01:00
parent 2d96e32b13
commit bfc3a6961e
5 changed files with 42 additions and 17 deletions

View File

@ -2804,6 +2804,22 @@ void Foam::autoLayerDriver::addLayers
<< "Layer addition iteration " << iteration << nl << "Layer addition iteration " << iteration << nl
<< "--------------------------" << endl; << "--------------------------" << endl;
// Unset the extrusion at the pp.
const dictionary& meshQualityDict =
(
iteration < layerParams.nRelaxedIter()
? motionDict
: motionDict.subDict("relaxed")
);
if (iteration >= layerParams.nRelaxedIter())
{
Info<< "Switched to relaxed meshQuality constraints." << endl;
}
// Make sure displacement is equal on both sides of coupled patches. // Make sure displacement is equal on both sides of coupled patches.
syncPatchDisplacement syncPatchDisplacement
( (
@ -2845,6 +2861,7 @@ void Foam::autoLayerDriver::addLayers
shrinkMeshMedialDistance shrinkMeshMedialDistance
( (
meshMover, meshMover,
meshQualityDict,
layerParams.nSmoothThickness(), layerParams.nSmoothThickness(),
layerParams.maxThicknessToMedialRatio(), layerParams.maxThicknessToMedialRatio(),
@ -3044,19 +3061,6 @@ void Foam::autoLayerDriver::addLayers
layerFacesSet.write(); layerFacesSet.write();
} }
// Unset the extrusion at the pp.
const dictionary& meshQualityDict =
(
iteration < layerParams.nRelaxedIter()
? motionDict
: motionDict.subDict("relaxed")
);
if (iteration >= layerParams.nRelaxedIter())
{
Info<< "Switched to relaxed meshQuality constraints." << endl;
}
label nTotChanged = checkAndUnmark label nTotChanged = checkAndUnmark
( (

View File

@ -473,6 +473,7 @@ class autoLayerDriver
void shrinkMeshMedialDistance void shrinkMeshMedialDistance
( (
motionSmoother& meshMover, motionSmoother& meshMover,
const dictionary& meshQualityDict,
const label nSmoothThickness, const label nSmoothThickness,
const scalar maxThicknessToMedialRatio, const scalar maxThicknessToMedialRatio,
const label nAllowableErrors, const label nAllowableErrors,

View File

@ -792,7 +792,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
wallInfo, wallInfo,
pointWallDist, pointWallDist,
edgeWallDist, edgeWallDist,
mesh.nPoints() // max iterations mesh.globalData().nTotalPoints() // max iterations
); );
} }
@ -897,7 +897,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
pointMedialDist, pointMedialDist,
edgeMedialDist, edgeMedialDist,
mesh.nPoints() // max iterations mesh.globalData().nTotalPoints() // max iterations
); );
// Extract medial axis distance as pointScalarField // Extract medial axis distance as pointScalarField
@ -953,6 +953,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
void Foam::autoLayerDriver::shrinkMeshMedialDistance void Foam::autoLayerDriver::shrinkMeshMedialDistance
( (
motionSmoother& meshMover, motionSmoother& meshMover,
const dictionary& meshQualityDict,
const label nSmoothThickness, const label nSmoothThickness,
const scalar maxThicknessToMedialRatio, const scalar maxThicknessToMedialRatio,
const label nAllowableErrors, const label nAllowableErrors,
@ -1103,7 +1104,7 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
wallInfo, wallInfo,
pointWallDist, pointWallDist,
edgeWallDist, edgeWallDist,
mesh.nPoints() // max iterations mesh.globalData().nTotalPoints() // max iterations
); );
} }
@ -1138,7 +1139,18 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
oldErrorReduction = meshMover.setErrorReduction(0.0); oldErrorReduction = meshMover.setErrorReduction(0.0);
} }
if (meshMover.scaleMesh(checkFaces, true, nAllowableErrors)) if
(
meshMover.scaleMesh
(
checkFaces,
List<labelPair>(0),
meshMover.paramDict(),
meshQualityDict,
true,
nAllowableErrors
)
)
{ {
Info<< "shrinkMeshMedialDistance : Successfully moved mesh" << endl; Info<< "shrinkMeshMedialDistance : Successfully moved mesh" << endl;
break; break;

View File

@ -502,6 +502,12 @@ const Foam::labelList& Foam::motionSmoother::adaptPatchIDs() const
} }
const Foam::dictionary& Foam::motionSmoother::paramDict() const
{
return paramDict_;
}
Foam::pointVectorField& Foam::motionSmoother::displacement() Foam::pointVectorField& Foam::motionSmoother::displacement()
{ {
return displacement_; return displacement_;

View File

@ -327,6 +327,8 @@ public:
//- Patch labels that are being adapted //- Patch labels that are being adapted
const labelList& adaptPatchIDs() const; const labelList& adaptPatchIDs() const;
const dictionary& paramDict() const;
//- Reference to displacement field //- Reference to displacement field
pointVectorField& displacement(); pointVectorField& displacement();