From 915b574d8ba3474142633a459e4b1571e4a4f452 Mon Sep 17 00:00:00 2001 From: Ivor Clifford Date: Thu, 20 Oct 2011 16:31:19 -0600 Subject: [PATCH] Bugfix - GGI separationOffset + user-select rejection algorithm --- .../GGIInterpolation/GGIInterpolation.H | 2 +- .../GGIInterpolation/GGIInterpolationName.C | 7 +++-- .../polyPatches/constraint/ggi/ggiPolyPatch.C | 26 ++++++++++++++++--- .../polyPatches/constraint/ggi/ggiPolyPatch.H | 7 ++++- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolation.H b/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolation.H index 4bfc06cd6..42540f6f7 100644 --- a/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolation.H +++ b/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolation.H @@ -95,7 +95,7 @@ public: ClassName("GGIInterpolation"); //- Quick reject names - static const NamedEnum quickRejectNames_; + static const NamedEnum quickRejectNames_; // Constructors diff --git a/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolationName.C b/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolationName.C index 0a4b75c92..3b06ad428 100644 --- a/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolationName.C +++ b/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolationName.C @@ -41,12 +41,15 @@ defineTypeNameAndDebug(Foam::GGIInterpolationName, 0); template<> const char* -Foam::NamedEnum::names[] = +Foam::NamedEnum::names[] = { - "3DDistance", + "distance3D", "AABB", + "bbOctree", "nSquared" }; +const Foam::NamedEnum + Foam::GGIInterpolationName::quickRejectNames_; // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.C index 3e2424f87..664dffd09 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.C @@ -200,8 +200,7 @@ void Foam::ggiPolyPatch::calcPatchToPatch() const 0, // Non-overlapping face tolerances 0, // HJ, 24/Oct/2008 true, // Rescale weighting factors. Bug fix, MB. -// ggiInterpolation::AABB - ggiInterpolation::BB_OCTREE // Octree search, MB. + reject_ // Quick rejection algorithm, default BB_OCTREE ); // Abort immediately if uncovered faces are present and the option @@ -464,6 +463,7 @@ Foam::ggiPolyPatch::ggiPolyPatch shadowName_(word::null), zoneName_(word::null), bridgeOverlap_(false), + reject_(ggiZoneInterpolation::BB_OCTREE), shadowIndex_(-1), zoneIndex_(-1), patchToPatchPtr_(NULL), @@ -485,13 +485,15 @@ Foam::ggiPolyPatch::ggiPolyPatch const polyBoundaryMesh& bm, const word& shadowName, const word& zoneName, - const bool bridgeOverlap + const bool bridgeOverlap, + const ggiZoneInterpolation::quickReject reject ) : coupledPolyPatch(name, size, start, index, bm), shadowName_(shadowName), zoneName_(zoneName), bridgeOverlap_(bridgeOverlap), + reject_(reject), shadowIndex_(-1), zoneIndex_(-1), patchToPatchPtr_(NULL), @@ -516,6 +518,7 @@ Foam::ggiPolyPatch::ggiPolyPatch shadowName_(dict.lookup("shadowPatch")), zoneName_(dict.lookup("zone")), bridgeOverlap_(dict.lookup("bridgeOverlap")), + reject_(ggiZoneInterpolation::BB_OCTREE), shadowIndex_(-1), zoneIndex_(-1), patchToPatchPtr_(NULL), @@ -525,7 +528,15 @@ Foam::ggiPolyPatch::ggiPolyPatch localParallelPtr_(NULL), receiveAddrPtr_(NULL), sendAddrPtr_(NULL) -{} +{ + if (dict.found("quickReject")) + { + reject_ = ggiZoneInterpolation::quickRejectNames_.read + ( + dict.lookup("quickReject") + ); + } +} Foam::ggiPolyPatch::ggiPolyPatch @@ -538,6 +549,7 @@ Foam::ggiPolyPatch::ggiPolyPatch shadowName_(pp.shadowName_), zoneName_(pp.zoneName_), bridgeOverlap_(pp.bridgeOverlap_), + reject_(pp.reject_), shadowIndex_(-1), zoneIndex_(-1), patchToPatchPtr_(NULL), @@ -564,6 +576,7 @@ Foam::ggiPolyPatch::ggiPolyPatch shadowName_(pp.shadowName_), zoneName_(pp.zoneName_), bridgeOverlap_(pp.bridgeOverlap_), + reject_(pp.reject_), shadowIndex_(-1), zoneIndex_(-1), patchToPatchPtr_(NULL), @@ -735,6 +748,11 @@ void Foam::ggiPolyPatch::initAddressing() { // Calculate transforms for correct GGI cut calcTransforms(); + + if(master()) + { + shadow().calcTransforms(); + } // Force zone addressing and remote zone addressing // (uses GGI interpolator) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.H index 85edd7abf..c96f41df6 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/ggi/ggiPolyPatch.H @@ -73,6 +73,9 @@ class ggiPolyPatch //- Use bridging to fix overlap error in interpolation Switch bridgeOverlap_; + //- Quick reject algorithm + ggiZoneInterpolation::quickReject reject_; + //- Shadow patch index. Delayed evaluation for construction mutable label shadowIndex_; @@ -212,7 +215,9 @@ public: const polyBoundaryMesh& bm, const word& shadowName, const word& zoneName, - const bool bridgeOverlap + const bool bridgeOverlap, + const ggiZoneInterpolation::quickReject + reject = ggiZoneInterpolation::BB_OCTREE ); //- Construct from dictionary