diff --git a/applications/test/Circulator/Test-Circulator.C b/applications/test/Circulator/Test-Circulator.C index 19a21f6b79..1369ef6e59 100644 --- a/applications/test/Circulator/Test-Circulator.C +++ b/applications/test/Circulator/Test-Circulator.C @@ -38,94 +38,6 @@ Description using namespace Foam; -// return -// 0: no match -// +1: identical -// -1: same face, but different orientation -label compare(const face& a, const face& b) -{ - // Basic rule: we assume that the sequence of labels in each list - // will be circular in the same order (but not necessarily in the - // same direction or from the same starting point). - - // Trivial reject: faces are different size - label sizeA = a.size(); - label sizeB = b.size(); - - if (sizeA != sizeB || sizeA == 0) - { - return 0; - } - - const_circulator aCirc(a); - const_circulator bCirc(b); - - // Rotate face b until its element matches the starting element of face a. - do - { - if (aCirc() == bCirc()) - { - // Set bCirc fulcrum to its iterator and increment the iterators - bCirc.setFulcrumToIterator(); - ++aCirc; - ++bCirc; - - break; - } - } while (bCirc.circulate(CirculatorBase::CLOCKWISE)); - - // Look forwards around the faces for a match - do - { - if (aCirc() != bCirc()) - { - break; - } - } - while - ( - aCirc.circulate(CirculatorBase::CLOCKWISE), - bCirc.circulate(CirculatorBase::CLOCKWISE) - ); - - // If the circulator has stopped then faces a and b matched. - if (!aCirc.circulate()) - { - return 1; - } - else - { - // Reset the circulators back to their fulcrum - aCirc.setIteratorToFulcrum(); - bCirc.setIteratorToFulcrum(); - ++aCirc; - --bCirc; - } - - // Look backwards around the faces for a match - do - { - if (aCirc() != bCirc()) - { - break; - } - } - while - ( - aCirc.circulate(CirculatorBase::CLOCKWISE), - bCirc.circulate(CirculatorBase::ANTICLOCKWISE) - ); - - // If the circulator has stopped then faces a and b matched. - if (!aCirc.circulate()) - { - return -1; - } - - return 0; -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Main program: @@ -184,40 +96,40 @@ int main(int argc, char *argv[]) Info<< nl << nl << "Compare two faces: " << endl; face a(identity(5)); - Info<< "Compare " << a << " and " << a << " Match = " << compare(a, a) + Info<< "Compare " << a << " and " << a << " Match = " << face::compare(a, a) << endl; face b(reverseList(a)); - Info<< "Compare " << a << " and " << b << " Match = " << compare(a, b) + Info<< "Compare " << a << " and " << b << " Match = " << face::compare(a, b) << endl; face c(a); c[4] = 3; - Info<< "Compare " << a << " and " << c << " Match = " << compare(a, c) + Info<< "Compare " << a << " and " << c << " Match = " << face::compare(a, c) << endl; face d(rotateList(a, 2)); - Info<< "Compare " << a << " and " << d << " Match = " << compare(a, d) + Info<< "Compare " << a << " and " << d << " Match = " << face::compare(a, d) << endl; face g(labelList(5, 1)); face h(g); - Info<< "Compare " << g << " and " << h << " Match = " << compare(g, h) + Info<< "Compare " << g << " and " << h << " Match = " << face::compare(g, h) << endl; g[0] = 2; h[3] = 2; - Info<< "Compare " << g << " and " << h << " Match = " << compare(g, h) + Info<< "Compare " << g << " and " << h << " Match = " << face::compare(g, h) << endl; g[4] = 3; h[4] = 3; - Info<< "Compare " << g << " and " << h << " Match = " << compare(g, h) + Info<< "Compare " << g << " and " << h << " Match = " << face::compare(g, h) << endl; face face1(identity(1)); Info<< "Compare " << face1 << " and " << face1 - << " Match = " << compare(face1, face1) << endl; + << " Match = " << face::compare(face1, face1) << endl; Info<< nl << nl << "Zero face" << nl << endl; diff --git a/applications/utilities/mesh/advanced/collapseEdges/collapseDict b/applications/utilities/mesh/advanced/collapseEdges/collapseDict index 60f4cb2f43..340c33049f 100644 --- a/applications/utilities/mesh/advanced/collapseEdges/collapseDict +++ b/applications/utilities/mesh/advanced/collapseEdges/collapseDict @@ -17,7 +17,7 @@ FoamFile collapseEdgesCoeffs { // Edges shorter than this absolute value will be merged - minimumEdgeLength 1e-8; + minimumEdgeLength 1e-6; // The maximum angle between two edges that share a point attached to // no other edges @@ -25,7 +25,7 @@ collapseEdgesCoeffs // The amount that minimumEdgeLength will be reduced by for each // edge if that edge's collapse generates a poor quality face - reductionFactor 0.5; + reductionFactor 0.5; } @@ -67,14 +67,17 @@ meshQualityCoeffs { // Name of the dictionary that has the mesh quality coefficients used // by motionSmoother::checkMesh - meshQualityCoeffDict meshQualityDict; + #include "meshQualityDict"; + + // Maximum number of smoothing iterations for the reductionFactors + maximumSmoothingIterations 2; // Maximum number of outer iterations is mesh quality checking is enabled - maximumIterations 10; + maximumIterations 10; // Maximum number of iterations deletion of a point can cause a bad face // to be constructed before it is forced to not be deleted - maxPointErrorCount 5; + maxPointErrorCount 5; } diff --git a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/Make/options b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/Make/options index f1db60d53f..fe1283a73a 100644 --- a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/Make/options +++ b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/Make/options @@ -1,5 +1,4 @@ EXE_INC = \ - /* -DFULLDEBUG -g -O0 */ \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ diff --git a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/patchToPoly2DMesh/patchToPoly2DMesh.C b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/patchToPoly2DMesh/patchToPoly2DMesh.C index 7979fa966a..1b83599b31 100644 --- a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/patchToPoly2DMesh/patchToPoly2DMesh.C +++ b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/patchToPoly2DMesh/patchToPoly2DMesh.C @@ -26,12 +26,6 @@ License #include "patchToPoly2DMesh.H" #include "PatchTools.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::patchToPoly2DMesh::flipFaceOrder() @@ -275,12 +269,9 @@ void Foam::patchToPoly2DMesh::createPolyMeshComponents() addPatchFacesToOwner(); } -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -//- Construct from a primitivePatch Foam::patchToPoly2DMesh::patchToPoly2DMesh ( const MeshedSurface& patch, @@ -321,13 +312,5 @@ void Foam::patchToPoly2DMesh::createMesh() } } -// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/patchToPoly2DMesh/patchToPoly2DMesh.H b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/patchToPoly2DMesh/patchToPoly2DMesh.H index ea27dc6f53..b7c81e68a2 100644 --- a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/patchToPoly2DMesh/patchToPoly2DMesh.H +++ b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/patchToPoly2DMesh/patchToPoly2DMesh.H @@ -51,6 +51,7 @@ class patchToPoly2DMesh { // Private data + // Reference to the meshed surface const MeshedSurface& patch_; const wordList& patchNames_; @@ -62,11 +63,16 @@ class patchToPoly2DMesh const EdgeMap