From dedde07d96e37c80180c1017db4a4ba279af4872 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Tue, 19 Sep 2017 12:01:05 +0100 Subject: [PATCH 001/636] ENH: AMI - added profiling hooks --- .../AMIInterpolation/AMIInterpolation.C | 28 +++++++++++++------ .../faceAreaWeightAMI/faceAreaWeightAMI.C | 13 +++++++++ 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index d0a89190af..2ff86570a0 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -28,6 +28,7 @@ License #include "meshTools.H" #include "mapDistribute.H" #include "flipOp.H" +#include "profiling.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -128,10 +129,9 @@ void Foam::AMIInterpolation::projectPointsToSurface pointField& pts ) const { - if (debug) - { - Info<< "AMI: projecting points to surface" << endl; - } + addProfiling(ami, "AMIInterpolation::projectPointsToSurface"); + + DebugInfo<< "AMI: projecting points to surface" << endl; List nearInfo; @@ -148,8 +148,8 @@ void Foam::AMIInterpolation::projectPointsToSurface } else { - pts[i] = pts[i]; - nMiss++; + // Point remains unchanged + ++nMiss; } } @@ -176,6 +176,8 @@ void Foam::AMIInterpolation::normaliseWeights const scalar lowWeightTol ) { + addProfiling(ami, "AMIInterpolation::normaliseWeights"); + // Normalise the weights wghtSum.setSize(wght.size(), 0.0); label nLowWeight = 0; @@ -261,6 +263,8 @@ void Foam::AMIInterpolation::agglomerate autoPtr& tgtMap ) { + addProfiling(ami, "AMIInterpolation::agglomerate"); + label sourceCoarseSize = ( sourceRestrictAddressing.size() @@ -357,7 +361,7 @@ void Foam::AMIInterpolation::agglomerate { oldToNew[coarseElem] = newi; newSubMap[newi] = coarseElem; - newi++; + ++newi; } } newSubMap.setSize(newi); @@ -438,7 +442,7 @@ void Foam::AMIInterpolation::agglomerate oldToNew[coarseElem] = newi; tgtCompactMap[fineElem] = compacti; newConstructMap[newi] = compacti++; - newi++; + ++newi; } else { @@ -864,6 +868,8 @@ void Foam::AMIInterpolation::update const TargetPatch& tgtPatch ) { + addProfiling(ami, "AMIInterpolation::update"); + label srcTotalSize = returnReduce(srcPatch.size(), sumOp