mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: function objects - apply scoped name when registering objects
This commit is contained in:
committed by
Mark Olesen
parent
9194cd5203
commit
c233961d45
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user