Bugfix - GGI separationOffset + user-select rejection algorithm

This commit is contained in:
Ivor Clifford 2011-10-20 16:31:19 -06:00
parent 9998f0c1ed
commit 915b574d8b
4 changed files with 34 additions and 8 deletions

View file

@ -95,7 +95,7 @@ public:
ClassName("GGIInterpolation"); ClassName("GGIInterpolation");
//- Quick reject names //- Quick reject names
static const NamedEnum<quickReject, 3> quickRejectNames_; static const NamedEnum<quickReject, 4> quickRejectNames_;
// Constructors // Constructors

View file

@ -41,12 +41,15 @@ defineTypeNameAndDebug(Foam::GGIInterpolationName, 0);
template<> template<>
const char* const char*
Foam::NamedEnum<Foam::GGIInterpolationName::quickReject, 3>::names[] = Foam::NamedEnum<Foam::GGIInterpolationName::quickReject, 4>::names[] =
{ {
"3DDistance", "distance3D",
"AABB", "AABB",
"bbOctree",
"nSquared" "nSquared"
}; };
const Foam::NamedEnum<Foam::GGIInterpolationName::quickReject, 4>
Foam::GGIInterpolationName::quickRejectNames_;
// ************************************************************************* // // ************************************************************************* //

View file

@ -200,8 +200,7 @@ void Foam::ggiPolyPatch::calcPatchToPatch() const
0, // Non-overlapping face tolerances 0, // Non-overlapping face tolerances
0, // HJ, 24/Oct/2008 0, // HJ, 24/Oct/2008
true, // Rescale weighting factors. Bug fix, MB. true, // Rescale weighting factors. Bug fix, MB.
// ggiInterpolation::AABB reject_ // Quick rejection algorithm, default BB_OCTREE
ggiInterpolation::BB_OCTREE // Octree search, MB.
); );
// Abort immediately if uncovered faces are present and the option // Abort immediately if uncovered faces are present and the option
@ -464,6 +463,7 @@ Foam::ggiPolyPatch::ggiPolyPatch
shadowName_(word::null), shadowName_(word::null),
zoneName_(word::null), zoneName_(word::null),
bridgeOverlap_(false), bridgeOverlap_(false),
reject_(ggiZoneInterpolation::BB_OCTREE),
shadowIndex_(-1), shadowIndex_(-1),
zoneIndex_(-1), zoneIndex_(-1),
patchToPatchPtr_(NULL), patchToPatchPtr_(NULL),
@ -485,13 +485,15 @@ Foam::ggiPolyPatch::ggiPolyPatch
const polyBoundaryMesh& bm, const polyBoundaryMesh& bm,
const word& shadowName, const word& shadowName,
const word& zoneName, const word& zoneName,
const bool bridgeOverlap const bool bridgeOverlap,
const ggiZoneInterpolation::quickReject reject
) )
: :
coupledPolyPatch(name, size, start, index, bm), coupledPolyPatch(name, size, start, index, bm),
shadowName_(shadowName), shadowName_(shadowName),
zoneName_(zoneName), zoneName_(zoneName),
bridgeOverlap_(bridgeOverlap), bridgeOverlap_(bridgeOverlap),
reject_(reject),
shadowIndex_(-1), shadowIndex_(-1),
zoneIndex_(-1), zoneIndex_(-1),
patchToPatchPtr_(NULL), patchToPatchPtr_(NULL),
@ -516,6 +518,7 @@ Foam::ggiPolyPatch::ggiPolyPatch
shadowName_(dict.lookup("shadowPatch")), shadowName_(dict.lookup("shadowPatch")),
zoneName_(dict.lookup("zone")), zoneName_(dict.lookup("zone")),
bridgeOverlap_(dict.lookup("bridgeOverlap")), bridgeOverlap_(dict.lookup("bridgeOverlap")),
reject_(ggiZoneInterpolation::BB_OCTREE),
shadowIndex_(-1), shadowIndex_(-1),
zoneIndex_(-1), zoneIndex_(-1),
patchToPatchPtr_(NULL), patchToPatchPtr_(NULL),
@ -525,7 +528,15 @@ Foam::ggiPolyPatch::ggiPolyPatch
localParallelPtr_(NULL), localParallelPtr_(NULL),
receiveAddrPtr_(NULL), receiveAddrPtr_(NULL),
sendAddrPtr_(NULL) sendAddrPtr_(NULL)
{} {
if (dict.found("quickReject"))
{
reject_ = ggiZoneInterpolation::quickRejectNames_.read
(
dict.lookup("quickReject")
);
}
}
Foam::ggiPolyPatch::ggiPolyPatch Foam::ggiPolyPatch::ggiPolyPatch
@ -538,6 +549,7 @@ Foam::ggiPolyPatch::ggiPolyPatch
shadowName_(pp.shadowName_), shadowName_(pp.shadowName_),
zoneName_(pp.zoneName_), zoneName_(pp.zoneName_),
bridgeOverlap_(pp.bridgeOverlap_), bridgeOverlap_(pp.bridgeOverlap_),
reject_(pp.reject_),
shadowIndex_(-1), shadowIndex_(-1),
zoneIndex_(-1), zoneIndex_(-1),
patchToPatchPtr_(NULL), patchToPatchPtr_(NULL),
@ -564,6 +576,7 @@ Foam::ggiPolyPatch::ggiPolyPatch
shadowName_(pp.shadowName_), shadowName_(pp.shadowName_),
zoneName_(pp.zoneName_), zoneName_(pp.zoneName_),
bridgeOverlap_(pp.bridgeOverlap_), bridgeOverlap_(pp.bridgeOverlap_),
reject_(pp.reject_),
shadowIndex_(-1), shadowIndex_(-1),
zoneIndex_(-1), zoneIndex_(-1),
patchToPatchPtr_(NULL), patchToPatchPtr_(NULL),
@ -736,6 +749,11 @@ void Foam::ggiPolyPatch::initAddressing()
// Calculate transforms for correct GGI cut // Calculate transforms for correct GGI cut
calcTransforms(); calcTransforms();
if(master())
{
shadow().calcTransforms();
}
// Force zone addressing and remote zone addressing // Force zone addressing and remote zone addressing
// (uses GGI interpolator) // (uses GGI interpolator)
zoneAddressing(); zoneAddressing();

View file

@ -73,6 +73,9 @@ class ggiPolyPatch
//- Use bridging to fix overlap error in interpolation //- Use bridging to fix overlap error in interpolation
Switch bridgeOverlap_; Switch bridgeOverlap_;
//- Quick reject algorithm
ggiZoneInterpolation::quickReject reject_;
//- Shadow patch index. Delayed evaluation for construction //- Shadow patch index. Delayed evaluation for construction
mutable label shadowIndex_; mutable label shadowIndex_;
@ -212,7 +215,9 @@ public:
const polyBoundaryMesh& bm, const polyBoundaryMesh& bm,
const word& shadowName, const word& shadowName,
const word& zoneName, const word& zoneName,
const bool bridgeOverlap const bool bridgeOverlap,
const ggiZoneInterpolation::quickReject
reject = ggiZoneInterpolation::BB_OCTREE
); );
//- Construct from dictionary //- Construct from dictionary