Skip to content
Snippets Groups Projects
Commit 81c36f61 authored by andy's avatar andy
Browse files

ENH: writeRegisteredFunctionObject - updated to use wordReList for object names

parent 67a49d12
Branches
Tags
No related merge requests found
......@@ -91,25 +91,14 @@ void Foam::writeRegisteredObject::write()
{
Info<< type() << " " << name_ << " output:" << nl;
DynamicList<word> allNames(obr_.toc().size());
forAll(objectNames_, i)
{
if (obr_.foundObject<regIOobject>(objectNames_[i]))
{
regIOobject& obj =
const_cast<regIOobject&>
(
obr_.lookupObject<regIOobject>(objectNames_[i])
);
if (exclusiveWriting_)
{
// Switch off automatic writing to prevent double write
obj.writeOpt() = IOobject::NO_WRITE;
}
Info<< " writing object " << obj.name() << nl << endl;
wordList names(obr_.names<regIOobject>(objectNames_[i]));
obj.write();
if (names.size())
{
allNames.append(names);
}
else
{
......@@ -119,6 +108,25 @@ void Foam::writeRegisteredObject::write()
<< endl;
}
}
forAll(allNames, i)
{
regIOobject& obj =
const_cast<regIOobject&>
(
obr_.lookupObject<regIOobject>(allNames[i])
);
if (exclusiveWriting_)
{
// Switch off automatic writing to prevent double write
obj.writeOpt() = IOobject::NO_WRITE;
}
Info<< " writing object " << obj.name() << nl << endl;
obj.write();
}
}
......
......@@ -74,7 +74,7 @@ SourceFiles
#ifndef writeRegisteredObject_H
#define writeRegisteredObject_H
#include "wordList.H"
#include "wordReList.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -110,7 +110,7 @@ protected:
// Read from dictionary
//- Names of objects to control
wordList objectNames_;
wordReList objectNames_;
// Private Member Functions
......
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