Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
OpenFOAM-plus
Commits
821ff7a5
Commit
821ff7a5
authored
Sep 22, 2017
by
Andrew Heather
Browse files
ENH: boundaryMesh - allow not found state in findPatchID
parent
40fc8462
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
View file @
821ff7a5
...
@@ -656,7 +656,11 @@ Foam::label Foam::polyBoundaryMesh::findIndex(const keyType& key) const
...
@@ -656,7 +656,11 @@ Foam::label Foam::polyBoundaryMesh::findIndex(const keyType& key) const
}
}
Foam
::
label
Foam
::
polyBoundaryMesh
::
findPatchID
(
const
word
&
patchName
)
const
Foam
::
label
Foam
::
polyBoundaryMesh
::
findPatchID
(
const
word
&
patchName
,
bool
allowNotFound
)
const
{
{
const
polyPatchList
&
patches
=
*
this
;
const
polyPatchList
&
patches
=
*
this
;
...
@@ -668,6 +672,20 @@ Foam::label Foam::polyBoundaryMesh::findPatchID(const word& patchName) const
...
@@ -668,6 +672,20 @@ Foam::label Foam::polyBoundaryMesh::findPatchID(const word& patchName) const
}
}
}
}
if
(
!
allowNotFound
)
{
string
regionStr
(
""
);
if
(
mesh_
.
name
()
!=
polyMesh
::
defaultRegion
)
{
regionStr
=
"in region '"
+
mesh_
.
name
()
+
"' "
;
}
FatalErrorInFunction
<<
"Patch '"
<<
patchName
<<
"' not found. "
<<
"Available patch names "
<<
regionStr
<<
"include: "
<<
names
()
<<
exit
(
FatalError
);
}
// Patch not found
// Patch not found
if
(
debug
)
if
(
debug
)
{
{
...
...
src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H
View file @
821ff7a5
...
@@ -171,7 +171,11 @@ public:
...
@@ -171,7 +171,11 @@ public:
label
findIndex
(
const
keyType
&
)
const
;
label
findIndex
(
const
keyType
&
)
const
;
//- Find patch index given a name
//- Find patch index given a name
label
findPatchID
(
const
word
&
patchName
)
const
;
label
findPatchID
(
const
word
&
patchName
,
const
bool
allowNotFound
=
true
)
const
;
//- Find patch indices for a given polyPatch type
//- Find patch indices for a given polyPatch type
template
<
class
Type
>
template
<
class
Type
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment