From 5d1239146151a87e0ea545dcc54961dad6625740 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 2 Sep 2009 14:51:24 +0100 Subject: [PATCH 1/4] bail-out criterion was incorrect --- .../hierarchGeomDecomp/hierarchGeomDecomp.C | 51 +++++++------------ 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C b/src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C index bde1181c09..4ee04a7cdf 100644 --- a/src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C +++ b/src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C @@ -198,9 +198,7 @@ void Foam::hierarchGeomDecomp::findBinary label high = values.size(); // Safeguards to avoid infinite loop. - label lowPrev = -1; - label midPrev = -1; - label highPrev = -1; + scalar midValuePrev = VGREAT; while (true) { @@ -208,10 +206,10 @@ void Foam::hierarchGeomDecomp::findBinary if (debug) { - Pout<< "low:" << low << " lowValue:" << lowValue + Pout<< " low:" << low << " lowValue:" << lowValue << " high:" << high << " highValue:" << highValue - << " mid:" << mid << " midValue:" << midValue << nl - << "globalSize:" << size << " wantedSize:" << wantedSize + << " mid:" << mid << " midValue:" << midValue << endl + << " globalSize:" << size << " wantedSize:" << wantedSize << " sizeTol:" << sizeTol << endl; } @@ -235,10 +233,7 @@ void Foam::hierarchGeomDecomp::findBinary mid = findLower(values, midValue, low, high); // Safeguard if same as previous. - bool hasNotChanged = - (mid == midPrev) - && (low == lowPrev) - && (high == highPrev); + bool hasNotChanged = (mag(midValue-midValuePrev) < SMALL); if (returnReduce(hasNotChanged, andOp())) { @@ -248,9 +243,7 @@ void Foam::hierarchGeomDecomp::findBinary break; } - midPrev = mid; - lowPrev = low; - highPrev = high; + midValuePrev = midValue; } } @@ -280,9 +273,7 @@ void Foam::hierarchGeomDecomp::findBinary label high = values.size(); // Safeguards to avoid infinite loop. - label lowPrev = -1; - label midPrev = -1; - label highPrev = -1; + scalar midValuePrev = VGREAT; while (true) { @@ -294,10 +285,10 @@ void Foam::hierarchGeomDecomp::findBinary if (debug) { - Pout<< "low:" << low << " lowValue:" << lowValue + Pout<< " low:" << low << " lowValue:" << lowValue << " high:" << high << " highValue:" << highValue - << " mid:" << mid << " midValue:" << midValue << nl - << "globalSize:" << weightedSize + << " mid:" << mid << " midValue:" << midValue << endl + << " globalSize:" << weightedSize << " wantedSize:" << wantedSize << " sizeTol:" << sizeTol << endl; } @@ -322,10 +313,7 @@ void Foam::hierarchGeomDecomp::findBinary mid = findLower(values, midValue, low, high); // Safeguard if same as previous. - bool hasNotChanged = - (mid == midPrev) - && (low == lowPrev) - && (high == highPrev); + bool hasNotChanged = (mag(midValue-midValuePrev) < SMALL); if (returnReduce(hasNotChanged, andOp())) { @@ -335,9 +323,7 @@ void Foam::hierarchGeomDecomp::findBinary break; } - midPrev = mid; - lowPrev = low; - highPrev = high; + midValuePrev = midValue; } } @@ -460,11 +446,11 @@ void Foam::hierarchGeomDecomp::sortComponent if (debug) { Pout<< "For component " << compI << ", bin " << bin - << " copying" << nl + << " copying" << endl << "from " << leftCoord << " at local index " - << leftIndex << nl + << leftIndex << endl << "to " << rightCoord << " localSize:" - << localSize << nl + << localSize << endl << endl; } @@ -643,11 +629,11 @@ void Foam::hierarchGeomDecomp::sortComponent if (debug) { Pout<< "For component " << compI << ", bin " << bin - << " copying" << nl + << " copying" << endl << "from " << leftCoord << " at local index " - << leftIndex << nl + << leftIndex << endl << "to " << rightCoord << " localSize:" - << localSize << nl + << localSize << endl << endl; } @@ -788,7 +774,6 @@ Foam::labelList Foam::hierarchGeomDecomp::decompose pointField rotatedPoints = rotDelta_ & points; - // Calculate tolerance of cell distribution. For large cases finding // distibution to the cell exact would cause too many iterations so allow // some slack. From 6dc2e629466597f96bcadf4c4122d124a630dfe8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 2 Sep 2009 14:51:42 +0100 Subject: [PATCH 2/4] do not map demand driven geometric data --- .../mesh/manipulation/splitMeshRegions/splitMeshRegions.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index 1016794140..dfc657fe8f 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -1655,6 +1655,9 @@ int main(int argc, char *argv[]) Info<< endl; + // Remove any demand-driven fields ('S', 'V' etc) + mesh.clearOut(); + if (cellRegion.nRegions() == 1) { From 0a24060ac3ee15a394481337c33b1a1bbdd74b03 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 2 Sep 2009 15:22:40 +0100 Subject: [PATCH 3/4] superfluous function --- .../polyTopoChange/addPatchCellLayer.C | 28 +------------------ .../polyTopoChange/addPatchCellLayer.H | 9 ------ 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C index 1a725f0ebf..49b676b4bd 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C @@ -628,7 +628,7 @@ void Foam::addPatchCellLayer::setRefinement DynamicList