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, pointField& patchDisp,
labelList& patchNLayers, labelList& patchNLayers,
List<extrudeMode>& extrudeStatus List<extrudeMode>& extrudeStatus
) ) const
{ {
Info<< nl << "Growing non-extrusion points by one layer ..." << endl; Info<< nl << "Growing non-extrusion points by one layer ..." << endl;
@ -1407,7 +1407,7 @@ void Foam::autoLayerDriver::growNoExtrusion
{ {
if if
( (
extrudeStatus[f[fp]] == NOEXTRUDE extrudeStatus[f[fp]] == EXTRUDE
&& grownExtrudeStatus[f[fp]] != NOEXTRUDE && grownExtrudeStatus[f[fp]] != NOEXTRUDE
) )
{ {
@ -1420,6 +1420,31 @@ void Foam::autoLayerDriver::growNoExtrusion
extrudeStatus.transfer(grownExtrudeStatus); 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) forAll(extrudeStatus, patchPointI)
{ {
if (extrudeStatus[patchPointI] == NOEXTRUDE) if (extrudeStatus[patchPointI] == NOEXTRUDE)
@ -2712,8 +2737,6 @@ void Foam::autoLayerDriver::addLayers
const labelList& meshPoints = patches[patchI].meshPoints(); const labelList& meshPoints = patches[patchI].meshPoints();
//scalar maxThickness = -VGREAT;
//scalar minThickness = VGREAT;
scalar sumThickness = 0; scalar sumThickness = 0;
scalar sumNearWallThickness = 0; scalar sumNearWallThickness = 0;
@ -2721,8 +2744,6 @@ void Foam::autoLayerDriver::addLayers
{ {
label ppPointI = pp().meshPointMap()[meshPoints[patchPointI]]; label ppPointI = pp().meshPointMap()[meshPoints[patchPointI]];
//maxThickness = max(maxThickness, thickness[ppPointI]);
//minThickness = min(minThickness, thickness[ppPointI]);
sumThickness += thickness[ppPointI]; sumThickness += thickness[ppPointI];
label nLay = patchNLayers[ppPointI]; label nLay = patchNLayers[ppPointI];
@ -2750,8 +2771,6 @@ void Foam::autoLayerDriver::addLayers
if (totNPoints > 0) if (totNPoints > 0)
{ {
//reduce(maxThickness, maxOp<scalar>());
//reduce(minThickness, minOp<scalar>());
avgThickness = avgThickness =
returnReduce(sumThickness, sumOp<scalar>()) returnReduce(sumThickness, sumOp<scalar>())
/ totNPoints; / totNPoints;
@ -2767,8 +2786,6 @@ void Foam::autoLayerDriver::addLayers
<< " " << setw(6) << layerParams.numLayers()[patchI] << " " << setw(6) << layerParams.numLayers()[patchI]
<< " " << setw(8) << avgNearWallThickness << " " << setw(8) << avgNearWallThickness
<< " " << setw(8) << avgThickness << " " << setw(8) << avgThickness
//<< " " << setw(8) << minThickness
//<< " " << setw(8) << maxThickness
<< endl; << endl;
} }
Info<< endl; Info<< endl;
@ -3148,6 +3165,19 @@ void Foam::autoLayerDriver::addLayers
meshMover().movePoints(oldPoints); meshMover().movePoints(oldPoints);
meshMover().correct(); meshMover().correct();
// Grow out region of non-extrusion
for (label i = 0; i < layerParams.nGrow(); i++)
{
growNoExtrusion
(
pp,
patchDisp,
patchNLayers,
extrudeStatus
);
}
Info<< endl; Info<< endl;
} }
@ -3294,7 +3324,6 @@ void Foam::autoLayerDriver::doLayers
// Balance // Balance
if (Pstream::parRun())
if (Pstream::parRun() && preBalance) if (Pstream::parRun() && preBalance)
{ {
Info<< nl Info<< nl

View File

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