Commit d4f73877 authored by mattijs's avatar mattijs
Browse files

ENH: have field selection work for pointFields instead of just volFields.

parent 33f36f68
......@@ -260,11 +260,31 @@ int main(int argc, char *argv[])
procMeshes.boundaryProcAddressing()
);
pointReconstructor.reconstructFields<scalar>(objects);
pointReconstructor.reconstructFields<vector>(objects);
pointReconstructor.reconstructFields<sphericalTensor>(objects);
pointReconstructor.reconstructFields<symmTensor>(objects);
pointReconstructor.reconstructFields<tensor>(objects);
pointReconstructor.reconstructFields<scalar>
(
objects,
selectedFields
);
pointReconstructor.reconstructFields<vector>
(
objects,
selectedFields
);
pointReconstructor.reconstructFields<sphericalTensor>
(
objects,
selectedFields
);
pointReconstructor.reconstructFields<symmTensor>
(
objects,
selectedFields
);
pointReconstructor.reconstructFields<tensor>
(
objects,
selectedFields
);
}
else
{
......
......@@ -138,7 +138,11 @@ public:
//- Reconstruct and write all fields
template<class Type>
void reconstructFields(const IOobjectList& objects);
void reconstructFields
(
const IOobjectList& objects,
const HashSet<word>& selectedFields
);
};
......
......@@ -143,7 +143,8 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
template<class Type>
void Foam::pointFieldReconstructor::reconstructFields
(
const IOobjectList& objects
const IOobjectList& objects,
const HashSet<word>& selectedFields
)
{
word fieldClassName
......@@ -157,16 +158,18 @@ void Foam::pointFieldReconstructor::reconstructFields
{
Info<< " Reconstructing " << fieldClassName << "s\n" << endl;
for
(
IOobjectList::iterator fieldIter = fields.begin();
fieldIter != fields.end();
++fieldIter
)
forAllConstIter(IOobjectList, fields, fieldIter)
{
Info<< " " << fieldIter()->name() << endl;
if
(
!selectedFields.size()
|| selectedFields.found(fieldIter()->name())
)
{
Info<< " " << fieldIter()->name() << endl;
reconstructField<Type>(*fieldIter())().write();
reconstructField<Type>(*fieldIter())().write();
}
}
Info<< endl;
......
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