ENH: use sorted order for fieldSelection::selectionNames() (#2819)

- return a sorted wordList instead of a wordHashSet to ensure that
  fields will be processed in consistent order in parallel
This commit is contained in:
Mark Olesen
2023-07-06 13:05:34 +02:00
parent ed314b2740
commit dc95242cd2
12 changed files with 140 additions and 128 deletions

View File

@ -157,11 +157,13 @@ bool Foam::functionObjects::limitFields::execute()
{
fieldSet_.updateSelection();
Log << type() << " " << name() << ":" << nl;
Log << type() << ' ' << name() << ':' << nl;
label count = 0, total = 0;
label count = 0;
for (const word& fieldName : fieldSet_.selectionNames())
{
++total;
if
(
limitScalarField(fieldName)
@ -177,8 +179,7 @@ bool Foam::functionObjects::limitFields::execute()
if (debug)
{
Log << " - limited " << count << '/'
<< fieldSet_.selectionNames().size() << " fields";
Log << " - limited " << count << '/' << total << " fields";
}
Log << endl;