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,14 +91,30 @@ 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())
|
||||||
|
{
|
||||||
|
allNames.append(names);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WarningIn("Foam::writeRegisteredObject::write()")
|
||||||
|
<< "Object " << objectNames_[i] << " not found in "
|
||||||
|
<< "database. Available objects:" << nl << obr_.sortedToc()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(allNames, i)
|
||||||
{
|
{
|
||||||
regIOobject& obj =
|
regIOobject& obj =
|
||||||
const_cast<regIOobject&>
|
const_cast<regIOobject&>
|
||||||
(
|
(
|
||||||
obr_.lookupObject<regIOobject>(objectNames_[i])
|
obr_.lookupObject<regIOobject>(allNames[i])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (exclusiveWriting_)
|
if (exclusiveWriting_)
|
||||||
@ -111,14 +127,6 @@ void Foam::writeRegisteredObject::write()
|
|||||||
|
|
||||||
obj.write();
|
obj.write();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
WarningIn("Foam::writeRegisteredObject::write()")
|
|
||||||
<< "Object " << objectNames_[i] << " not found in "
|
|
||||||
<< "database. Available objects:" << nl << obr_.sortedToc()
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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