BUG: nGrow of layer disabling not handled correctly.

Now also moved to within layer iteration loop.
This commit is contained in:
mattijs
2010-03-30 21:49:37 +01:00
parent 883dbc2e2d
commit d8c1aa3afd
2 changed files with 42 additions and 13 deletions

View File

@ -1376,7 +1376,7 @@ void Foam::autoLayerDriver::growNoExtrusion
pointField& patchDisp,
labelList& patchNLayers,
List<extrudeMode>& extrudeStatus
)
) const
{
Info<< nl << "Growing non-extrusion points by one layer ..." << endl;
@ -1407,7 +1407,7 @@ void Foam::autoLayerDriver::growNoExtrusion
{
if
(
extrudeStatus[f[fp]] == NOEXTRUDE
extrudeStatus[f[fp]] == EXTRUDE
&& grownExtrudeStatus[f[fp]] != NOEXTRUDE
)
{
@ -1420,6 +1420,31 @@ void Foam::autoLayerDriver::growNoExtrusion
extrudeStatus.transfer(grownExtrudeStatus);
// Synchronise since might get called multiple times.
// Use the fact that NOEXTRUDE is the minimum value.
{
labelList status(extrudeStatus.size());
forAll(status, i)
{
status[i] = extrudeStatus[i];
}
syncTools::syncPointList
(
meshRefiner_.mesh(),
pp.meshPoints(),
status,
minEqOp<label>(),
labelMax, // null value
false // no separation
);
forAll(status, i)
{
extrudeStatus[i] = extrudeMode(status[i]);
}
}
forAll(extrudeStatus, patchPointI)
{
if (extrudeStatus[patchPointI] == NOEXTRUDE)
@ -2712,8 +2737,6 @@ void Foam::autoLayerDriver::addLayers
const labelList& meshPoints = patches[patchI].meshPoints();
//scalar maxThickness = -VGREAT;
//scalar minThickness = VGREAT;
scalar sumThickness = 0;
scalar sumNearWallThickness = 0;
@ -2721,8 +2744,6 @@ void Foam::autoLayerDriver::addLayers
{
label ppPointI = pp().meshPointMap()[meshPoints[patchPointI]];
//maxThickness = max(maxThickness, thickness[ppPointI]);
//minThickness = min(minThickness, thickness[ppPointI]);
sumThickness += thickness[ppPointI];
label nLay = patchNLayers[ppPointI];
@ -2750,8 +2771,6 @@ void Foam::autoLayerDriver::addLayers
if (totNPoints > 0)
{
//reduce(maxThickness, maxOp<scalar>());
//reduce(minThickness, minOp<scalar>());
avgThickness =
returnReduce(sumThickness, sumOp<scalar>())
/ totNPoints;
@ -2767,8 +2786,6 @@ void Foam::autoLayerDriver::addLayers
<< " " << setw(6) << layerParams.numLayers()[patchI]
<< " " << setw(8) << avgNearWallThickness
<< " " << setw(8) << avgThickness
//<< " " << setw(8) << minThickness
//<< " " << setw(8) << maxThickness
<< endl;
}
Info<< endl;
@ -3148,6 +3165,19 @@ void Foam::autoLayerDriver::addLayers
meshMover().movePoints(oldPoints);
meshMover().correct();
// Grow out region of non-extrusion
for (label i = 0; i < layerParams.nGrow(); i++)
{
growNoExtrusion
(
pp,
patchDisp,
patchNLayers,
extrudeStatus
);
}
Info<< endl;
}
@ -3294,7 +3324,6 @@ void Foam::autoLayerDriver::doLayers
// Balance
if (Pstream::parRun())
if (Pstream::parRun() && preBalance)
{
Info<< nl

View File

@ -233,13 +233,13 @@ class autoLayerDriver
) const;
//- Grow no-extrusion layer.
static void growNoExtrusion
void growNoExtrusion
(
const indirectPrimitivePatch& pp,
pointField& patchDisp,
labelList& patchNLayers,
List<extrudeMode>& extrudeStatus
);
) const;
//- Calculate pointwise wanted and minimum thickness.
// thickness: wanted thickness