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
Community
integration-cfmesh
Commits
da7c7c2e
Commit
da7c7c2e
authored
Aug 08, 2014
by
Philippose Rajan
Browse files
Added patch access and regex search capabilities to the polyMeshGenFaces class
Signed-off-by:
Philippose Rajan
<
sarith@rocketmail.com
>
parent
1323bcfe
Changes
2
Hide whitespace changes
Inline
Side-by-side
meshLibrary/utilities/meshes/polyMeshGen/polyMeshGenFaces.C
View file @
da7c7c2e
...
...
@@ -31,6 +31,7 @@ Description
#include "IOobjectList.H"
#include "faceSet.H"
#include "demandDrivenData.H"
#include "stringListOps.H"
namespace
Foam
{
...
...
@@ -201,6 +202,51 @@ label polyMeshGenFaces::faceIsInPatch(const label faceLabel) const
return
-
1
;
}
wordList
polyMeshGenFaces
::
patchNames
()
const
{
wordList
t
(
boundaries_
.
size
());
forAll
(
boundaries_
,
patchI
)
{
t
[
patchI
]
=
boundaries_
[
patchI
].
patchName
();
}
return
t
;
}
label
polyMeshGenFaces
::
findPatchID
(
const
word
&
patchName
)
const
{
forAll
(
boundaries_
,
patchI
)
{
if
(
boundaries_
.
set
(
patchI
))
{
if
(
boundaries_
[
patchI
].
patchName
()
==
patchName
)
{
return
patchI
;
}
}
}
// If the code gets here, it implies that the patch was not found.
// return a -1 in this case
return
-
1
;
}
labelList
polyMeshGenFaces
::
findPatches
(
const
word
&
patchName
)
const
{
wordList
allPatches
=
patchNames
();
labelList
patchIDs
=
findStrings
(
patchName
,
allPatches
);
if
(
patchIDs
.
empty
())
{
WarningIn
(
"polyMeshGenFaces::findPatches(const word&)"
)
<<
"Cannot find any patch names matching "
<<
patchName
<<
endl
;
}
return
patchIDs
;
}
label
polyMeshGenFaces
::
addFaceSubset
(
const
word
&
setName
)
{
label
id
=
faceSubsetIndex
(
setName
);
...
...
meshLibrary/utilities/meshes/polyMeshGen/polyMeshGenFaces.H
View file @
da7c7c2e
...
...
@@ -142,7 +142,17 @@ public:
//- return patch label for the given face label
label
faceIsInPatch
(
const
label
faceLabel
)
const
;
//- return list of patches in the boundary
wordList
patchNames
()
const
;
//- return the index of a patch given its name
label
findPatchID
(
const
word
&
patchName
)
const
;
//- return a list of patch indices corresponding to the given
// name, expanding regular expressions
labelList
findPatches
(
const
word
&
patchName
)
const
;
// Subsets
label
addFaceSubset
(
const
word
&
);
...
...
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