mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: Multiple changes - first clean build after latest merge - UNTESTED
This commit is contained in:
@ -69,7 +69,7 @@ void Foam::functionObjects::fieldAverage::initialize()
|
||||
{
|
||||
resetFields();
|
||||
|
||||
Log << type() << " " << name_ << ":" << nl;
|
||||
Log << type() << " " << name() << ":" << nl;
|
||||
|
||||
// Add mean fields to the field lists
|
||||
forAll(faItems_, fieldi)
|
||||
@ -187,7 +187,7 @@ void Foam::functionObjects::fieldAverage::writeAverages() const
|
||||
}
|
||||
|
||||
|
||||
void Foam::fieldAverage::writeAveragingProperties()
|
||||
void Foam::functionObjects::fieldAverage::writeAveragingProperties()
|
||||
{
|
||||
forAll(faItems_, fieldi)
|
||||
{
|
||||
|
||||
@ -55,6 +55,7 @@ const Foam::NamedEnum
|
||||
|
||||
Foam::functionObjects::fieldAverageItem::fieldAverageItem()
|
||||
:
|
||||
active_(false),
|
||||
fieldName_("unknown"),
|
||||
mean_(0),
|
||||
meanFieldName_("unknown"),
|
||||
@ -71,6 +72,7 @@ Foam::functionObjects::fieldAverageItem::fieldAverageItem
|
||||
const fieldAverageItem& faItem
|
||||
)
|
||||
:
|
||||
active_(faItem.active_),
|
||||
fieldName_(faItem.fieldName_),
|
||||
mean_(faItem.mean_),
|
||||
meanFieldName_(faItem.meanFieldName_),
|
||||
@ -104,6 +106,7 @@ void Foam::functionObjects::fieldAverageItem::operator=
|
||||
}
|
||||
|
||||
// Set updated values
|
||||
active_ = rhs.active_;
|
||||
fieldName_ = rhs.fieldName_;
|
||||
mean_ = rhs.mean_;
|
||||
meanFieldName_ = rhs.meanFieldName_;
|
||||
|
||||
@ -100,17 +100,20 @@ private:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Active flag
|
||||
bool active_;
|
||||
|
||||
//- Field name
|
||||
word fieldName_;
|
||||
|
||||
//- Compute mean flag
|
||||
Switch mean_;
|
||||
bool mean_;
|
||||
|
||||
//- Name of mean field
|
||||
word meanFieldName_;
|
||||
|
||||
//- Compute prime-squared mean flag
|
||||
Switch prime2Mean_;
|
||||
bool prime2Mean_;
|
||||
|
||||
//- Name of prime-squared mean field
|
||||
word prime2MeanFieldName_;
|
||||
@ -150,6 +153,18 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Return const access to the active flag
|
||||
bool active() const
|
||||
{
|
||||
return active_;
|
||||
}
|
||||
|
||||
//- Return non-const access to the active flag
|
||||
bool& active()
|
||||
{
|
||||
return active_;
|
||||
}
|
||||
|
||||
//- Return const access to the field name
|
||||
const word& fieldName() const
|
||||
{
|
||||
@ -157,13 +172,13 @@ public:
|
||||
}
|
||||
|
||||
//- Return const access to the mean flag
|
||||
const Switch& mean() const
|
||||
bool mean() const
|
||||
{
|
||||
return mean_;
|
||||
}
|
||||
|
||||
//- Return non-const access to the mean flag
|
||||
Switch& mean()
|
||||
bool& mean()
|
||||
{
|
||||
return mean_;
|
||||
}
|
||||
@ -175,13 +190,13 @@ public:
|
||||
}
|
||||
|
||||
//- Return const access to the prime-squared mean flag
|
||||
const Switch& prime2Mean() const
|
||||
bool prime2Mean() const
|
||||
{
|
||||
return prime2Mean_;
|
||||
}
|
||||
|
||||
//- Return non-const access to the prime-squared mean flag
|
||||
Switch& prime2Mean()
|
||||
bool& prime2Mean()
|
||||
{
|
||||
return prime2Mean_;
|
||||
}
|
||||
@ -199,13 +214,13 @@ public:
|
||||
}
|
||||
|
||||
//- Return true if base is ITER
|
||||
Switch iterBase() const
|
||||
bool iterBase() const
|
||||
{
|
||||
return base_ == ITER;
|
||||
}
|
||||
|
||||
//- Return true if base is time
|
||||
Switch timeBase() const
|
||||
bool timeBase() const
|
||||
{
|
||||
return base_ == TIME;
|
||||
}
|
||||
@ -235,7 +250,8 @@ public:
|
||||
)
|
||||
{
|
||||
return
|
||||
a.fieldName_ == b.fieldName_
|
||||
a.active_ == b.active_
|
||||
&& a.fieldName_ == b.fieldName_
|
||||
&& a.mean_ == b.mean_
|
||||
&& a.meanFieldName_ == b.meanFieldName_
|
||||
&& a.prime2Mean_ == b.prime2Mean_
|
||||
|
||||
@ -31,6 +31,7 @@ License
|
||||
|
||||
Foam::functionObjects::fieldAverageItem::fieldAverageItem(Istream& is)
|
||||
:
|
||||
active_(false),
|
||||
fieldName_("unknown"),
|
||||
mean_(0),
|
||||
meanFieldName_("unknown"),
|
||||
@ -48,8 +49,8 @@ Foam::functionObjects::fieldAverageItem::fieldAverageItem(Istream& is)
|
||||
const dictionaryEntry entry(dictionary::null, is);
|
||||
|
||||
fieldName_ = entry.keyword();
|
||||
entry.lookup("mean") >> mean_;
|
||||
entry.lookup("prime2Mean") >> prime2Mean_;
|
||||
mean_ = readBool(entry.lookup("mean"));
|
||||
prime2Mean_ = readBool(entry.lookup("prime2Mean"));
|
||||
base_ = baseTypeNames_[entry.lookup("base")];
|
||||
window_ = entry.lookupOrDefault<scalar>("window", -1.0);
|
||||
windowName_ = entry.lookupOrDefault<word>("windowName", "");
|
||||
@ -80,9 +81,10 @@ Foam::Istream& Foam::functionObjects::operator>>
|
||||
|
||||
const dictionaryEntry entry(dictionary::null, is);
|
||||
|
||||
faItem.active_ = false;
|
||||
faItem.fieldName_ = entry.keyword();
|
||||
entry.lookup("mean") >> faItem.mean_;
|
||||
entry.lookup("prime2Mean") >> faItem.prime2Mean_;
|
||||
faItem.mean_ = readBool(entry.lookup("mean"));
|
||||
faItem.prime2Mean_ = readBool(entry.lookup("prime2Mean"));
|
||||
faItem.base_ = faItem.baseTypeNames_[entry.lookup("base")];
|
||||
faItem.window_ = entry.lookupOrDefault<scalar>("window", -1.0);
|
||||
faItem.windowName_ = entry.lookupOrDefault<word>("windowName", "");
|
||||
|
||||
@ -33,6 +33,9 @@ License
|
||||
template<class Type>
|
||||
void Foam::functionObjects::fieldAverage::addMeanFieldType(const label fieldi)
|
||||
{
|
||||
// Field has been found, so set active flag to true
|
||||
faItems_[fieldi].active() = true;
|
||||
|
||||
const word& fieldName = faItems_[fieldi].fieldName();
|
||||
const word& meanFieldName = faItems_[fieldi].meanFieldName();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user