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
b5ee8b6d
Commit
b5ee8b6d
authored
Oct 28, 2008
by
mattijs
Browse files
detect only option
parent
6520f35f
Changes
1
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C
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
);
...
...
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