Commit 7a43ab40 authored by mattijs's avatar mattijs
Browse files

ENH: cyclicPolyPatch : additional checking for neighbourPatch name

parent 5de788ea
...@@ -703,9 +703,43 @@ Foam::cyclicPolyPatch::~cyclicPolyPatch() ...@@ -703,9 +703,43 @@ Foam::cyclicPolyPatch::~cyclicPolyPatch()
} }
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * 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 void Foam::cyclicPolyPatch::transformPosition(pointField& l) const
{ {
if (!parallel()) if (!parallel())
......
...@@ -325,25 +325,7 @@ public: ...@@ -325,25 +325,7 @@ public:
} }
//- Neighbour patchID. //- Neighbour patchID.
virtual label neighbPatchID() const 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 bool owner() const virtual bool owner() const
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment