Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
b74f1096
Commit
b74f1096
authored
Jan 12, 2009
by
mattijs
Browse files
wildcards in selection
parent
59261a95
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C
View file @
b74f1096
...
...
@@ -55,26 +55,37 @@ Foam::topoSetSource::addToUsageTable Foam::zoneToCell::usage_
void
Foam
::
zoneToCell
::
combine
(
topoSet
&
set
,
const
bool
add
)
const
{
label
zoneI
=
mesh_
.
cellZones
().
findZoneID
(
zoneName_
)
;
bool
hasMatched
=
false
;
if
(
zoneI
!=
-
1
)
forAll
(
mesh_
.
cellZones
(),
i
)
{
const
labelList
&
cellLabels
=
mesh_
.
cellZones
()[
zoneI
];
const
cellZone
&
zone
=
mesh_
.
cellZones
()[
i
];
forAll
(
cellLabels
,
i
)
if
(
zoneName_
.
match
(
zone
.
name
())
)
{
// Only do active cells
if
(
cellLabels
[
i
]
<
mesh_
.
nCells
())
const
labelList
&
cellLabels
=
mesh_
.
cellZones
()[
i
];
Info
<<
" Found matching zone "
<<
zone
.
name
()
<<
" with "
<<
cellLabels
.
size
()
<<
" cells."
<<
endl
;
hasMatched
=
true
;
forAll
(
cellLabels
,
i
)
{
addOrDelete
(
set
,
cellLabels
[
i
],
add
);
// Only do active cells
if
(
cellLabels
[
i
]
<
mesh_
.
nCells
())
{
addOrDelete
(
set
,
cellLabels
[
i
],
add
);
}
}
}
}
else
if
(
!
hasMatched
)
{
WarningIn
(
"zoneToCell::combine(topoSet&, const bool)"
)
<<
"Cannot find
z
one named "
<<
zoneName_
<<
endl
<<
"Valid
zon
es are "
<<
mesh_
.
cellZones
().
names
()
<<
endl
;
<<
"Cannot find
any cellZ
one named "
<<
zoneName_
<<
endl
<<
"Valid
nam
es are "
<<
mesh_
.
cellZones
().
names
()
<<
endl
;
}
}
...
...
src/meshTools/sets/cellSources/zoneToCell/zoneToCell.H
View file @
b74f1096
...
...
@@ -37,6 +37,7 @@ SourceFiles
#define zoneToCell_H
#include
"topoSetSource.H"
#include
"wordRe.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -57,8 +58,8 @@ class zoneToCell
//- Add usage string
static
addToUsageTable
usage_
;
//- Name of cellZone
word
zoneName_
;
//- Name
/regular expression
of cellZone
word
Re
zoneName_
;
// Private Member Functions
...
...
src/meshTools/sets/faceSources/patchToFace/patchToFace.C
View file @
b74f1096
...
...
@@ -57,21 +57,36 @@ Foam::topoSetSource::addToUsageTable Foam::patchToFace::usage_
void
Foam
::
patchToFace
::
combine
(
topoSet
&
set
,
const
bool
add
)
const
{
label
p
atch
I
=
mesh_
.
boundaryMesh
().
findPatchID
(
patchName_
)
;
bool
hasM
atch
ed
=
false
;
if
(
patchI
!=
-
1
)
forAll
(
mesh_
.
boundaryMesh
(),
patchI
)
{
const
polyPatch
&
pp
=
mesh_
.
boundaryMesh
()[
patchI
];
for
(
label
faceI
=
pp
.
start
();
faceI
<
pp
.
start
()
+
pp
.
size
();
faceI
++
)
if
(
patchName_
.
match
(
pp
.
name
())
)
{
addOrDelete
(
set
,
faceI
,
add
);
Info
<<
" Found matching patch "
<<
pp
.
name
()
<<
" with "
<<
pp
.
size
()
<<
" faces."
<<
endl
;
hasMatched
=
true
;
for
(
label
faceI
=
pp
.
start
();
faceI
<
pp
.
start
()
+
pp
.
size
();
faceI
++
)
{
addOrDelete
(
set
,
faceI
,
add
);
}
}
}
else
if
(
!
hasMatched
)
{
WarningIn
(
"patchToFace::combine(topoSet&, const bool)"
)
<<
"Cannot find patch named "
<<
patchName_
<<
endl
<<
"Cannot find
any
patch named "
<<
patchName_
<<
endl
<<
"Valid names are "
<<
mesh_
.
boundaryMesh
().
names
()
<<
endl
;
}
}
...
...
src/meshTools/sets/faceSources/patchToFace/patchToFace.H
View file @
b74f1096
...
...
@@ -37,6 +37,7 @@ SourceFiles
#define patchToFace_H
#include
"topoSetSource.H"
#include
"wordRe.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -57,8 +58,8 @@ class patchToFace
//- Add usage string
static
addToUsageTable
usage_
;
//- Name of patch
word
patchName_
;
//- Name
/regular expression
of patch
word
Re
patchName_
;
// Private Member Functions
...
...
src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C
View file @
b74f1096
...
...
@@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include
"zoneToFace.H"
...
...
@@ -57,26 +55,37 @@ Foam::topoSetSource::addToUsageTable Foam::zoneToFace::usage_
void
Foam
::
zoneToFace
::
combine
(
topoSet
&
set
,
const
bool
add
)
const
{
label
zoneI
=
mesh_
.
faceZones
().
findZoneID
(
zoneName_
)
;
bool
hasMatched
=
false
;
if
(
zoneI
!=
-
1
)
forAll
(
mesh_
.
faceZones
(),
i
)
{
const
labelList
&
faceLabels
=
mesh_
.
faceZones
()[
zoneI
];
const
faceZone
&
zone
=
mesh_
.
faceZones
()[
i
];
forAll
(
faceLabels
,
i
)
if
(
zoneName_
.
match
(
zone
.
name
())
)
{
// Only do active faces
if
(
faceLabels
[
i
]
<
mesh_
.
nFaces
())
const
labelList
&
faceLabels
=
mesh_
.
faceZones
()[
i
];
Info
<<
" Found matching zone "
<<
zone
.
name
()
<<
" with "
<<
faceLabels
.
size
()
<<
" faces."
<<
endl
;
hasMatched
=
true
;
forAll
(
faceLabels
,
i
)
{
addOrDelete
(
set
,
faceLabels
[
i
],
add
);
// Only do active faces
if
(
faceLabels
[
i
]
<
mesh_
.
nFaces
())
{
addOrDelete
(
set
,
faceLabels
[
i
],
add
);
}
}
}
}
else
if
(
!
hasMatched
)
{
WarningIn
(
"zoneToFace::combine(topoSet&, const bool)"
)
<<
"Cannot find
z
one named "
<<
zoneName_
<<
endl
<<
"Valid
zon
es are "
<<
mesh_
.
faceZones
().
names
()
<<
endl
;
<<
"Cannot find
any faceZ
one named "
<<
zoneName_
<<
endl
<<
"Valid
nam
es are "
<<
mesh_
.
faceZones
().
names
()
<<
endl
;
}
}
...
...
src/meshTools/sets/faceSources/zoneToFace/zoneToFace.H
View file @
b74f1096
...
...
@@ -37,6 +37,7 @@ SourceFiles
#define zoneToFace_H
#include
"topoSetSource.H"
#include
"wordRe.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -57,8 +58,8 @@ class zoneToFace
//- Add usage string
static
addToUsageTable
usage_
;
//- Name
of face
Zone
word
zoneName_
;
//- Name
/regular expression of cell
Zone
word
Re
zoneName_
;
// Private Member Functions
...
...
src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C
View file @
b74f1096
...
...
@@ -55,26 +55,37 @@ Foam::topoSetSource::addToUsageTable Foam::zoneToPoint::usage_
void
Foam
::
zoneToPoint
::
combine
(
topoSet
&
set
,
const
bool
add
)
const
{
label
zoneI
=
mesh_
.
pointZones
().
findZoneID
(
zoneName_
)
;
bool
hasMatched
=
false
;
if
(
zoneI
!=
-
1
)
forAll
(
mesh_
.
pointZones
(),
i
)
{
const
labelList
&
pointLabels
=
mesh_
.
pointZones
()[
zoneI
];
const
pointZone
&
zone
=
mesh_
.
pointZones
()[
i
];
forAll
(
pointLabels
,
i
)
if
(
zoneName_
.
match
(
zone
.
name
())
)
{
// Only do active cells
if
(
pointLabels
[
i
]
<
mesh_
.
nPoints
())
const
labelList
&
pointLabels
=
mesh_
.
pointZones
()[
i
];
Info
<<
" Found matching zone "
<<
zone
.
name
()
<<
" with "
<<
pointLabels
.
size
()
<<
" points."
<<
endl
;
hasMatched
=
true
;
forAll
(
pointLabels
,
i
)
{
addOrDelete
(
set
,
pointLabels
[
i
],
add
);
// Only do active points
if
(
pointLabels
[
i
]
<
mesh_
.
nPoints
())
{
addOrDelete
(
set
,
pointLabels
[
i
],
add
);
}
}
}
}
else
if
(
!
hasMatched
)
{
WarningIn
(
"zoneToPoint::combine(topoSet&, const bool)"
)
<<
"Cannot find
z
one named "
<<
zoneName_
<<
endl
<<
"Valid
zon
es are "
<<
mesh_
.
pointZones
().
names
()
<<
endl
;
<<
"Cannot find
any pointZ
one named "
<<
zoneName_
<<
endl
<<
"Valid
nam
es are "
<<
mesh_
.
pointZones
().
names
()
<<
endl
;
}
}
...
...
src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.H
View file @
b74f1096
...
...
@@ -37,6 +37,7 @@ SourceFiles
#define zoneToPoint_H
#include
"topoSetSource.H"
#include
"wordRe.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -57,8 +58,8 @@ class zoneToPoint
//- Add usage string
static
addToUsageTable
usage_
;
//- Name
of cellZ
one
word
zoneName_
;
//- Name
/regular expression of z
one
word
Re
zoneName_
;
// Private Member Functions
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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