ENH: Updated ACMI to allow fully disconnected regions

This commit is contained in:
andy
2014-03-20 11:02:51 +00:00
committed by Andrew Heather
parent 110968a5da
commit 25d874034b
20 changed files with 162 additions and 71 deletions

View File

@ -206,12 +206,15 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights
) )
{ {
// Normalise the weights // Normalise the weights
wghtSum.setSize(wght.size()); wghtSum.setSize(wght.size(), 0.0);
label nLowWeight = 0; label nLowWeight = 0;
forAll(wght, faceI) forAll(wght, faceI)
{ {
scalarList& w = wght[faceI]; scalarList& w = wght[faceI];
if (w.size())
{
scalar denom = patchAreas[faceI]; scalar denom = patchAreas[faceI];
scalar s = sum(w); scalar s = sum(w);
@ -234,6 +237,11 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights
nLowWeight++; nLowWeight++;
} }
} }
else
{
wghtSum[faceI] = 0;
}
}
if (output) if (output)
@ -534,6 +542,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
const SourcePatch& srcPatch, const SourcePatch& srcPatch,
const TargetPatch& tgtPatch, const TargetPatch& tgtPatch,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool requireMatch,
const interpolationMethod& method, const interpolationMethod& method,
const scalar lowWeightCorrection, const scalar lowWeightCorrection,
const bool reverseTarget const bool reverseTarget
@ -541,6 +550,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
: :
method_(method), method_(method),
reverseTarget_(reverseTarget), reverseTarget_(reverseTarget),
requireMatch_(requireMatch),
singlePatchProc_(-999), singlePatchProc_(-999),
lowWeightCorrection_(lowWeightCorrection), lowWeightCorrection_(lowWeightCorrection),
srcAddress_(), srcAddress_(),
@ -564,6 +574,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
const TargetPatch& tgtPatch, const TargetPatch& tgtPatch,
const autoPtr<searchableSurface>& surfPtr, const autoPtr<searchableSurface>& surfPtr,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool requireMatch,
const interpolationMethod& method, const interpolationMethod& method,
const scalar lowWeightCorrection, const scalar lowWeightCorrection,
const bool reverseTarget const bool reverseTarget
@ -571,6 +582,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
: :
method_(method), method_(method),
reverseTarget_(reverseTarget), reverseTarget_(reverseTarget),
requireMatch_(requireMatch),
singlePatchProc_(-999), singlePatchProc_(-999),
lowWeightCorrection_(lowWeightCorrection), lowWeightCorrection_(lowWeightCorrection),
srcAddress_(), srcAddress_(),
@ -654,6 +666,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
: :
method_(fineAMI.method_), method_(fineAMI.method_),
reverseTarget_(fineAMI.reverseTarget_), reverseTarget_(fineAMI.reverseTarget_),
requireMatch_(fineAMI.requireMatch_),
singlePatchProc_(fineAMI.singlePatchProc_), singlePatchProc_(fineAMI.singlePatchProc_),
lowWeightCorrection_(-1.0), lowWeightCorrection_(-1.0),
srcAddress_(), srcAddress_(),
@ -862,7 +875,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
srcMagSf_, srcMagSf_,
tgtMagSf_, tgtMagSf_,
triMode_, triMode_,
reverseTarget_ reverseTarget_,
requireMatch_
) )
); );
@ -978,7 +992,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
srcMagSf_, srcMagSf_,
tgtMagSf_, tgtMagSf_,
triMode_, triMode_,
reverseTarget_ reverseTarget_,
requireMatch_
) )
); );

View File

