ENH: cyclicPolyPatch : additional checking for neighbourPatch name

This commit is contained in:
mattijs
2011-01-14 11:37:15 +00:00
parent 5de788eae0
commit 7a43ab40fd
2 changed files with 36 additions and 20 deletions

View File

@ -703,9 +703,43 @@ Foam::cyclicPolyPatch::~cyclicPolyPatch()
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::label Foam::cyclicPolyPatch::neighbPatchID() const
{
if (neighbPatchID_ == -1)
{
neighbPatchID_ = this->boundaryMesh().findPatchID(neighbPatchName_);
if (neighbPatchID_ == -1)
{
FatalErrorIn("cyclicPolyPatch::neighbPatchID() const")
<< "Illegal neighbourPatch name " << neighbPatchName_
<< endl << "Valid patch names are "
<< this->boundaryMesh().names()
<< exit(FatalError);
}
// Check that it is a cyclic
const cyclicPolyPatch& nbrPatch = refCast<const cyclicPolyPatch>
(
this->boundaryMesh()[neighbPatchID_]
);
if (nbrPatch.neighbPatchName() != name())
{
WarningIn("cyclicPolyPatch::neighbPatchID() const")
<< "Patch " << name()
<< " specifies neighbour patch " << neighbPatchName()
<< endl << " but that in return specifies "
<< nbrPatch.neighbPatchName()
<< endl;
}
}
return neighbPatchID_;
}
void Foam::cyclicPolyPatch::transformPosition(pointField& l) const
{
if (!parallel())

View File

@ -325,25 +325,7 @@ public:
}
//- Neighbour patchID.
virtual label neighbPatchID() const
{
if (neighbPatchID_ == -1)
{
neighbPatchID_ = this->boundaryMesh().findPatchID
(
neighbPatchName_
);
if (neighbPatchID_ == -1)
{
FatalErrorIn("cyclicPolyPatch::neighbPatchID() const")
<< "Illegal neighbourPatch name " << neighbPatchName_
<< endl << "Valid patch names are "
<< this->boundaryMesh().names()
<< exit(FatalError);
}
}
return neighbPatchID_;
}
virtual label neighbPatchID() const;
virtual bool owner() const
{