mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: cyclicAMI: differentiate between coupled geometry and coupled fields
This commit is contained in:
@ -96,18 +96,6 @@ public:
|
||||
|
||||
//- Destructor
|
||||
virtual ~coupledFacePointPatch();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return true because this patch is coupled
|
||||
virtual bool coupled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -154,7 +154,7 @@ public:
|
||||
}
|
||||
|
||||
//- Return neighbour field given internal field
|
||||
tmp<Field<Type> > patchNeighbourField() const;
|
||||
virtual tmp<Field<Type> > patchNeighbourField() const;
|
||||
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -123,6 +123,14 @@ public:
|
||||
new cyclicAMIFvsPatchField<Type>(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return true if running parallel
|
||||
virtual bool coupled() const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -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]);
|
||||
|
||||
@ -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]);
|
||||
|
||||
@ -157,7 +157,7 @@ public:
|
||||
|
||||
forAll(mesh.boundary(), patchi)
|
||||
{
|
||||
if (mesh.boundary()[patchi].coupled())
|
||||
if (clippedLinearWeights.boundaryField()[patchi].coupled())
|
||||
{
|
||||
clippedLinearWeights.boundaryField()[patchi] =
|
||||
max
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -316,7 +316,7 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
|
||||
|
||||
if
|
||||
(
|
||||
!pp.coupled()
|
||||
!magSf.boundaryField()[patchI].coupled()
|
||||
|| refCast<const coupledPolyPatch>(pp).owner()
|
||||
)
|
||||
{
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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&>
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user