From a372dbfb5391b7c620240d026de7e2ed4ffb356c Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 21 Jul 2011 17:48:20 +0100 Subject: [PATCH] ENH: Further updates to AMI functionality --- src/AMIInterpolation/AMIInterpolation.C | 214 +++++++++++--- src/AMIInterpolation/AMIInterpolation.H | 172 ++++++++---- src/AMIInterpolation/AMIInterpolationI.H | 58 ++++ src/AMIInterpolation/Make/files | 1 + src/AMIInterpolation/Make/options | 7 +- .../faceAreaIntersect/faceAreaIntersect.C | 120 ++++---- .../faceAreaIntersect/faceAreaIntersect.H | 17 +- .../cyclicAMIFvPatch/cyclicAMIFvPatch.C | 7 +- .../cyclicAMIFvPatch/cyclicAMIFvPatch.H | 5 - .../cyclicAMIPointPatch/cyclicAMIPointPatch.C | 99 +++++++ .../cyclicAMIPointPatch/cyclicAMIPointPatch.H | 121 ++++++++ .../cyclicAMIPolyPatch/cyclicAMIPolyPatch.C | 262 +++++++++++------- .../cyclicAMIPolyPatch/cyclicAMIPolyPatch.H | 100 ++++--- .../cyclicAMIPolyPatch/cyclicAMIPolyPatchI.H | 67 +++++ .../cyclicAMIPolyPatchTemplates.C | 64 +++++ src/OpenFOAM/meshes/boundBox/boundBox.C | 12 +- 16 files changed, 1000 insertions(+), 326 deletions(-) create mode 100644 src/AMIInterpolation/AMIInterpolationI.H create mode 100644 src/AMIInterpolation/patches/cyclicAMIPointPatch/cyclicAMIPointPatch.C create mode 100644 src/AMIInterpolation/patches/cyclicAMIPointPatch/cyclicAMIPointPatch.H create mode 100644 src/AMIInterpolation/patches/cyclicAMIPolyPatch/cyclicAMIPolyPatchI.H create mode 100644 src/AMIInterpolation/patches/cyclicAMIPolyPatch/cyclicAMIPolyPatchTemplates.C 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