ENH: emit "constant" for uniform constant field (#1269)

- this improves overall consistency and makes re-reading as a generic
  patch field behave properly when the underlying patch has zero size.
This commit is contained in:
Mark Olesen 2019-04-04 16:23:41 +02:00 committed by Andrew Heather
parent c53459d4a2
commit 332cf3345a

View File

@ -253,8 +253,17 @@ void Foam::PatchFunction1Types::ConstantField<Type>::writeData
) const
{
PatchFunction1<Type>::writeData(os);
//os << token::SPACE << value_ << token::END_STATEMENT << nl;
value_.writeEntry(this->name_, os);
if (isUniform_)
{
os.writeKeyword(this->name_)
<< "constant " << uniformValue_
<< token::END_STATEMENT << nl;
}
else
{
value_.writeEntry(this->name_, os);
}
}