ENH: function objects - apply scoped name when registering objects

This commit is contained in:
Andrew Heather
2021-11-19 11:30:08 +00:00
committed by Mark Olesen
parent 9194cd5203
commit c233961d45
23 changed files with 116 additions and 69 deletions

View File

@ -48,15 +48,25 @@ Foam::word Foam::functionObject::outputPrefix("postProcessing");
Foam::word Foam::functionObject::scopedName(const word& name) const
{
return name_ + ":" + name;
if (scopedNames_)
{
return IOobject::scopedName(name_, name);
}
return name_;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObject::functionObject(const word& name)
Foam::functionObject::functionObject
(
const word& name,
const bool scopedNames
)
:
name_(name),
scopedNames_(scopedNames),
log(postProcess)
{}
@ -128,16 +138,23 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::word& Foam::functionObject::name() const
const Foam::word& Foam::functionObject::name() const noexcept
{
return name_;
}
bool Foam::functionObject::scopedNames() const noexcept
{
return scopedNames_;
}
bool Foam::functionObject::read(const dictionary& dict)
{
if (!postProcess)
{
scopedNames_ = dict.getOrDefault("scopedNames", true);
log = dict.getOrDefault("log", true);
}