BUG: mappedPatchBase - cannot use samplePatch() for NEARESTCELL mode - must use samplePatch_

This commit is contained in:
andy
2013-11-21 09:59:51 +00:00
parent 4e19a1a56a
commit 1dc64adbdb

View File

@ -203,7 +203,7 @@ void Foam::mappedPatchBase::findSamples
{ {
case NEARESTCELL: case NEARESTCELL:
{ {
if (samplePatch().size() && samplePatch() != "none") if (samplePatch_.size() && samplePatch_ != "none")
{ {
FatalErrorIn FatalErrorIn
( (
@ -495,7 +495,6 @@ void Foam::mappedPatchBase::findSamples
void Foam::mappedPatchBase::calcMapping() const void Foam::mappedPatchBase::calcMapping() const
{ {
static bool hasWarned = false; static bool hasWarned = false;
if (mapPtr_.valid()) if (mapPtr_.valid())
{ {
FatalErrorIn("mappedPatchBase::calcMapping() const") FatalErrorIn("mappedPatchBase::calcMapping() const")
@ -509,10 +508,8 @@ void Foam::mappedPatchBase::calcMapping() const
// Get offsetted points // Get offsetted points
const pointField offsettedPoints(samplePoints(patchPoints())); const pointField offsettedPoints(samplePoints(patchPoints()));
// Do a sanity check - am I sampling my own patch?
// Do a sanity check // This only makes sense for a non-zero offset.
// Am I sampling my own patch? This only makes sense for a non-zero
// offset.
bool sampleMyself = bool sampleMyself =
( (
mode_ == NEARESTPATCHFACE mode_ == NEARESTPATCHFACE
@ -550,7 +547,6 @@ void Foam::mappedPatchBase::calcMapping() const
<< "offsetMode_:" << offsetModeNames_[offsetMode_] << endl; << "offsetMode_:" << offsetModeNames_[offsetMode_] << endl;
} }
// Get global list of all samples and the processor and face they come from. // Get global list of all samples and the processor and face they come from.
pointField samples; pointField samples;
labelList patchFaceProcs; labelList patchFaceProcs;
@ -565,7 +561,6 @@ void Foam::mappedPatchBase::calcMapping() const
patchFc patchFc
); );
// Find processor and cell/face samples are in and actual location. // Find processor and cell/face samples are in and actual location.
labelList sampleProcs; labelList sampleProcs;
labelList sampleIndices; labelList sampleIndices;
@ -641,7 +636,6 @@ void Foam::mappedPatchBase::calcMapping() const
} }
} }
// Now we have all the data we need: // Now we have all the data we need:
// - where sample originates from (so destination when mapping): // - where sample originates from (so destination when mapping):
// patchFaces, patchFaceProcs. // patchFaces, patchFaceProcs.
@ -688,7 +682,6 @@ void Foam::mappedPatchBase::calcMapping() const
} }
} }
// Determine schedule. // Determine schedule.
mapPtr_.reset(new mapDistribute(sampleProcs, patchFaceProcs)); mapPtr_.reset(new mapDistribute(sampleProcs, patchFaceProcs));
@ -806,38 +799,34 @@ void Foam::mappedPatchBase::calcAMI() const
} }
AMIPtr_.clear(); AMIPtr_.clear();
/*
const polyPatch& nbr = samplePolyPatch();
// pointField nbrPoints(offsettedPoints());
pointField nbrPoints(nbr.localPoints());
if (debug) if (debug)
{ {
const polyPatch& nbr = samplePolyPatch();
pointField nbrPoints(nbr.localPoints());
OFstream os(patch_.name() + "_neighbourPatch-org.obj"); OFstream os(patch_.name() + "_neighbourPatch-org.obj");
meshTools::writeOBJ(os, samplePolyPatch().localFaces(), nbrPoints); meshTools::writeOBJ(os, samplePolyPatch().localFaces(), nbrPoints);
}
// transform neighbour patch to local system // transform neighbour patch to local system
primitivePatch nbrPatch0 primitivePatch nbrPatch0
(
SubList<face>
( (
nbr.localFaces(), SubList<face>
nbr.size() (
), nbr.localFaces(),
nbrPoints nbr.size()
); ),
nbrPoints
);
if (debug)
{
OFstream osN(patch_.name() + "_neighbourPatch-trans.obj"); OFstream osN(patch_.name() + "_neighbourPatch-trans.obj");
meshTools::writeOBJ(osN, nbrPatch0, nbrPoints); meshTools::writeOBJ(osN, nbrPatch0, nbrPoints);
OFstream osO(patch_.name() + "_ownerPatch.obj"); OFstream osO(patch_.name() + "_ownerPatch.obj");
meshTools::writeOBJ(osO, patch_.localFaces(), patch_.localPoints()); meshTools::writeOBJ(osO, patch_.localFaces(), patch_.localPoints());
} }
*/
// Construct/apply AMI interpolation to determine addressing and weights // Construct/apply AMI interpolation to determine addressing and weights
AMIPtr_.reset AMIPtr_.reset
( (