using neater writeEntryIfDifferent syntax

This commit is contained in:
andy
2009-08-03 15:29:14 +01:00
parent bd7ace5b2e
commit f6ba88b32c
2 changed files with 3 additions and 9 deletions

View File

@ -136,7 +136,7 @@ void buoyantPressureFvPatchScalarField::updateCoeffs()
void buoyantPressureFvPatchScalarField::write(Ostream& os) const
{
fixedGradientFvPatchScalarField::write(os);
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntry("value", os);
}

View File

@ -159,14 +159,8 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchField<vector>::write(os);
os.writeKeyword("flowRate") << flowRate_ << token::END_STATEMENT << nl;
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (rhoName_ != "rho")
{
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
}
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntry("value", os);
}