Skip to content
Snippets Groups Projects
Commit f6ba88b3 authored by Andrew Heather's avatar Andrew Heather
Browse files

using neater writeEntryIfDifferent syntax

parent bd7ace5b
No related branches found
No related tags found
No related merge requests found
...@@ -136,7 +136,7 @@ void buoyantPressureFvPatchScalarField::updateCoeffs() ...@@ -136,7 +136,7 @@ void buoyantPressureFvPatchScalarField::updateCoeffs()
void buoyantPressureFvPatchScalarField::write(Ostream& os) const void buoyantPressureFvPatchScalarField::write(Ostream& os) const
{ {
fixedGradientFvPatchScalarField::write(os); fixedGradientFvPatchScalarField::write(os);
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntry("value", os); writeEntry("value", os);
} }
......
...@@ -159,14 +159,8 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const ...@@ -159,14 +159,8 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchField<vector>::write(os); fvPatchField<vector>::write(os);
os.writeKeyword("flowRate") << flowRate_ << token::END_STATEMENT << nl; os.writeKeyword("flowRate") << flowRate_ << token::END_STATEMENT << nl;
if (phiName_ != "phi") writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
{ writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (rhoName_ != "rho")
{
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
}
writeEntry("value", os); writeEntry("value", os);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment