diff --git a/src/AMIInterpolation/AMIInterpolation.C b/src/AMIInterpolation/AMIInterpolation.C index 0e5c6348e5..99fae0b857 100644 --- a/src/AMIInterpolation/AMIInterpolation.C +++ b/src/AMIInterpolation/AMIInterpolation.C @@ -24,13 +24,14 @@ License \*---------------------------------------------------------------------------*/ #include "AMIInterpolation.H" -#include "faceAreaIntersect.H" #include "Random.H" #include "treeDataPrimitivePatch.H" #include "indexedOctree.H" #include "primitivePatch.H" #include "meshTools.H" +#include "vtkSurfaceWriter.H" + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template @@ -95,9 +96,9 @@ void Foam::AMIInterpolation::checkPatches const scalar maxBoundsError = 0.05; // sanity checks - boundBox bbSrc(srcPatch.points()); - boundBox bbTgt(tgtPatch.points()); - boundBox bbSurf(srcPatch.points()); + boundBox bbSrc(srcPatch.points(), srcPatch.meshPoints()); + boundBox bbTgt(tgtPatch.points(), tgtPatch.meshPoints()); + boundBox bbSurf(bbTgt); // USE POINTS OF SURFACE!!!!!!!!!!!!!!!!!! // projection surface bounds - check against bounds of source and target @@ -132,7 +133,6 @@ void Foam::AMIInterpolation::checkPatches // check bounds of source and target - bbTgt.inflate(maxBoundsError); if (!bbTgt.contains(bbSrc)) @@ -144,8 +144,11 @@ void Foam::AMIInterpolation::checkPatches "const primitivePatch&, " "const primitivePatch&" ")" - ) << "Source and target patch bounding boxes are not similar" - << endl; + ) << "Source and target patch bounding boxes are not similar" << nl + << " src span : " << bbSrc.span() << nl + << " tgt span : " << bbTgt.span() << nl + << " source: " << bbSrc << nl + << " target: " << bbTgt << endl; } } @@ -157,6 +160,16 @@ void Foam::AMIInterpolation::projectPointsToSurface pointField& pts ) const { + if (!projectPoints_) + { + return; + } + + if (debug) + { + Info<< "AMI: projecting points to surface" << endl; + } + List nearInfo; surf.findNearest(pts, scalarField(pts.size(), GREAT), nearInfo); @@ -313,7 +326,7 @@ void Foam::AMIInterpolation::setNextFaces const boolList& mapFlag, labelList& seedFaces, const DynamicList