mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use HashSet xor instead of two operations (faceZoneSet)
STYLE: use global operator instead of HashSet -= operator
This commit is contained in:
@ -166,8 +166,7 @@ int main(int argc, char *argv[])
|
|||||||
if (args.found("writeFields"))
|
if (args.found("writeFields"))
|
||||||
{
|
{
|
||||||
selectedFields = args.getList<word>("writeFields");
|
selectedFields = args.getList<word>("writeFields");
|
||||||
wordHashSet badFields(selectedFields);
|
const wordHashSet badFields(selectedFields - allFields);
|
||||||
badFields -= allFields;
|
|
||||||
|
|
||||||
if (!badFields.empty())
|
if (!badFields.empty())
|
||||||
{
|
{
|
||||||
@ -229,7 +228,7 @@ int main(int argc, char *argv[])
|
|||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -320,17 +320,11 @@ void Foam::faceZoneSet::sync(const polyMesh& mesh)
|
|||||||
{
|
{
|
||||||
const labelHashSet zoneSet(addressing_);
|
const labelHashSet zoneSet(addressing_);
|
||||||
|
|
||||||
// Get elements that are in zone but not faceSet
|
// Elements that are in zone but not faceSet, and
|
||||||
labelHashSet badSet(zoneSet);
|
// elements that are in faceSet but not in zone
|
||||||
badSet -= *this;
|
labelHashSet badSet(*this ^ zoneSet);
|
||||||
|
|
||||||
// Add elements that are in faceSet but not in zone
|
const label nBad = returnReduce(badSet.size(), sumOp<label>());
|
||||||
labelHashSet fSet(*this);
|
|
||||||
fSet -= zoneSet;
|
|
||||||
|
|
||||||
badSet += fSet;
|
|
||||||
|
|
||||||
label nBad = returnReduce(badSet.size(), sumOp<label>());
|
|
||||||
|
|
||||||
if (nBad)
|
if (nBad)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user