Commit bfc3a696 authored by mattijs's avatar mattijs
Browse files

use relaxed mesh checks in shrinking as well as layering

parent 2d96e32b
......@@ -2804,6 +2804,22 @@ void Foam::autoLayerDriver::addLayers
<< "Layer addition iteration " << iteration << nl
<< "--------------------------" << 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.
syncPatchDisplacement
(
......@@ -2845,6 +2861,7 @@ void Foam::autoLayerDriver::addLayers
shrinkMeshMedialDistance
(
meshMover,
meshQualityDict,
layerParams.nSmoothThickness(),
layerParams.maxThicknessToMedialRatio(),
......@@ -3044,19 +3061,6 @@ void Foam::autoLayerDriver::addLayers
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
(
......
......@@ -473,6 +473,7 @@ class autoLayerDriver
void shrinkMeshMedialDistance
(
motionSmoother& meshMover,
const dictionary& meshQualityDict,
const label nSmoothThickness,
const scalar maxThicknessToMedialRatio,
const label nAllowableErrors,
......
......@@ -792,7 +792,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
wallInfo,
pointWallDist,
edgeWallDist,
mesh.nPoints() // max iterations
mesh.globalData().nTotalPoints() // max iterations
);
}
......@@ -897,7 +897,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
pointMedialDist,
edgeMedialDist,
mesh.nPoints() // max iterations
mesh.globalData().nTotalPoints() // max iterations
);
// Extract medial axis distance as pointScalarField
......@@ -953,6 +953,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
void Foam::autoLayerDriver::shrinkMeshMedialDistance
(
motionSmoother& meshMover,
const dictionary& meshQualityDict,
const label nSmoothThickness,
const scalar maxThicknessToMedialRatio,
const label nAllowableErrors,
......@@ -1103,7 +1104,7 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
wallInfo,
pointWallDist,
edgeWallDist,
mesh.nPoints() // max iterations
mesh.globalData().nTotalPoints() // max iterations
);
}
......@@ -1138,7 +1139,18 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
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;
break;
......
......@@ -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()
{
return displacement_;
......
......@@ -327,6 +327,8 @@ public:
//- Patch labels that are being adapted
const labelList& adaptPatchIDs() const;
const dictionary& paramDict() const;
//- Reference to displacement field
pointVectorField& displacement();
......
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