mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: AMI - added profiling hooks
This commit is contained in:
@ -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<SourcePatch, TargetPatch>::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<pointIndexHit> nearInfo;
|
||||
|
||||
@ -148,8 +148,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::projectPointsToSurface
|
||||
}
|
||||
else
|
||||
{
|
||||
pts[i] = pts[i];
|
||||
nMiss++;
|
||||
// Point remains unchanged
|
||||
++nMiss;
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,6 +176,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::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<SourcePatch, TargetPatch>::agglomerate
|
||||
autoPtr<mapDistribute>& tgtMap
|
||||
)
|
||||
{
|
||||
addProfiling(ami, "AMIInterpolation::agglomerate");
|
||||
|
||||
label sourceCoarseSize =
|
||||
(
|
||||
sourceRestrictAddressing.size()
|
||||
@ -357,7 +361,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::agglomerate
|
||||
{
|
||||
oldToNew[coarseElem] = newi;
|
||||
newSubMap[newi] = coarseElem;
|
||||
newi++;
|
||||
++newi;
|
||||
}
|
||||
}
|
||||
newSubMap.setSize(newi);
|
||||
@ -438,7 +442,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::agglomerate
|
||||
oldToNew[coarseElem] = newi;
|
||||
tgtCompactMap[fineElem] = compacti;
|
||||
newConstructMap[newi] = compacti++;
|
||||
newi++;
|
||||
++newi;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -864,6 +868,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
|
||||
const TargetPatch& tgtPatch
|
||||
)
|
||||
{
|
||||
addProfiling(ami, "AMIInterpolation::update");
|
||||
|
||||
label srcTotalSize = returnReduce(srcPatch.size(), sumOp<label>());
|
||||
label tgtTotalSize = returnReduce(tgtPatch.size(), sumOp<label>());
|
||||
|
||||
@ -1097,6 +1103,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::append
|
||||
const TargetPatch& tgtPatch
|
||||
)
|
||||
{
|
||||
addProfiling(ami, "AMIInterpolation::append");
|
||||
|
||||
// Create a new interpolation
|
||||
autoPtr<AMIInterpolation<SourcePatch, TargetPatch>> newPtr
|
||||
(
|
||||
@ -1311,6 +1319,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
|
||||
const UList<Type>& defaultValues
|
||||
) const
|
||||
{
|
||||
addProfiling(ami, "AMIInterpolation::interpolateToTarget");
|
||||
|
||||
if (fld.size() != srcAddress_.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
@ -1396,6 +1406,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
|
||||
const UList<Type>& defaultValues
|
||||
) const
|
||||
{
|
||||
addProfiling(ami, "AMIInterpolation::interpolateToSource");
|
||||
|
||||
if (fld.size() != tgtAddress_.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "faceAreaWeightAMI.H"
|
||||
#include "profiling.H"
|
||||
|
||||
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||
|
||||
@ -38,6 +39,8 @@ void Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::calcAddressing
|
||||
label tgtFacei
|
||||
)
|
||||
{
|
||||
addProfiling(ami, "faceAreaWeightAMI::calcAddressing");
|
||||
|
||||
// construct weights and addressing
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -123,6 +126,8 @@ bool Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::processSourceFace
|
||||
List<DynamicList<scalar>>& tgtWght
|
||||
)
|
||||
{
|
||||
addProfiling(ami, "faceAreaWeightAMI::processSourceFace");
|
||||
|
||||
if (tgtStartFacei == -1)
|
||||
{
|
||||
return false;
|
||||
@ -188,6 +193,8 @@ void Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::setNextFaces
|
||||
bool errorOnNotFound
|
||||
) const
|
||||
{
|
||||
addProfiling(ami, "faceAreaWeightAMI::setNextFaces");
|
||||
|
||||
const labelList& srcNbrFaces = this->srcPatch_.faceFaces()[srcFacei];
|
||||
|
||||
// initialise tgtFacei
|
||||
@ -298,6 +305,8 @@ Foam::scalar Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::interArea
|
||||
const label tgtFacei
|
||||
) const
|
||||
{
|
||||
addProfiling(ami, "faceAreaWeightAMI::interArea");
|
||||
|
||||
scalar area = 0;
|
||||
|
||||
const pointField& srcPoints = this->srcPatch_.points();
|
||||
@ -364,6 +373,8 @@ restartUncoveredSourceFace
|
||||
List<DynamicList<scalar>>& tgtWght
|
||||
)
|
||||
{
|
||||
addProfiling(ami, "faceAreaWeightAMI::restartUncoveredSourceFace");
|
||||
|
||||
// Collect all src faces with a low weight
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -501,6 +512,8 @@ void Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::calculate
|
||||
label tgtFacei
|
||||
)
|
||||
{
|
||||
addProfiling(ami, "faceAreaWeightAMI::calculate");
|
||||
|
||||
bool ok =
|
||||
this->initialise
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user