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

@ -310,6 +310,12 @@ bool Foam::functionObjects::fieldAverage::read(const dictionary& dict)
dict.readIfPresent("periodicRestart", periodicRestart_);
dict.readEntry("fields", faItems_);
for (auto& item : faItems_)
{
item.setMeanFieldName(scopedName(item.meanFieldName()));
item.setPrime2MeanFieldName(scopedName(item.prime2MeanFieldName()));
}
const scalar currentTime = obr().time().value();
if (periodicRestart_)

View File

@ -236,6 +236,9 @@ public:
//- Return const access to the mean field name
inline const word& meanFieldName() const;
//- Set the mean field name
inline void setMeanFieldName(const word& name);
//- Return const access to the prime-squared mean flag
inline bool prime2Mean() const;
@ -245,6 +248,9 @@ public:
//- Return const access to the prime-squared mean field name
inline const word& prime2MeanFieldName() const;
//- Set the prime-squared mean field name
inline void setPrime2MeanFieldName(const word& name);
//- Return averaging base type name
inline const word& base() const;

View File

@ -64,6 +64,15 @@ Foam::functionObjects::fieldAverageItem::meanFieldName() const
}
void Foam::functionObjects::fieldAverageItem::setMeanFieldName
(
const word& name
)
{
meanFieldName_ = name;
}
bool Foam::functionObjects::fieldAverageItem::prime2Mean() const
{
return prime2Mean_;
@ -76,12 +85,22 @@ bool& Foam::functionObjects::fieldAverageItem::prime2Mean()
}
const Foam::word& Foam::functionObjects::fieldAverageItem::prime2MeanFieldName() const
const Foam::word&
Foam::functionObjects::fieldAverageItem::prime2MeanFieldName() const
{
return prime2MeanFieldName_;
}
void Foam::functionObjects::fieldAverageItem::setPrime2MeanFieldName
(
const word& name
)
{
prime2MeanFieldName_ = name;
}
const Foam::word& Foam::functionObjects::fieldAverageItem::base() const
{
return baseTypeNames_[base_];