mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: writeRegisteredFunctionObject - updated to use wordReList for object names
This commit is contained in:
@ -91,25 +91,14 @@ void Foam::writeRegisteredObject::write()
|
|||||||
{
|
{
|
||||||
Info<< type() << " " << name_ << " output:" << nl;
|
Info<< type() << " " << name_ << " output:" << nl;
|
||||||
|
|
||||||
|
DynamicList<word> allNames(obr_.toc().size());
|
||||||
forAll(objectNames_, i)
|
forAll(objectNames_, i)
|
||||||
{
|
{
|
||||||
if (obr_.foundObject<regIOobject>(objectNames_[i]))
|
wordList names(obr_.names<regIOobject>(objectNames_[i]));
|
||||||
|
|
||||||
|
if (names.size())
|
||||||
{
|
{
|
||||||
regIOobject& obj =
|
allNames.append(names);
|
||||||
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;
|
|
||||||
|
|
||||||
obj.write();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -119,6 +108,25 @@ void Foam::writeRegisteredObject::write()
|
|||||||
<< endl;
|
<< 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
|
#ifndef writeRegisteredObject_H
|
||||||
#define writeRegisteredObject_H
|
#define writeRegisteredObject_H
|
||||||
|
|
||||||
#include "wordList.H"
|
#include "wordReList.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -110,7 +110,7 @@ protected:
|
|||||||
// Read from dictionary
|
// Read from dictionary
|
||||||
|
|
||||||
//- Names of objects to control
|
//- Names of objects to control
|
||||||
wordList objectNames_;
|
wordReList objectNames_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|||||||
Reference in New Issue
Block a user