@ -116,6 +116,10 @@ private:
// that the orientation of the target patch should be reversed // that the orientation of the target patch should be reversed
const bool reverseTarget_; const bool reverseTarget_;
//- Flag to indicate that the two patches must be matched/an overlap
// exists between them
const bool requireMatch_;
//- Index of processor that holds all of both sides. -1 in all other //- Index of processor that holds all of both sides. -1 in all other
// cases // cases
label singlePatchProc_; label singlePatchProc_;
@ -276,6 +280,7 @@ public:
const SourcePatch& srcPatch, const SourcePatch& srcPatch,
const TargetPatch& tgtPatch, const TargetPatch& tgtPatch,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool requireMatch = true,
const interpolationMethod& method = imFaceAreaWeight, const interpolationMethod& method = imFaceAreaWeight,
const scalar lowWeightCorrection = -1, const scalar lowWeightCorrection = -1,
const bool reverseTarget = false const bool reverseTarget = false
@ -288,6 +293,7 @@ public:
const TargetPatch& tgtPatch, const TargetPatch& tgtPatch,
const autoPtr<searchableSurface>& surf, const autoPtr<searchableSurface>& surf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool requireMatch = true,
const interpolationMethod& method = imFaceAreaWeight, const interpolationMethod& method = imFaceAreaWeight,
const scalar lowWeightCorrection = -1, const scalar lowWeightCorrection = -1,
const bool reverseTarget = false const bool reverseTarget = false

View File

@ -98,6 +98,10 @@ bool Foam::AMIMethod<SourcePatch, TargetPatch>::initialise
( (
"void Foam::AMIMethod<SourcePatch, TargetPatch>::initialise" "void Foam::AMIMethod<SourcePatch, TargetPatch>::initialise"
"(" "("
"labelListList&, "
"scalarListList&, "
"labelListList&, "
"scalarListList&, "
"label&, " "label&, "
"label&" "label&"
")" ")"
@ -128,15 +132,25 @@ bool Foam::AMIMethod<SourcePatch, TargetPatch>::initialise
} }
if (!foundFace) if (!foundFace)
{
if (requireMatch_)
{ {
FatalErrorIn FatalErrorIn
( (
"void Foam::AMIMethod<SourcePatch, TargetPatch>::initialise" "void Foam::AMIMethod<SourcePatch, TargetPatch>::initialise"
"(" "("
"labelListList&, "
"scalarListList&, "
"labelListList&, "
"scalarListList&, "
"label&, " "label&, "
"label&" "label&"
")" ")"
) << "Unable to find initial target face" << abort(FatalError); ) << "Unable to find initial target face"
<< abort(FatalError);
}
return false;
} }
} }
@ -327,12 +341,14 @@ Foam::AMIMethod<SourcePatch, TargetPatch>::AMIMethod
const scalarField& srcMagSf, const scalarField& srcMagSf,
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget const bool reverseTarget,
const bool requireMatch
) )
: :
srcPatch_(srcPatch), srcPatch_(srcPatch),
tgtPatch_(tgtPatch), tgtPatch_(tgtPatch),
reverseTarget_(reverseTarget), reverseTarget_(reverseTarget),
requireMatch_(requireMatch),
srcMagSf_(srcMagSf), srcMagSf_(srcMagSf),
tgtMagSf_(tgtMagSf), tgtMagSf_(tgtMagSf),
srcNonOverlap_(), srcNonOverlap_(),

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -85,6 +85,10 @@ protected:
// that the orientation of the target patch should be reversed // that the orientation of the target patch should be reversed
const bool reverseTarget_; const bool reverseTarget_;
//- Flag to indicate that the two patches must be matched/an overlap
// exists between them
const bool requireMatch_;
//- Source face areas //- Source face areas
const scalarField& srcMagSf_; const scalarField& srcMagSf_;
@ -166,9 +170,18 @@ public:
const scalarField& srcMagSf, const scalarField& srcMagSf,
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget const bool reverseTarget,
const bool requireMatch
), ),
(srcPatch, tgtPatch, srcMagSf, tgtMagSf, triMode, reverseTarget) (
srcPatch,
tgtPatch,
srcMagSf,
tgtMagSf,
triMode,
reverseTarget,
requireMatch
)
); );
//- Construct from components //- Construct from components
@ -179,7 +192,8 @@ public:
const scalarField& srcMagSf, const scalarField& srcMagSf,
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget const bool reverseTarget,
const bool requireMatch
); );
//- Selector //- Selector
@ -191,7 +205,8 @@ public:
const scalarField& srcMagSf, const scalarField& srcMagSf,
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget const bool reverseTarget,
const bool requireMatch
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,8 @@ Foam::AMIMethod<SourcePatch, TargetPatch>::New
const scalarField& srcMagSf, const scalarField& srcMagSf,
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget const bool reverseTarget,
const bool requireMatch
) )
{ {
if (debug) if (debug)
@ -58,6 +59,7 @@ Foam::AMIMethod<SourcePatch, TargetPatch>::New
"const scalarField&, " "const scalarField&, "
"const scalarField&, " "const scalarField&, "
"const faceAreaIntersect::triangulationMode&, " "const faceAreaIntersect::triangulationMode&, "
"const bool, "
"const bool" "const bool"
")" ")"
) << "Unknown AMIMethod type " ) << "Unknown AMIMethod type "
@ -75,7 +77,8 @@ Foam::AMIMethod<SourcePatch, TargetPatch>::New
srcMagSf, srcMagSf,
tgtMagSf, tgtMagSf,
triMode, triMode,
reverseTarget reverseTarget,
requireMatch
) )
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -106,7 +106,8 @@ Foam::directAMI<SourcePatch, TargetPatch>::directAMI
const scalarField& srcMagSf, const scalarField& srcMagSf,
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget const bool reverseTarget,
const bool requireMatch
) )
: :
AMIMethod<SourcePatch, TargetPatch> AMIMethod<SourcePatch, TargetPatch>
@ -116,7 +117,8 @@ Foam::directAMI<SourcePatch, TargetPatch>::directAMI
srcMagSf, srcMagSf,
tgtMagSf, tgtMagSf,
triMode, triMode,
reverseTarget reverseTarget,
requireMatch
) )
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -102,7 +102,8 @@ public:
const scalarField& srcMagSf, const scalarField& srcMagSf,
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget = false const bool reverseTarget = false,
const bool requireMatch = true
); );

