diff --git a/applications/utilities/mesh/generation/cvMesh/cvMesh.C b/applications/utilities/mesh/generation/cvMesh/cvMesh.C index d8782c4f73..5d1f86bfd8 100644 --- a/applications/utilities/mesh/generation/cvMesh/cvMesh.C +++ b/applications/utilities/mesh/generation/cvMesh/cvMesh.C @@ -62,11 +62,19 @@ int main(int argc, char *argv[]) Info<< nl << "Time = " << runTime.timeName() << endl; mesh.move(); + + Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; } mesh.writeMesh(); - Info<< nl << "End\n" << endl; + Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + + Info<< nl << "End" << nl << endl; return 0; } diff --git a/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C index b377d06ee4..33ac336916 100644 --- a/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C +++ b/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C @@ -862,7 +862,7 @@ void Foam::conformalVoronoiMesh::storeSizesAndAlignments { timeCheck(); - Info << " Initialise stored data" << endl; + Info << nl << " Initialise stored size and alignment data" << endl; sizeAndAlignmentLocations_.setSize(initPts.size()); @@ -885,13 +885,9 @@ void Foam::conformalVoronoiMesh::storeSizesAndAlignments timeCheck(); - Info<< " Initialise sizeAndAlignmentTree_" << endl; - buildSizeAndAlignmentTree(); timeCheck(); - - Info<< " Initialised" << endl; } @@ -980,10 +976,15 @@ Foam::conformalVoronoiMesh::reconformationControl() const return FINE; } - else if(runTime_.timeIndex() % 10 == 0) + else if + ( + runTime_.timeIndex() + % cvMeshControls().surfaceConformationRebuildFrequency() + == 0 + ) { - Info<< nl << " Rebuilding surface conformation " - << "HARD CODED TO EVERY 10 STEPS" << endl; + Info<< nl << " Rebuilding surface conformation for more iterations" + << endl; return COARSE; } @@ -996,15 +997,13 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation reconformationMode reconfMode ) { - Info<< nl << " Build surface conformation" << endl; - if (reconfMode == COARSE) { - Info<< " Coarse surface conformation" << endl; + Info<< nl << " Build coarse surface conformation" << endl; } else if (reconfMode == FINE) { - Info<< " Fine surface conformation" << endl; + Info<< nl << " Build fine surface conformation" << endl; } else if (reconfMode == NONE) { @@ -1100,10 +1099,10 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation } } - Info<< nl <<" Initial conformation " << nl - << " number_of_vertices " << number_of_vertices() << nl - << " surfaceHits.size() " << surfaceHits.size() << nl - << " featureEdgeHits.size() " << featureEdgeHits.size() + Info<< nl <<" Initial conformation" << nl + << " Number of vertices " << number_of_vertices() << nl + << " Number of surface hits " << surfaceHits.size() << nl + << " Number of edge hits " << featureEdgeHits.size() << endl; insertSurfacePointPairs @@ -1201,10 +1200,10 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation } } - Info<< nl <<" iterationNo " << iterationNo << nl - << " number_of_vertices " << number_of_vertices() << nl - << " surfaceHits.size() " << surfaceHits.size() << nl - << " featureEdgeHits.size() " << featureEdgeHits.size() + Info<< nl <<" Conformation iteration " << iterationNo << nl + << " Number of vertices " << number_of_vertices() << nl + << " Number of surface hits " << surfaceHits.size() << nl + << " Number of edge hits " << featureEdgeHits.size() << endl; totalHits = surfaceHits.size() + featureEdgeHits.size(); @@ -2405,7 +2404,7 @@ void Foam::conformalVoronoiMesh::move() timeCheck(); - Info<< nl << " Looping over all dual faces" << endl; + Info<< nl << " Determining vertex displacements" << endl; vectorField cartesianDirections(3); @@ -2645,11 +2644,6 @@ void Foam::conformalVoronoiMesh::move() vector totalDisp = sum(displacementAccumulator); scalar totalDist = sum(mag(displacementAccumulator)); - Info<< " Total displacement = " << totalDisp << nl - << " Total distance = " << totalDist << nl - << " Points added = " << pointsAdded - << endl; - // Relax the calculated displacement displacementAccumulator *= relaxation; @@ -2691,17 +2685,29 @@ void Foam::conformalVoronoiMesh::move() timeCheck(); - Info<< nl << " Reinserting entire tessellation" << endl; + Info<< nl << " Inserting displaced tessellation" << endl; insertPoints(pointsToInsert); startOfSurfacePointPairs_ = number_of_vertices(); + label pointsRemoved = + displacementAccumulator.size() + - number_of_vertices() + + pointsAdded; + timeCheck(); conformToSurface(); timeCheck(); + + Info<< nl + << " Total displacement = " << totalDisp << nl + << " Total distance = " << totalDist << nl + << " Points added = " << pointsAdded << nl + << " Points removed = " << pointsRemoved + << endl; } diff --git a/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H b/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H index 880b0bcfdc..aed10fdd25 100644 --- a/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H +++ b/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H @@ -28,8 +28,11 @@ License inline void Foam::conformalVoronoiMesh::timeCheck() const { - Info<< nl << "--- [ " << runTime_.elapsedCpuTime() << "s, delta " - << runTime_.cpuTimeIncrement()<< "s ] --- " << endl; + if (cvMeshControls().timeChecks()) + { + Info<< nl << "--- [ " << runTime_.elapsedCpuTime() << "s, delta " + << runTime_.cpuTimeIncrement()<< "s ] --- " << endl; + } } diff --git a/src/conformalVoronoiMesh/cvControls/cvControls.C b/src/conformalVoronoiMesh/cvControls/cvControls.C index 5a37b7db13..211d824f89 100644 --- a/src/conformalVoronoiMesh/cvControls/cvControls.C +++ b/src/conformalVoronoiMesh/cvControls/cvControls.C @@ -49,6 +49,8 @@ Foam::cvControls::cvControls spanSqr_ = sqr(span_); + timeChecks_ = false; + // Surface conformation controls const dictionary& surfDict(cvMeshDict_.subDict("surfaceConformation")); @@ -83,7 +85,13 @@ Foam::cvControls::cvControls surfDict.lookup("maxSurfaceProtrusionCoeff") ); - maxQuadAngle_= readScalar(surfDict.lookup("maxQuadAngle")); + maxQuadAngle_ = readScalar(surfDict.lookup("maxQuadAngle")); + + surfaceConformationRebuildFrequency_ = max + ( + 1, + readLabel(surfDict.lookup("surfaceConformationRebuildFrequency")) + ); // Motion control controls diff --git a/src/conformalVoronoiMesh/cvControls/cvControls.H b/src/conformalVoronoiMesh/cvControls/cvControls.H index 12d543062d..0f859dab4e 100644 --- a/src/conformalVoronoiMesh/cvControls/cvControls.H +++ b/src/conformalVoronoiMesh/cvControls/cvControls.H @@ -69,6 +69,9 @@ class cvControls //- Square of span_ scalar spanSqr_; + //- Activate/deactivate detailed timeChecks during meshing + bool timeChecks_; + // Surface conformation controls //- Point pair spacing coefficient - fraction of the local target @@ -102,6 +105,9 @@ class cvControls // additional "mitering" lines are added scalar maxQuadAngle_; + //- Now often to rebuild the surface conformation + label surfaceConformationRebuildFrequency_; + // Motion control controls @@ -175,6 +181,9 @@ public: //- Return spanSqr inline scalar spanSqr() const; + //- Return timeChecks + inline bool timeChecks() const; + //- Return the pointPairDistanceCoeff inline scalar pointPairDistanceCoeff() const; @@ -196,6 +205,9 @@ public: //- Return the maxQuadAngle inline scalar maxQuadAngle() const; + //- Return the surfaceConformationRebuildFrequency + inline label surfaceConformationRebuildFrequency() const; + //- Return the objOutput Switch inline bool objOutput() const; diff --git a/src/conformalVoronoiMesh/cvControls/cvControlsI.H b/src/conformalVoronoiMesh/cvControls/cvControlsI.H index af8d5678ed..90129aeb42 100644 --- a/src/conformalVoronoiMesh/cvControls/cvControlsI.H +++ b/src/conformalVoronoiMesh/cvControls/cvControlsI.H @@ -44,6 +44,12 @@ inline Foam::scalar Foam::cvControls::spanSqr() const } +inline bool Foam::cvControls::timeChecks() const +{ + return timeChecks_; +} + + inline Foam::scalar Foam::cvControls::pointPairDistanceCoeff() const { return pointPairDistanceCoeff_; @@ -86,6 +92,12 @@ inline Foam::scalar Foam::cvControls::maxQuadAngle() const } +inline Foam::label Foam::cvControls::surfaceConformationRebuildFrequency() const +{ + return surfaceConformationRebuildFrequency_; +} + + inline bool Foam::cvControls::objOutput() const { return objOutput_;