Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
e1e40986
Commit
e1e40986
authored
15 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Have different master and slave patch to handle cyclic baffles.
parent
6291df9d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/utilities/mesh/manipulation/createBaffles/createBaffles.C
+33
-21
33 additions, 21 deletions
...utilities/mesh/manipulation/createBaffles/createBaffles.C
with
33 additions
and
21 deletions
applications/utilities/mesh/manipulation/createBaffles/createBaffles.C
+
33
−
21
View file @
e1e40986
...
@@ -128,8 +128,12 @@ int main(int argc, char *argv[])
...
@@ -128,8 +128,12 @@ int main(int argc, char *argv[])
# include "addRegionOption.H"
# include "addRegionOption.H"
argList
::
validArgs
.
append
(
"faceZone"
);
argList
::
validArgs
.
append
(
"faceZone"
);
argList
::
validArgs
.
append
(
"patch"
);
argList
::
validArgs
.
append
(
"(masterPatch slavePatch)"
);
argList
::
addOption
(
"additionalPatches"
,
"(patch2 .. patchN)"
);
argList
::
addOption
(
"additionalPatches"
,
"((master2 slave2) .. (masterN slaveN))"
);
argList
::
addBoolOption
(
"internalFacesOnly"
);
argList
::
addBoolOption
(
"internalFacesOnly"
);
# include "setRootCase.H"
# include "setRootCase.H"
...
@@ -142,7 +146,7 @@ int main(int argc, char *argv[])
...
@@ -142,7 +146,7 @@ int main(int argc, char *argv[])
const
faceZoneMesh
&
faceZones
=
mesh
.
faceZones
();
const
faceZoneMesh
&
faceZones
=
mesh
.
faceZones
();
// Faces to baffle
// Faces to baffle
faceZoneID
zoneID
(
args
[
1
],
faceZones
);
faceZoneID
zoneID
(
args
.
additionalArgs
()[
0
],
faceZones
);
Info
<<
"Converting faces on zone "
<<
zoneID
.
name
()
Info
<<
"Converting faces on zone "
<<
zoneID
.
name
()
<<
" into baffles."
<<
nl
<<
endl
;
<<
" into baffles."
<<
nl
<<
endl
;
...
@@ -165,28 +169,36 @@ int main(int argc, char *argv[])
...
@@ -165,28 +169,36 @@ int main(int argc, char *argv[])
fZone
.
checkParallelSync
(
true
);
fZone
.
checkParallelSync
(
true
);
// Patches to put baffles into
// Patches to put baffles into
DynamicList
<
label
>
newPatches
(
1
);
DynamicList
<
label
>
newMasterPatches
(
1
);
DynamicList
<
label
>
newSlavePatches
(
1
);
const
word
patchName
=
args
[
2
];
const
Pair
<
word
>
patchNames
(
IStringStream
(
args
.
additionalArgs
()[
1
])());
newPatches
.
append
(
findPatchID
(
mesh
,
patchName
));
newMasterPatches
.
append
(
findPatchID
(
mesh
,
patchNames
[
0
]));
Info
<<
"Using patch "
<<
patchName
newSlavePatches
.
append
(
findPatchID
(
mesh
,
patchNames
[
1
]));
<<
" at index "
<<
newPatches
[
0
]
<<
endl
;
Info
<<
"Using master patch "
<<
patchNames
[
0
]
<<
" at index "
<<
newMasterPatches
[
0
]
<<
endl
;
Info
<<
"Using slave patch "
<<
patchNames
[
1
]
<<
" at index "
<<
newSlavePatches
[
0
]
<<
endl
;
// Additional patches
// Additional patches
if
(
args
.
optionFound
(
"additionalPatches"
))
if
(
args
.
optionFound
(
"additionalPatches"
))
{
{
const
word
List
patchNames
const
List
<
Pair
<
word
>
>
patchNames
(
(
args
.
optionLookup
(
"additionalPatches"
)()
args
.
optionLookup
(
"additionalPatches"
)()
);
);
newPatches
.
reserve
(
patchNames
.
size
()
+
1
);
newMasterPatches
.
reserve
(
patchNames
.
size
()
+
1
);
newSlavePatches
.
reserve
(
patchNames
.
size
()
+
1
);
forAll
(
patchNames
,
i
)
forAll
(
patchNames
,
i
)
{
{
newPatches
.
append
(
findPatchID
(
mesh
,
patchNames
[
i
]));
newMasterPatches
.
append
(
findPatchID
(
mesh
,
patchNames
[
i
][
0
]));
Info
<<
"Using additional patch "
<<
patchNames
[
i
]
newSlavePatches
.
append
(
findPatchID
(
mesh
,
patchNames
[
i
][
1
]));
<<
" at index "
<<
newPatches
.
last
()
<<
endl
;
Info
<<
"Using additional patches "
<<
patchNames
[
i
]
<<
" at indices "
<<
newMasterPatches
.
last
()
<<
" and "
<<
newSlavePatches
.
last
()
<<
endl
;
}
}
}
}
...
@@ -265,10 +277,8 @@ int main(int argc, char *argv[])
...
@@ -265,10 +277,8 @@ int main(int argc, char *argv[])
}
}
label
nModified
=
0
;
label
nModified
=
0
;
forAll
(
newPatches
,
i
)
forAll
(
new
Master
Patches
,
i
)
{
{
label
newPatchI
=
newPatches
[
i
];
// Pass 1. Do selected side of zone
// Pass 1. Do selected side of zone
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
@@ -288,7 +298,7 @@ int main(int argc, char *argv[])
...
@@ -288,7 +298,7 @@ int main(int argc, char *argv[])
faceI
,
// label of face
faceI
,
// label of face
mesh
.
faceOwner
()[
faceI
],
// owner
mesh
.
faceOwner
()[
faceI
],
// owner
false
,
// face flip
false
,
// face flip
new
PatchI
,
// patch for face
new
MasterPatches
[
i
],
// patch for face
zoneID
.
index
(),
// zone for face
zoneID
.
index
(),
// zone for face
false
,
// face flip in zone
false
,
// face flip in zone
modifiedFace
// modify or add status
modifiedFace
// modify or add status
...
@@ -304,7 +314,7 @@ int main(int argc, char *argv[])
...
@@ -304,7 +314,7 @@ int main(int argc, char *argv[])
faceI
,
// label of face
faceI
,
// label of face
mesh
.
faceNeighbour
()[
faceI
],
// owner
mesh
.
faceNeighbour
()[
faceI
],
// owner
true
,
// face flip
true
,
// face flip
new
PatchI
,
// patch for face
new
MasterPatches
[
i
],
// patch for face
zoneID
.
index
(),
// zone for face
zoneID
.
index
(),
// zone for face
true
,
// face flip in zone
true
,
// face flip in zone
modifiedFace
// modify or add status
modifiedFace
// modify or add status
...
@@ -335,7 +345,7 @@ int main(int argc, char *argv[])
...
@@ -335,7 +345,7 @@ int main(int argc, char *argv[])
faceI
,
// label of face
faceI
,
// label of face
mesh
.
faceNeighbour
()[
faceI
],
// owner
mesh
.
faceNeighbour
()[
faceI
],
// owner
true
,
// face flip
true
,
// face flip
new
PatchI
,
// patch for face
new
SlavePatches
[
i
],
// patch for face
zoneID
.
index
(),
// zone for face
zoneID
.
index
(),
// zone for face
true
,
// face flip in zone
true
,
// face flip in zone
modifiedFace
// modify or add
modifiedFace
// modify or add
...
@@ -351,7 +361,7 @@ int main(int argc, char *argv[])
...
@@ -351,7 +361,7 @@ int main(int argc, char *argv[])
faceI
,
// label of face
faceI
,
// label of face
mesh
.
faceOwner
()[
faceI
],
// owner
mesh
.
faceOwner
()[
faceI
],
// owner
false
,
// face flip
false
,
// face flip
new
PatchI
,
// patch for face
new
SlavePatches
[
i
],
// patch for face
zoneID
.
index
(),
// zone for face
zoneID
.
index
(),
// zone for face
false
,
// face flip in zone
false
,
// face flip in zone
modifiedFace
// modify or add status
modifiedFace
// modify or add status
...
@@ -379,6 +389,8 @@ int main(int argc, char *argv[])
...
@@ -379,6 +389,8 @@ int main(int argc, char *argv[])
{
{
const
polyPatch
&
pp
=
patches
[
patchI
];
const
polyPatch
&
pp
=
patches
[
patchI
];
label
newPatchI
=
newMasterPatches
[
i
];
if
(
pp
.
coupled
()
&&
patches
[
newPatchI
].
coupled
())
if
(
pp
.
coupled
()
&&
patches
[
newPatchI
].
coupled
())
{
{
// Do not allow coupled faces to be moved to different coupled
// Do not allow coupled faces to be moved to different coupled
...
@@ -428,7 +440,7 @@ int main(int argc, char *argv[])
...
@@ -428,7 +440,7 @@ int main(int argc, char *argv[])
Info
<<
"Converted "
<<
returnReduce
(
nModified
,
sumOp
<
label
>
())
Info
<<
"Converted "
<<
returnReduce
(
nModified
,
sumOp
<
label
>
())
<<
" faces into boundary faces on patch "
<<
patchName
<<
nl
<<
endl
;
<<
" faces into boundary faces on patch
es
"
<<
patchName
s
<<
nl
<<
endl
;
if
(
!
overwrite
)
if
(
!
overwrite
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment