BUG: cyclicAMI: differentiate between coupled geometry and coupled fields

This commit is contained in:
mattijs
2011-11-14 15:15:06 +00:00
parent 0143ef82ea
commit 35395ea438
17 changed files with 87 additions and 46 deletions

View File

@ -96,18 +96,6 @@ public:
//- Destructor
virtual ~coupledFacePointPatch();
// Member Functions
// Access
//- Return true because this patch is coupled
virtual bool coupled() const
{
return true;
}
};

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -154,7 +154,7 @@ public:
}
//- Return neighbour field given internal field
tmp<Field<Type> > patchNeighbourField() const;
virtual tmp<Field<Type> > patchNeighbourField() const;
// Evaluation functions

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -123,6 +123,14 @@ public:
new cyclicAMIFvsPatchField<Type>(*this, iF)
);
}
// Member functions
// Access
//- Return true if running parallel
virtual bool coupled() const;
};

View File

@ -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
(

View File

@ -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]);

View File

@ -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]);

View File

@ -157,7 +157,7 @@ public:
forAll(mesh.boundary(), patchi)
{
if (mesh.boundary()[patchi].coupled())
if (clippedLinearWeights.boundaryField()[patchi].coupled())
{
clippedLinearWeights.boundaryField()[patchi] =
max

View File

@ -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];

View File

@ -316,7 +316,7 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
if
(
!pp.coupled()
!magSf.boundaryField()[patchI].coupled()
|| refCast<const coupledPolyPatch>(pp).owner()
)
{

View File

@ -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;
}
};

View File

@ -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)

View File

@ -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;

View File

@ -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&>
(