diff --git a/applications/utilities/mesh/manipulation/Optional/setSet/setSet.C b/applications/utilities/mesh/manipulation/Optional/setSet/setSet.C index 705ffed422f6f7dd440fdbd71dd115b8e8255152..3c3f01de93fe743590fb4f17316c049be4317d4e 100644 --- a/applications/utilities/mesh/manipulation/Optional/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/Optional/setSet/setSet.C @@ -47,7 +47,7 @@ Description #include <stdio.h> -#ifdef READLINE +#if READLINE != 0 #include <readline/readline.h> #include <readline/history.h> #endif @@ -57,7 +57,7 @@ using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef READLINE +#if READLINE != 0 static const char* historyFile = ".setSet"; #endif @@ -739,7 +739,7 @@ int main(int argc, char *argv[]) fileStreamPtr = new std::ifstream(batchFile.c_str()); } -#ifdef READLINE +#if READLINE != 0 else if (!read_history(historyFile)) { Info<< "Successfully read history from " << historyFile << endl; @@ -784,7 +784,7 @@ int main(int argc, char *argv[]) } else { -# ifdef READLINE +# if READLINE != 0 { char* linePtr = readline("readline>"); diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C index dcbab5c1b9633628364b4aefbc6a09f186fb4226..ecfb565038928621e09b2fcf6323e62c5f36e8ab 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) if (!noTopology) { - noFailedChecks += checkTopology(mesh, allTopology); + noFailedChecks += checkTopology(mesh, allTopology, allGeometry); } noFailedChecks += checkGeometry(mesh, allGeometry); diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C index 6fbb2c0bf9ee08617cb9984ed47f2f73912d0849..85dc0bae62720f8bf7f8fd1219624cc176c29289 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C @@ -7,7 +7,12 @@ #include "pointSet.H" #include "IOmanip.H" -Foam::label Foam::checkTopology(const polyMesh& mesh, const bool allTopology) +Foam::label Foam::checkTopology +( + const polyMesh& mesh, + const bool allTopology, + const bool allGeometry +) { label noFailedChecks = 0; @@ -142,39 +147,38 @@ Foam::label Foam::checkTopology(const polyMesh& mesh, const bool allTopology) << setw(20) << "Patch" << setw(9) << "Faces" << setw(9) << "Points" - << " Surface" << endl; + << setw(34) << "Surface topology"; + if (allGeometry) + { + Pout<< " Bounding box"; + } + Pout<< endl; forAll(patches, patchI) { const polyPatch& pp = patches[patchI]; + Pout<< " " + << setw(20) << pp.name() + << setw(9) << pp.size() + << setw(9) << pp.nPoints(); + + primitivePatch::surfaceTopo pTyp = pp.surfaceType(); if (pp.size() == 0) { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " ok (empty)" << endl; + Pout<< setw(34) << "ok (empty)"; } else if (pTyp == primitivePatch::MANIFOLD) { if (pp.checkPointManifold(true, &points)) { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " multiply connected (shared point)" << endl; + Pout<< setw(34) << "multiply connected (shared point)"; } else { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " ok (closed singly connected surface)" << endl; + Pout<< setw(34) << "ok (closed singly connected)"; } // Add points on non-manifold edges to make set complete @@ -186,22 +190,35 @@ Foam::label Foam::checkTopology(const polyMesh& mesh, const bool allTopology) if (pTyp == primitivePatch::OPEN) { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " ok (not multiply connected)" << endl; + Pout<< setw(34) << "ok (non-closed singly connected)"; } else { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " multiply connected surface (shared edge)" - << endl; + Pout<< setw(34) << "multiply connected (shared edge)"; + } + } + + if (allGeometry) + { + const pointField& pts = pp.points(); + const labelList& mp = pp.meshPoints(); + + boundBox bb(vector::zero, vector::zero); + if (returnReduce(mp.size(), sumOp<label>()) > 0) + { + bb.min() = pts[mp[0]]; + bb.max() = pts[mp[0]]; + for (label i = 1; i < mp.size(); i++) + { + bb.min() = min(bb.min(), pts[mp[i]]); + bb.max() = max(bb.max(), pts[mp[i]]); + } + reduce(bb.min(), minOp<vector>()); + reduce(bb.max(), maxOp<vector>()); } + Pout<< ' ' << bb; } + Pout<< endl; } if (points.size() > 0) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H index 00be2f2621eeb64850e2bccab0358722595e1b2e..787aa4318d21cbe49eb162932f74f94ff5444757 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H @@ -4,5 +4,5 @@ namespace Foam { class polyMesh; - label checkTopology(const polyMesh& mesh, const bool allTopology); + label checkTopology(const polyMesh&, const bool, const bool); } diff --git a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C index 84bca40cf87bf4456f47ff430d2e0be3d405a50f..4c09f35ae7941a46956ad8a8903388963a4d66c4 100644 --- a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C +++ b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------------------*\ +/*---------------------------------------------------------------------------* \ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | @@ -333,7 +333,7 @@ Foam::labelList Foam::faceCoupleInfo::findMappedEdges label v0 = pointMap[e[0]]; label v1 = pointMap[e[1]]; - toPatchEdges[edgeI] = + toPatchEdges[edgeI] = meshTools::findEdge ( patch.edges(), @@ -517,7 +517,7 @@ void Foam::faceCoupleInfo::setCutEdgeToPoints(const labelList& cutToMasterEdges) labelListList masterToCutEdges ( invertOneToMany - ( + ( masterPatch().nEdges(), cutToMasterEdges ) @@ -577,7 +577,7 @@ void Foam::faceCoupleInfo::setCutEdgeToPoints(const labelList& cutToMasterEdges) while (startVertI != unsplitEdge[1]) { - // Loop over all string of edges. Update + // Loop over all string of edges. Update // - startVertI : previous vertex // - startEdgeI : previous edge // and insert any points into splitPoints @@ -995,7 +995,7 @@ void Foam::faceCoupleInfo::findPerfectMatchingFaces nMatched++; } } - + mesh0Faces.setSize(nMatched); mesh1Faces.setSize(nMatched); } @@ -1050,7 +1050,7 @@ void Foam::faceCoupleInfo::findSlavesCoveringMaster point fc(f1.centre(mesh1.points())); // Search in bounding box of face only. - treeBoundBox tightest(f1.points(mesh1.points())); + treeBoundBox tightest(static_cast<const pointField&>(f1.points(mesh1.points()))); scalar tightestDist = GREAT; @@ -1509,7 +1509,7 @@ void Foam::faceCoupleInfo::perfectPointMatch // Cut faces to slave patch. bool matchedAllFaces = false; - + if (slaveFacesOrdered) { cutToSlaveFaces_ = identity(cutFaces().size()); @@ -1576,7 +1576,7 @@ void Foam::faceCoupleInfo::perfectPointMatch compactToCut // compaction map: from compacted to cut ); - + // Use compaction lists to renumber cutPoints. cutPoints_ = IndirectList<point>(cutPoints_, compactToCut)(); { @@ -1882,7 +1882,7 @@ void Foam::faceCoupleInfo::subDivisionMatch break; } } - + // All cut faces matched? forAll(cutToMasterFaces_, cutFaceI) diff --git a/wmake/wmakeScheduler b/wmake/wmakeScheduler index 1bf2d74d8af35ad6cf3e2019e41faf0c0e5ecc03..64ca18b0696373e3e97e8c2ae626c119d2bb5a6b 100755 --- a/wmake/wmakeScheduler +++ b/wmake/wmakeScheduler @@ -145,9 +145,6 @@ colourIndex=0 while : do - # 0.5 sec - usleep 500000 - for slotGroup in $WM_HOSTS do # split 'host:N', but catch 'host:' and 'host' too @@ -159,11 +156,8 @@ do i=0 while [ "$i" -lt "$n" ] do - lock="$host:$i" - if [ ! -f "$lockDir/$lock" ]; then - # Set lock - touch "$lockDir/$lock" - + lockFile="$lockDir/$host:$i" + if lockfile -r0 "$lockFile" 2>/dev/null; then # Set colour colour=${colours[$colourIndex]} #echo "** host=$host colourIndex=$colourIndex colour=$colour" @@ -186,7 +180,7 @@ do retval=$? # Release lock - rm -f "$lockDir/$lock" 2>/dev/null + rm -f "$lockFile" 2>/dev/null exit $retval fi i=$(expr $i + 1) @@ -198,6 +192,8 @@ do fi done done + # Not found any free slots. Rest a bit. + sleep 1 done if [ "$WM_COLOURS" ]; then