diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/coupled/coupledFacePointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/coupled/coupledFacePointPatch.H index 368782d0a3757f5ff596598c465c35b2044f81a7..91db5fc8737eb65a1cb84228b9b55a6981bd4e07 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/coupled/coupledFacePointPatch.H +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/coupled/coupledFacePointPatch.H @@ -96,18 +96,6 @@ public: //- Destructor virtual ~coupledFacePointPatch(); - - - // Member Functions - - // Access - - //- Return true because this patch is coupled - virtual bool coupled() const - { - return true; - } - }; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H index ceb622058526255b8885b0472d5f879ef4f535c7..5601c1e993cb7926d40177f6ef5ddcf92db084c4 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H @@ -285,7 +285,8 @@ public: //- Return boundaryMesh reference const polyBoundaryMesh& boundaryMesh() const; - //- Return true if this patch field is coupled + //- Return true if this patch is geometrically coupled (i.e. faces and + // points correspondence) virtual bool coupled() const { return false; diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C index 8e358063fa4e96ae5affc153a892f753c6115776..31729346e24a67589461886dcadb83fe558b6acc 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C @@ -106,7 +106,7 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField << exit(FatalIOError); } - if (cyclicAMIPatch_.coupled()) + if (this->coupled()) { this->evaluate(Pstream::blocking); } @@ -140,6 +140,27 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class Type> +bool Foam::cyclicAMIFvPatchField<Type>::coupled() const +{ + if + ( + Pstream::parRun() + || ( + this->cyclicAMIPatch_.size() + && this->cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().size() + ) + ) + { + return true; + } + else + { + return false; + } +} + + template<class Type> Foam::tmp<Foam::Field<Type> > Foam::cyclicAMIFvPatchField<Type>::patchNeighbourField() const diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H index 9a4e5f6b4c8f85721c608366b9a59e90e71b403b..2e05111cb688a48568ffb599da04f18e0c3bc660 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H @@ -147,8 +147,12 @@ public: // Evaluation functions + //- Return true if coupled. Note that the underlying patch + // is not coupled() - the points don't align. + virtual bool coupled() const; + //- Return neighbour coupled internal cell data - tmp<Field<Type> > patchNeighbourField() const; + virtual tmp<Field<Type> > patchNeighbourField() const; //- Return reference to neighbour patchField const cyclicAMIFvPatchField<Type>& neighbourPatchField() const; diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H index 7e3152e1312e1302dd7efd4c8241bec707b06423..0130909d04d4a88bbe8c46dd8af564bc8a0a5491 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H @@ -154,7 +154,7 @@ public: } //- Return neighbour field given internal field - tmp<Field<Type> > patchNeighbourField() const; + virtual tmp<Field<Type> > patchNeighbourField() const; // Evaluation functions diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.C index a347bc43475629a4980cbc1ec1bc4d5f95261341..0ffe6b9c95e24e4039001305a3c2525f487ede21 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.C @@ -123,4 +123,27 @@ Foam::cyclicAMIFvsPatchField<Type>::cyclicAMIFvsPatchField {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +bool Foam::cyclicAMIFvsPatchField<Type>::coupled() const +{ + if + ( + Pstream::parRun() + || ( + this->cyclicAMIPatch_.size() + && this->cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().size() + ) + ) + { + return true; + } + else + { + return false; + } +} + + // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H index fe849831347d30ba67183a7602536d15bb0942d7..d55ff5cd5d1f1665acb05cf22e88d2f515f3a773 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H @@ -123,6 +123,14 @@ public: new cyclicAMIFvsPatchField<Type>(*this, iF) ); } + + // Member functions + + // Access + + //- Return true if running parallel + virtual bool coupled() const; + }; diff --git a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C index 6002a07e1c1a2f95a39bed80ec4921a3da8a5052..27f5b72fcfd483336cc71e2c4549a92f3da24b38 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C @@ -132,7 +132,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const // Build the d-vectors vectorField pd = p.delta(); - if (p.coupled()) + if (pw.coupled()) { forAll(pd, patchFacei) { @@ -185,7 +185,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const // Build the d-vectors vectorField pd = p.delta(); - if (p.coupled()) + if (pw.coupled()) { forAll(pd, patchFacei) { @@ -256,7 +256,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const label patchFacei = facei - mesh.boundaryMesh()[patchi].start(); - if (mesh.boundary()[patchi].coupled()) + if (w.boundaryField()[patchi].coupled()) { scalar wf = max ( diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C index 85c6f3f61f3ed78ccc56dc78c6abbd2f05391a56..021241fa270d2dc7b14695891d771f4a14a7b6cb 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C @@ -103,7 +103,7 @@ Foam::extendedCellToFaceStencil::extendedCellToFaceStencil(const polyMesh& mesh) forAll(patches, patchI) { - if (isA<coupledPolyPatch>(patches[patchI])) + if (patches[patchI].coupled()) { const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>(patches[patchI]); diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C index 0943d86685ea0621e35f3b5bb3b15feb73ecc864..4f364dc288749cced43bf09e85c2399745df822b 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C @@ -38,7 +38,7 @@ Foam::extendedFaceToCellStencil::extendedFaceToCellStencil(const polyMesh& mesh) forAll(patches, patchI) { - if (isA<coupledPolyPatch>(patches[patchI])) + if (patches[patchI].coupled()) { const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>(patches[patchI]); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/clippedLinear/clippedLinear.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/clippedLinear/clippedLinear.H index 312a453c44d6879eb3c58c97f598b85111f5885a..b69b2a05dc356e70dee8dd791b2d8a8dcb791800 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/clippedLinear/clippedLinear.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/clippedLinear/clippedLinear.H @@ -157,7 +157,7 @@ public: forAll(mesh.boundary(), patchi) { - if (mesh.boundary()[patchi].coupled()) + if (clippedLinearWeights.boundaryField()[patchi].coupled()) { clippedLinearWeights.boundaryField()[patchi] = max diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H index 5dd8ee104a02ff7ab5e637e7fe65865a9affeab6..3f3cae05fedc836c7db478aba8e0e0b92f27f78f 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/reverseLinear/reverseLinear.H @@ -129,7 +129,7 @@ public: forAll(mesh.boundary(), patchI) { - if (mesh.boundary()[patchI].coupled()) + if (reverseLinearWeights.boundaryField()[patchI].coupled()) { reverseLinearWeights.boundaryField()[patchI] = 1.0 - cdWeights.boundaryField()[patchI]; diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C index 0f2a765ea8994401a4da2eb4756ff6c3e03c73cd..36fb2aa035930d7c85b51d1cc6c2762c86a89bcf 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C @@ -316,7 +316,7 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing if ( - !pp.coupled() + !magSf.boundaryField()[patchI].coupled() || refCast<const coupledPolyPatch>(pp).owner() ) { diff --git a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPointPatch/cyclicAMIPointPatch.H b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPointPatch/cyclicAMIPointPatch.H index 3ade3aeaefa3e4d026c775ef776b4a80fef11536..78c69e0ad022777a755e31807aba9b2b74684a7c 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPointPatch/cyclicAMIPointPatch.H +++ b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPointPatch/cyclicAMIPointPatch.H @@ -107,6 +107,17 @@ public: //- Destructor virtual ~cyclicAMIPointPatch(); + + + // Member Functions + + //- Is patch 'coupled'. Note that on AMI the geometry is not + // coupled but the fields are! + virtual bool coupled() const + { + return false; + } + }; diff --git a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C index b6769849f7d0a96160f54dc77e3502f9310c845d..d281afc21f84de3cd248e4ac6506af26238ce6b6 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C @@ -548,23 +548,6 @@ Foam::cyclicAMIPolyPatch::~cyclicAMIPolyPatch() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::cyclicAMIPolyPatch::coupled() const -{ - if - ( - Pstream::parRun() - || (size() && neighbPatch().size()) - ) - { - return true; - } - else - { - return false; - } -} - - Foam::label Foam::cyclicAMIPolyPatch::neighbPatchID() const { if (nbrPatchID_ == -1) diff --git a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H index ced7968171c7f6ddc3c81d7cac8126d08b84857f..9ced39571a247fa5c0e22e4a7a627a52cb5c232a 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H +++ b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H @@ -254,10 +254,12 @@ public: // Access - //- Return true only if is coupled. Note that for non-parallel - // operation of a decomposed case this can return the wrong - // result - virtual bool coupled() const; + //- Is patch 'coupled'. Note that on AMI the geometry is not + // coupled but the fields are! + virtual bool coupled() const + { + return false; + } //- Neighbour patch name inline const word& neighbPatchName() const; diff --git a/src/sampling/sampledSurface/isoSurface/isoSurface.C b/src/sampling/sampledSurface/isoSurface/isoSurface.C index 81497e47a015d2895b3acb71874a256149c85e63..f96983d27ac657fa9c2224748091ea25672ccd2c 100644 --- a/src/sampling/sampledSurface/isoSurface/isoSurface.C +++ b/src/sampling/sampledSurface/isoSurface/isoSurface.C @@ -1769,7 +1769,7 @@ Foam::isoSurface::isoSurface const polyPatch& pp = patches[patchI]; // Adapt separated coupled (proc and cyclic) patches - if (isA<coupledPolyPatch>(pp)) + if (pp.coupled()) { fvPatchVectorField& pfld = const_cast<fvPatchVectorField&> (