View File

@ -482,6 +482,7 @@ Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::faceAreaWeightAMI
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget, const bool reverseTarget,
const bool requireMatch,
const bool restartUncoveredSourceFace const bool restartUncoveredSourceFace
) )
: :
@ -492,7 +493,8 @@ Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::faceAreaWeightAMI
srcMagSf, srcMagSf,
tgtMagSf, tgtMagSf,
triMode, triMode,
reverseTarget reverseTarget,
requireMatch
), ),
restartUncoveredSourceFace_(restartUncoveredSourceFace) restartUncoveredSourceFace_(restartUncoveredSourceFace)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -144,6 +144,7 @@ public:
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget = false, const bool reverseTarget = false,
const bool requireMatch = true,
const bool restartUncoveredSourceFace = true const bool restartUncoveredSourceFace = true
); );

View File

@ -183,7 +183,8 @@ Foam::mapNearestAMI<SourcePatch, TargetPatch>::mapNearestAMI
const scalarField& srcMagSf, const scalarField& srcMagSf,
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget const bool reverseTarget,
const bool requireMatch
) )
: :
AMIMethod<SourcePatch, TargetPatch> AMIMethod<SourcePatch, TargetPatch>
@ -193,7 +194,8 @@ Foam::mapNearestAMI<SourcePatch, TargetPatch>::mapNearestAMI
srcMagSf, srcMagSf,
tgtMagSf, tgtMagSf,
triMode, triMode,
reverseTarget reverseTarget,
requireMatch
) )
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -116,7 +116,8 @@ public:
const scalarField& srcMagSf, const scalarField& srcMagSf,
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget = false const bool reverseTarget = false,
const bool requireMatch = true
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -63,7 +63,8 @@ partialFaceAreaWeightAMI
const scalarField& srcMagSf, const scalarField& srcMagSf,
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget const bool reverseTarget,
const bool requireMatch
) )
: :
faceAreaWeightAMI<SourcePatch, TargetPatch> faceAreaWeightAMI<SourcePatch, TargetPatch>
@ -73,7 +74,8 @@ partialFaceAreaWeightAMI
srcMagSf, srcMagSf,
tgtMagSf, tgtMagSf,
triMode, triMode,
reverseTarget reverseTarget,
requireMatch
) )
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -93,7 +93,8 @@ public:
const scalarField& srcMagSf, const scalarField& srcMagSf,
const scalarField& tgtMagSf, const scalarField& tgtMagSf,
const faceAreaIntersect::triangulationMode& triMode, const faceAreaIntersect::triangulationMode& triMode,
const bool reverseTarget = false const bool reverseTarget = false,
const bool requireMatch = true
); );

View File

@ -208,6 +208,8 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch
tgtMask_(), tgtMask_(),
updated_(false) updated_(false)
{ {
AMIRequireMatch_ = false;
// Non-overlapping patch might not be valid yet so cannot determine // Non-overlapping patch might not be valid yet so cannot determine
// associated patchID // associated patchID
} }
@ -230,6 +232,8 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch
tgtMask_(), tgtMask_(),
updated_(false) updated_(false)
{ {
AMIRequireMatch_ = false;
if (nonOverlapPatchName_ == name) if (nonOverlapPatchName_ == name)
{ {
FatalIOErrorIn FatalIOErrorIn
@ -267,6 +271,8 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch
tgtMask_(), tgtMask_(),
updated_(false) updated_(false)
{ {
AMIRequireMatch_ = false;
// Non-overlapping patch might not be valid yet so cannot determine // Non-overlapping patch might not be valid yet so cannot determine
// associated patchID // associated patchID
} }
@ -291,6 +297,8 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch
tgtMask_(), tgtMask_(),
updated_(false) updated_(false)
{ {
AMIRequireMatch_ = false;
if (nonOverlapPatchName_ == name()) if (nonOverlapPatchName_ == name())
{ {
FatalErrorIn FatalErrorIn
@ -328,7 +336,9 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch
srcMask_(), srcMask_(),
tgtMask_(), tgtMask_(),
updated_(false) updated_(false)
{} {
AMIRequireMatch_ = false;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //

View File

@ -388,6 +388,7 @@ void Foam::cyclicAMIPolyPatch::resetAMI
nbrPatch0, nbrPatch0,
surfPtr(), surfPtr(),
faceAreaIntersect::tmMesh, faceAreaIntersect::tmMesh,
AMIRequireMatch_,
AMIMethod, AMIMethod,
AMILowWeightCorrection_, AMILowWeightCorrection_,
AMIReverse_ AMIReverse_
@ -501,6 +502,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
separationVector_(vector::zero), separationVector_(vector::zero),
AMIPtr_(NULL), AMIPtr_(NULL),
AMIReverse_(false), AMIReverse_(false),
AMIRequireMatch_(true),
AMILowWeightCorrection_(-1.0), AMILowWeightCorrection_(-1.0),
surfPtr_(NULL), surfPtr_(NULL),
surfDict_(fileName("surface")) surfDict_(fileName("surface"))
@ -530,6 +532,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
separationVector_(vector::zero), separationVector_(vector::zero),
AMIPtr_(NULL), AMIPtr_(NULL),
AMIReverse_(dict.lookupOrDefault<bool>("flipNormals", false)), AMIReverse_(dict.lookupOrDefault<bool>("flipNormals", false)),
AMIRequireMatch_(true),
AMILowWeightCorrection_(dict.lookupOrDefault("lowWeightCorrection", -1.0)), AMILowWeightCorrection_(dict.lookupOrDefault("lowWeightCorrection", -1.0)),
surfPtr_(NULL), surfPtr_(NULL),
surfDict_(dict.subOrEmptyDict("surface")) surfDict_(dict.subOrEmptyDict("surface"))
@ -639,6 +642,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
separationVector_(pp.separationVector_), separationVector_(pp.separationVector_),
AMIPtr_(NULL), AMIPtr_(NULL),
AMIReverse_(pp.AMIReverse_), AMIReverse_(pp.AMIReverse_),
AMIRequireMatch_(pp.AMIRequireMatch_),
AMILowWeightCorrection_(pp.AMILowWeightCorrection_), AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
surfPtr_(NULL), surfPtr_(NULL),
surfDict_(pp.surfDict_) surfDict_(pp.surfDict_)
@ -669,6 +673,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
separationVector_(pp.separationVector_), separationVector_(pp.separationVector_),
AMIPtr_(NULL), AMIPtr_(NULL),
AMIReverse_(pp.AMIReverse_), AMIReverse_(pp.AMIReverse_),
AMIRequireMatch_(pp.AMIRequireMatch_),
AMILowWeightCorrection_(pp.AMILowWeightCorrection_), AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
surfPtr_(NULL), surfPtr_(NULL),
surfDict_(pp.surfDict_) surfDict_(pp.surfDict_)
@ -713,6 +718,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
separationVector_(pp.separationVector_), separationVector_(pp.separationVector_),
AMIPtr_(NULL), AMIPtr_(NULL),
AMIReverse_(pp.AMIReverse_), AMIReverse_(pp.AMIReverse_),
AMIRequireMatch_(pp.AMIRequireMatch_),
AMILowWeightCorrection_(pp.AMILowWeightCorrection_), AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
surfPtr_(NULL), surfPtr_(NULL),
surfDict_(pp.surfDict_) surfDict_(pp.surfDict_)

View File

@ -56,7 +56,24 @@ class cyclicAMIPolyPatch
private: private:
// Private data // Private Member Functions
//- Return normal of face at max distance from rotation axis
vector findFaceNormalMaxRadius(const pointField& faceCentres) const;
void calcTransforms
(
const primitivePatch& half0,
const pointField& half0Ctrs,
const vectorField& half0Areas,
const pointField& half1Ctrs,
const vectorField& half1Areas
);
protected:
// Protected data
//- Name of other half //- Name of other half
mutable word nbrPatchName_; mutable word nbrPatchName_;
@ -97,6 +114,9 @@ private:
//- Flag to indicate that slave patch should be reversed for AMI //- Flag to indicate that slave patch should be reversed for AMI
const bool AMIReverse_; const bool AMIReverse_;
//- Flag to indicate that patches should match/overlap
bool AMIRequireMatch_;
//- Low weight correction threshold for AMI //- Low weight correction threshold for AMI
const scalar AMILowWeightCorrection_; const scalar AMILowWeightCorrection_;
@ -107,23 +127,6 @@ private:
const dictionary surfDict_; const dictionary surfDict_;
// Private Member Functions
//- Return normal of face at max distance from rotation axis
vector findFaceNormalMaxRadius(const pointField& faceCentres) const;
void calcTransforms
(
const primitivePatch& half0,
const pointField& half0Ctrs,
const vectorField& half0Areas,
const pointField& half1Ctrs,
const vectorField& half1Areas
);
protected:
// Protected Member Functions // Protected Member Functions
//- Reset the AMI interpolator //- Reset the AMI interpolator

View File

@ -836,6 +836,7 @@ void Foam::mappedPatchBase::calcAMI() const
samplePolyPatch(), // nbrPatch0, samplePolyPatch(), // nbrPatch0,
surfPtr(), surfPtr(),
faceAreaIntersect::tmMesh, faceAreaIntersect::tmMesh,
true,
AMIPatchToPatchInterpolation::imFaceAreaWeight, AMIPatchToPatchInterpolation::imFaceAreaWeight,
-1, -1,
AMIReverse_ AMIReverse_

View File

@ -91,6 +91,7 @@ void Foam::regionCoupledBase::resetAMI() const
nbrPatch0, nbrPatch0,
surfPtr(), surfPtr(),
faceAreaIntersect::tmMesh, faceAreaIntersect::tmMesh,
true,
AMIPatchToPatchInterpolation::imFaceAreaWeight, AMIPatchToPatchInterpolation::imFaceAreaWeight,
-1, -1,
AMIReverse_ AMIReverse_

View File

@ -242,6 +242,7 @@ Foam::regionModels::regionModel::interRegionAMI
p, p,
nbrP, nbrP,
faceAreaIntersect::tmMesh, faceAreaIntersect::tmMesh,
true,
AMIPatchToPatchInterpolation::imFaceAreaWeight, AMIPatchToPatchInterpolation::imFaceAreaWeight,
-1, -1,
flip flip
@ -284,6 +285,7 @@ Foam::regionModels::regionModel::interRegionAMI
p, p,
nbrP, nbrP,
faceAreaIntersect::tmMesh, faceAreaIntersect::tmMesh,
true,
AMIPatchToPatchInterpolation::imFaceAreaWeight, AMIPatchToPatchInterpolation::imFaceAreaWeight,
-1, -1,
flip flip

View File

@ -419,6 +419,7 @@ Foam::meshToMesh::patchAMIs() const
srcPP, srcPP,
tgtPP, tgtPP,
faceAreaIntersect::tmMesh, faceAreaIntersect::tmMesh,
false,
interpolationMethodAMI(method_), interpolationMethodAMI(method_),
-1, -1,
true // flip target patch since patch normals are aligned true // flip target patch since patch normals are aligned