Commit 3382bd82 authored by andy's avatar andy
Browse files

ENH: Updated sampledSurfaces output

parent 56df414d
......@@ -27,6 +27,7 @@ License
#include "volFields.H"
#include "surfaceFields.H"
#include "ListListOps.H"
#include "stringListOps.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
......@@ -146,7 +147,6 @@ void Foam::sampledSurfaces::sampleAndWrite
}
template<class Type>
void Foam::sampledSurfaces::sampleAndWrite
(
......@@ -172,61 +172,54 @@ void Foam::sampledSurfaces::sampleAndWrite(const IOobjectList& objects)
{
IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
forAll(fieldSelection_, fieldI)
{
const wordRe fieldNameRe = fieldSelection_[fieldI];
IOobjectList fieldIO = fieldObjects.lookupRe(fieldNameRe);
wordList names(fieldObjects.names());
forAllConstIter(IOobjectList, fieldIO, iter)
{
const word& fieldName = iter()->name();
labelList fieldNames(findStrings(fieldSelection_, names));
const GeoField fld
(
IOobject
(
fieldName,
mesh_.time().timeName(),
mesh_,
IOobject::MUST_READ
),
mesh_
);
forAll(fieldNames, fieldI)
{
const word& fieldName = names[fieldNames[fieldI]];
if ((Pstream::master()) && verbose_)
{
Pout<< "sampleAndWrite: " << fieldName << endl;
}
const GeoField fld
(
IOobject
(
fieldName,
mesh_.time().timeName(),
mesh_,
IOobject::MUST_READ
),
mesh_
);
sampleAndWrite(fld);
if ((Pstream::master()) && verbose_)
{
Pout<< "sampleAndWrite: " << fieldName << endl;
}
sampleAndWrite(fld);
}
}
else
{
forAll(fieldSelection_, fieldI)
{
const wordRe& fieldNameRe = fieldSelection_[fieldI];
const wordList fieldNames
(
mesh_.thisDb().names<GeoField>(fieldSelection_)
);
const wordList dbFields
(
mesh_.thisDb().foundObjectRe<GeoField>(fieldNameRe)
);
forAll(fieldNames, i)
{
const word& fieldName = fieldNames[i];
forAll(dbFields, i)
if ((Pstream::master()) && verbose_)
{
const word& fieldName = dbFields[i];
if ((Pstream::master()) && verbose_)
{
Pout<< "sampleAndWrite: " << fieldName << endl;
}
sampleAndWrite
(
mesh_.thisDb().lookupObject<GeoField>(fieldName)
);
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