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
b056202e
Commit
b056202e
authored
Aug 02, 2018
by
Mark OLESEN
Browse files
STYLE: simplify bitSet use in Foam::PatchTools::subsetMap
parent
bafddd77
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsSearch.C
View file @
b056202e
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2017
-2018
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -166,40 +166,30 @@ Foam::PatchTools::subsetMap
labelList
&
faceMap
)
{
label
facei
=
0
;
label
pointi
=
0
;
const
List
<
Face
>&
localFaces
=
p
.
localFaces
();
faceMap
.
setS
ize
(
localFaces
.
size
());
pointMap
.
setSize
(
p
.
nPoints
()
);
faceMap
.
res
ize
(
localFaces
.
size
());
pointMap
.
clear
(
);
bitSet
point
Had
(
pointMap
.
size
(),
false
);
bitSet
point
Used
(
p
.
nPoints
()
);
forAll
(
p
,
oldFacei
)
label
facei
=
0
;
forAll
(
localFaces
,
oldFacei
)
{
if
(
includeFaces
[
oldFacei
])
{
//
Store
new faces
compact
//
Compact storage for
new faces
faceMap
[
facei
++
]
=
oldFacei
;
// Renumber labels for face
const
Face
&
f
=
localFaces
[
oldFacei
];
forAll
(
f
,
fp
)
{
const
label
ptLabel
=
f
[
fp
];
if
(
pointHad
.
set
(
ptLabel
))
{
pointMap
[
pointi
++
]
=
ptLabel
;
}
}
// Local points used by face
pointUsed
.
set
(
localFaces
[
oldFacei
]);
}
}
// T
rim
faceMap
.
setS
ize
(
facei
);
pointMap
.
setSize
(
pointi
);
// T
he newToOld mappings
faceMap
.
res
ize
(
facei
);
pointMap
=
pointUsed
.
sortedToc
(
);
}
...
...
@@ -221,19 +211,16 @@ void Foam::PatchTools::calcBounds
// ourselves
const
PointField
&
points
=
p
.
points
();
bitSet
point
Is
Used
(
points
.
size
());
bitSet
pointUsed
(
points
.
size
());
nPoints
=
0
;
bb
=
boundBox
::
invertedBox
;
for
All
(
p
,
facei
)
for
(
const
Face
&
f
:
p
)
{
const
Face
&
f
=
p
[
facei
];
forAll
(
f
,
fp
)
for
(
const
label
pointi
:
f
)
{
label
pointi
=
f
[
fp
];
if
(
pointIsUsed
.
set
(
pointi
))
if
(
pointUsed
.
set
(
pointi
))
{
bb
.
add
(
points
[
pointi
]);
++
nPoints
;
...
...
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