ENH: Region models - added utility function to return true if patch is coupled

This commit is contained in:
andy
2012-12-12 09:58:31 +00:00
parent df073a34ec
commit 2cc72954e1
2 changed files with 25 additions and 4 deletions

View File

@ -217,9 +217,13 @@ public:
// Addressing
//- Return true if patchI on the local region is a coupled
// patch to the primary region
inline bool isCoupledPatch(const label regionPatchI) const;
//- Return true if patchI on the primary region is a coupled
// patch to the local region
inline bool isRegionPatch(const label patchI) const;
inline bool isRegionPatch(const label primaryPatchI) const;
//- Return the list of patch IDs on the primary region coupled
// to this region

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -112,14 +112,31 @@ Foam::regionModels::regionModel::solution() const
}
inline bool Foam::regionModels::regionModel::isCoupledPatch
(
const label regionPatchI
) const
{
forAll(intCoupledPatchIDs_, i)
{
if (intCoupledPatchIDs_[i] == regionPatchI)
{
return true;
}
}
return false;
}
inline bool Foam::regionModels::regionModel::isRegionPatch
(
const label patchI
const label primaryPatchI
) const
{
forAll(primaryPatchIDs_, i)
{
if (primaryPatchIDs_[i] == patchI)
if (primaryPatchIDs_[i] == primaryPatchI)
{
return true;
}