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
b5ee8b6d
Commit
b5ee8b6d
authored
16 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
detect only option
parent
6520f35f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C
+78
-56
78 additions, 56 deletions
...sh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C
with
78 additions
and
56 deletions
applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C
+
78
−
56
View file @
b5ee8b6d
...
...
@@ -154,10 +154,77 @@ void insertDuplicateMerge
}
labelList
findBaffles
(
const
polyMesh
&
mesh
,
const
labelList
&
boundaryFaces
)
{
// Get all duplicate face labels (in boundaryFaces indices!).
labelList
duplicates
=
localPointRegion
::
findDuplicateFaces
(
mesh
,
boundaryFaces
);
// Check that none are on processor patches
const
polyBoundaryMesh
&
patches
=
mesh
.
boundaryMesh
();
forAll
(
duplicates
,
bFaceI
)
{
if
(
duplicates
[
bFaceI
]
!=
-
1
)
{
label
faceI
=
mesh
.
nInternalFaces
()
+
bFaceI
;
label
patchI
=
patches
.
whichPatch
(
faceI
);
if
(
isA
<
processorPolyPatch
>
(
patches
[
patchI
]))
{
FatalErrorIn
(
"findBaffles(const polyMesh&, const labelList&)"
)
<<
"Duplicate face "
<<
faceI
<<
" is on a processorPolyPatch."
<<
"This is not allowed."
<<
nl
<<
"Face:"
<<
faceI
<<
" is on patch:"
<<
patches
[
patchI
].
name
()
<<
abort
(
FatalError
);
}
}
}
// Write to faceSet for ease of postprocessing.
{
faceSet
duplicateSet
(
mesh
,
"duplicateFaces"
,
(
mesh
.
nFaces
()
-
mesh
.
nInternalFaces
())
/
256
);
forAll
(
duplicates
,
bFaceI
)
{
label
otherFaceI
=
duplicates
[
bFaceI
];
if
(
otherFaceI
!=
-
1
&&
otherFaceI
>
bFaceI
)
{
duplicateSet
.
insert
(
mesh
.
nInternalFaces
()
+
bFaceI
);
duplicateSet
.
insert
(
mesh
.
nInternalFaces
()
+
otherFaceI
);
}
}
Pout
<<
"Writing "
<<
duplicateSet
.
size
()
<<
" duplicate faces to faceSet "
<<
duplicateSet
.
objectPath
()
<<
nl
<<
endl
;
duplicateSet
.
write
();
}
return
duplicates
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
validOptions
.
insert
(
"split"
,
""
);
argList
::
validOptions
.
insert
(
"overwrite"
,
""
);
argList
::
validOptions
.
insert
(
"detectOnly"
,
""
);
# include "setRootCase.H"
# include "createTime.H"
runTime
.
functionObjects
().
off
();
...
...
@@ -165,6 +232,7 @@ int main(int argc, char *argv[])
bool
split
=
args
.
options
().
found
(
"split"
);
bool
overwrite
=
args
.
options
().
found
(
"overwrite"
);
bool
detectOnly
=
args
.
options
().
found
(
"detectOnly"
);
// Collect all boundary faces
labelList
boundaryFaces
(
mesh
.
nFaces
()
-
mesh
.
nInternalFaces
());
...
...
@@ -175,6 +243,15 @@ int main(int argc, char *argv[])
}
if
(
detectOnly
)
{
findBaffles
(
mesh
,
boundaryFaces
);
return
0
;
}
// Read objects in time directory
IOobjectList
objects
(
mesh
,
runTime
.
timeName
());
...
...
@@ -238,62 +315,7 @@ int main(int argc, char *argv[])
<<
nl
<<
endl
;
// Get all duplicate face labels (in boundaryFaces indices!).
labelList
duplicates
=
localPointRegion
::
findDuplicateFaces
(
mesh
,
boundaryFaces
);
// Check that none are on processor patches
const
polyBoundaryMesh
&
patches
=
mesh
.
boundaryMesh
();
forAll
(
duplicates
,
bFaceI
)
{
if
(
duplicates
[
bFaceI
]
!=
-
1
)
{
label
faceI
=
mesh
.
nInternalFaces
()
+
bFaceI
;
label
patchI
=
patches
.
whichPatch
(
faceI
);
if
(
isA
<
processorPolyPatch
>
(
patches
[
patchI
]))
{
FatalErrorIn
(
args
.
executable
())
<<
"Duplicate face "
<<
faceI
<<
" is on a processorPolyPatch."
<<
"This is not allowed."
<<
nl
<<
"Face:"
<<
faceI
<<
" is on patch:"
<<
patches
[
patchI
].
name
()
<<
abort
(
FatalError
);
}
}
}
// Write to faceSet for ease of postprocessing.
{
faceSet
duplicateSet
(
mesh
,
"duplicateFaces"
,
(
mesh
.
nFaces
()
-
mesh
.
nInternalFaces
())
/
256
);
forAll
(
duplicates
,
bFaceI
)
{
label
otherFaceI
=
duplicates
[
bFaceI
];
if
(
otherFaceI
!=
-
1
&&
otherFaceI
>
bFaceI
)
{
duplicateSet
.
insert
(
mesh
.
nInternalFaces
()
+
bFaceI
);
duplicateSet
.
insert
(
mesh
.
nInternalFaces
()
+
otherFaceI
);
}
}
Pout
<<
"Writing "
<<
duplicateSet
.
size
()
<<
" duplicate faces to faceSet "
<<
duplicateSet
.
objectPath
()
<<
nl
<<
endl
;
duplicateSet
.
write
();
}
labelList
duplicates
(
findBaffles
(
mesh
,
boundaryFaces
));
// Merge into internal faces.
insertDuplicateMerge
(
mesh
,
duplicates
,
meshMod
);
...
...
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