diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C index 047a0b01f7..eb3053dd88 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C @@ -64,9 +64,16 @@ Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField << exit(FatalIOError); } - if (!dict.found("value") && this->coupled()) + if (!dict.found("value")) { - this->evaluate(Pstream::commsTypes::blocking); + if (this->coupled()) + { + this->evaluate(Pstream::commsTypes::blocking); + } + else + { + fvPatchField::operator=(this->patchInternalField()); + } } } diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.C index bd4d9f4c1f..5a22b8cb08 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.C @@ -115,19 +115,7 @@ Foam::cyclicAMIFvsPatchField::cyclicAMIFvsPatchField template bool Foam::cyclicAMIFvsPatchField::coupled() const { - if - ( - Pstream::parRun() - || ( - this->cyclicAMIPatch_.size() - && this->cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().size() - ) - ) - { - return true; - } - - return false; + return cyclicAMIPatch_.coupled(); } diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C index 73398e753e..b338fb7b5e 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C @@ -29,6 +29,7 @@ License #include "cyclicAMIFvPatch.H" #include "addToRunTimeSelectionTable.H" #include "fvMesh.H" +#include "Time.H" #include "transform.H" #include "surfaceFields.H" @@ -52,7 +53,9 @@ namespace Foam bool Foam::cyclicAMIFvPatch::coupled() const { - return Pstream::parRun() || (this->size() && neighbFvPatch().size()); + return + Pstream::parRun() + || !this->boundaryMesh().mesh().time().processorCase(); } diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatch/cyclicAMIPointPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatch/cyclicAMIPointPatch.C index 58803883f7..f4cecf6275 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatch/cyclicAMIPointPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatch/cyclicAMIPointPatch.C @@ -27,6 +27,8 @@ License #include "cyclicAMIPointPatch.H" #include "pointBoundaryMesh.H" +#include "pointMesh.H" +#include "Time.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -105,4 +107,14 @@ Foam::cyclicAMIPointPatch::~cyclicAMIPointPatch() {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::cyclicAMIPointPatch::coupled() const +{ + return + Pstream::parRun() + || !this->boundaryMesh().mesh().mesh().time().processorCase(); +} + + // ************************************************************************* // diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatch/cyclicAMIPointPatch.H b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatch/cyclicAMIPointPatch.H index cb7a7ab6a8..d501091c84 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatch/cyclicAMIPointPatch.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatch/cyclicAMIPointPatch.H @@ -114,6 +114,9 @@ public: // Member Functions + //- Return true if this patch field is coupled + virtual bool coupled() const; + //- Return the constraint type this pointPatch implements. virtual const word& constraintType() const { diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.C b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.C index b9608c1115..0b4de45961 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.C @@ -111,6 +111,13 @@ Foam::cyclicAMIPointPatchField::cyclicAMIPointPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +bool Foam::cyclicAMIPointPatchField::coupled() const +{ + return cyclicAMIPatch_.coupled(); +} + + template void Foam::cyclicAMIPointPatchField::swapAddSeparated ( diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H index 42830aba13..87fbaf5a8e 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H @@ -211,6 +211,10 @@ public: // Evaluation functions + //- Return true if coupled. Note that the underlying patch + //- is not coupled() - the points don't align. + virtual bool coupled() const; + //- Evaluate the patch field virtual void evaluate (