From 16b2973fabf6a60de79f49d5a055099fc03b5249 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 28 May 2013 15:05:41 +0100 Subject: [PATCH] ENH: AMI - refactored normalise->conformal --- .../AMIInterpolation/AMIInterpolation.C | 12 ++--- .../AMIInterpolation/AMIInterpolation.H | 2 +- .../AMIMethod/AMIMethod/AMIMethod.C | 44 ++++++++++--------- .../AMIMethod/AMIMethod/AMIMethod.H | 4 +- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index 1be3be8dad..10ec0bf5d0 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -200,7 +200,7 @@ void Foam::AMIInterpolation::normaliseWeights const labelListList& addr, scalarListList& wght, scalarField& wghtSum, - const bool normalise, + const bool conformal, const bool output ) { @@ -214,7 +214,7 @@ void Foam::AMIInterpolation::normaliseWeights scalar s = sum(w); scalar t = s/denom; - if (normalise) + if (conformal) { denom = s; } @@ -907,7 +907,7 @@ void Foam::AMIInterpolation::update srcAddress_, srcWeights_, srcWeightsSum_, - AMIPtr->normalise(), + AMIPtr->conformal(), true ); normaliseWeights @@ -917,7 +917,7 @@ void Foam::AMIInterpolation::update tgtAddress_, tgtWeights_, tgtWeightsSum_, - AMIPtr->normalise(), + AMIPtr->conformal(), true ); @@ -964,7 +964,7 @@ void Foam::AMIInterpolation::update srcAddress_, srcWeights_, srcWeightsSum_, - AMIPtr->normalise(), + AMIPtr->conformal(), true ); normaliseWeights @@ -974,7 +974,7 @@ void Foam::AMIInterpolation::update tgtAddress_, tgtWeights_, tgtWeightsSum_, - AMIPtr->normalise(), + AMIPtr->conformal(), true ); } diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H index c9df62ee76..3aea35473f 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H @@ -237,7 +237,7 @@ private: const labelListList& addr, scalarListList& wght, scalarField& wghtSum, - const bool normalise, + const bool conformal, const bool output ); diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C index e6d15ccd77..bb1e61d210 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C @@ -41,24 +41,28 @@ void Foam::AMIMethod::checkPatches() const } - const scalar maxBoundsError = 0.05; - - // check bounds of source and target - boundBox bbSrc(srcPatch_.points(), srcPatch_.meshPoints(), true); - boundBox bbTgt(tgtPatch_.points(), tgtPatch_.meshPoints(), true); - - boundBox bbTgtInf(bbTgt); - bbTgtInf.inflate(maxBoundsError); - - if (!bbTgtInf.contains(bbSrc)) + if (conformal()) { - WarningIn("AMIMethod::checkPatches()") - << "Source and target patch bounding boxes are not similar" << nl - << " source box span : " << bbSrc.span() << nl - << " target box span : " << bbTgt.span() << nl - << " source box : " << bbSrc << nl - << " target box : " << bbTgt << nl - << " inflated target box : " << bbTgtInf << endl; + const scalar maxBoundsError = 0.05; + + // check bounds of source and target + boundBox bbSrc(srcPatch_.points(), srcPatch_.meshPoints(), true); + boundBox bbTgt(tgtPatch_.points(), tgtPatch_.meshPoints(), true); + + boundBox bbTgtInf(bbTgt); + bbTgtInf.inflate(maxBoundsError); + + if (!bbTgtInf.contains(bbSrc)) + { + WarningIn("AMIMethod::checkPatches()") + << "Source and target patch bounding boxes are not similar" + << nl + << " source box span : " << bbSrc.span() << nl + << " target box span : " << bbTgt.span() << nl + << " source box : " << bbSrc << nl + << " target box : " << bbTgt << nl + << " inflated target box : " << bbTgtInf << endl; + } } } @@ -74,6 +78,8 @@ bool Foam::AMIMethod::initialise label& tgtFaceI ) { + checkPatches(); + // set initial sizes for weights and addressing - must be done even if // returns false below srcAddress.setSize(srcPatch_.size()); @@ -333,8 +339,6 @@ Foam::AMIMethod::AMIMethod srcNonOverlap_(), triMode_(triMode) { - checkPatches(); - label srcSize = returnReduce(srcPatch_.size(), sumOp