mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: cyclicPolyPatch : additional checking for neighbourPatch name
This commit is contained in:
@ -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())
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user