diff --git a/src/AMIInterpolation/AMIInterpolation.C b/src/AMIInterpolation/AMIInterpolation.C index c116ee2030..ca265b4e25 100644 --- a/src/AMIInterpolation/AMIInterpolation.C +++ b/src/AMIInterpolation/AMIInterpolation.C @@ -499,11 +499,6 @@ void Foam::AMIInterpolation::projectPointsToSurface pointField& pts ) const { - if (!projectPoints_) - { - return; - } - if (debug) { Info<< "AMI: projecting points to surface" << endl; @@ -803,7 +798,6 @@ void Foam::AMIInterpolation::calcAddressing ( const primitivePatch& srcPatch, const primitivePatch& tgtPatch, - const searchableSurface& surf, label srcFaceI, label tgtFaceI ) @@ -824,6 +818,8 @@ void Foam::AMIInterpolation::calcAddressing if (debug) { Info<< "AMI: calcAddressing" << endl; + writePatch(srcPatch, "VTK", "source"); + writePatch(tgtPatch, "VTK", "target"); } // temporary storage for addressing and weights @@ -833,57 +829,6 @@ void Foam::AMIInterpolation::calcAddressing List > tgtWght(tgtPatch.size()); - // create new patches for source and target - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - pointField srcPoints = srcPatch.points(); - primitivePatch srcPatch0 - ( - SubList - ( - srcPatch, - srcPatch.size(), - 0 - ), - srcPoints - ); - - if (debug) - { - OFstream os("amiSrcPoints.obj"); - forAll(srcPoints, i) - { - meshTools::writeOBJ(os, srcPoints[i]); - } - } - - pointField tgtPoints = tgtPatch.points(); - primitivePatch tgtPatch0 - ( - SubList - ( - tgtPatch, - tgtPatch.size(), - 0 - ), - tgtPoints - ); - - if (debug) - { - OFstream os("amiTgtPoints.obj"); - forAll(tgtPoints, i) - { - meshTools::writeOBJ(os, tgtPoints[i]); - } - } - - - // map source and target patches onto projection surface - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - projectPointsToSurface(surf, srcPoints); - projectPointsToSurface(surf, tgtPoints); - - // find initial face match using brute force/octree search // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if ((srcFaceI == -1) || (tgtFaceI == -1)) @@ -891,9 +836,9 @@ void Foam::AMIInterpolation::calcAddressing srcFaceI = 0; tgtFaceI = 0; bool foundFace = false; - forAll(srcPatch0, faceI) + forAll(srcPatch, faceI) { - tgtFaceI = findTargetFace(srcFaceI, srcPatch0, tgtPatch0); + tgtFaceI = findTargetFace(faceI, srcPatch, tgtPatch); if (tgtFaceI >= 0) { srcFaceI = faceI; @@ -911,7 +856,6 @@ void Foam::AMIInterpolation::calcAddressing "(" "const primitivePatch&, " "const primitivePatch&, " - "const searchableSurface&, " "label, " "label" ")" @@ -927,7 +871,7 @@ void Foam::AMIInterpolation::calcAddressing // construct weights and addressing // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - label nFacesRemaining = srcPatch0.size(); + label nFacesRemaining = srcPatch.size(); // list of tgt face neighbour faces DynamicList