Commit 99eee3c0 authored by andy's avatar andy
Browse files

ENH: Better handling for regExp usage in sampledSurfaces

parent 2ba1b4d4
......@@ -168,18 +168,32 @@ void Foam::sampledSurfaces::sampleAndWrite
template<class GeoField>
void Foam::sampledSurfaces::sampleAndWrite(const IOobjectList& objects)
{
wordList names;
if (loadFromFiles_)
{
IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
names = fieldObjects.names();
}
else
{
names = mesh_.thisDb().names<GeoField>();
}
labelList nameIDs(findStrings(fieldSelection_, names));
wordList names(fieldObjects.names());
wordHashSet fieldNames(wordList(names, nameIDs));
labelList fieldNames(findStrings(fieldSelection_, names));
forAllConstIter(wordHashSet, fieldNames, iter)
{
const word& fieldName = iter.key();
forAll(fieldNames, fieldI)
if ((Pstream::master()) && verbose_)
{
const word& fieldName = names[fieldNames[fieldI]];
Pout<< "sampleAndWrite: " << fieldName << endl;
}
if (loadFromFiles_)
{
const GeoField fld
(
IOobject
......@@ -192,30 +206,10 @@ void Foam::sampledSurfaces::sampleAndWrite(const IOobjectList& objects)
mesh_
);
if ((Pstream::master()) && verbose_)
{
Pout<< "sampleAndWrite: " << fieldName << endl;
}
sampleAndWrite(fld);
}
}
else
{
const wordList fieldNames
(
mesh_.thisDb().names<GeoField>(fieldSelection_)
);
forAll(fieldNames, i)
else
{
const word& fieldName = fieldNames[i];
if ((Pstream::master()) && verbose_)
{
Pout<< "sampleAndWrite: " << fieldName << endl;
}
sampleAndWrite
(
mesh_.thisDb().lookupObject<GeoField>(fieldName)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment