diff --git a/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C b/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C index c4e5d83ae0..41bdb7b94b 100644 --- a/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C +++ b/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C @@ -506,10 +506,8 @@ Foam::tmp Foam::processorFaPatch::internalFieldTransfer void Foam::processorFaPatch::write(Ostream& os) const { faPatch::write(os); - os.writeKeyword("myProcNo") << myProcNo_ - << token::END_STATEMENT << nl; - os.writeKeyword("neighbProcNo") << neighbProcNo_ - << token::END_STATEMENT << nl; + os.writeEntry("myProcNo", myProcNo_); + os.writeEntry("neighbProcNo", neighbProcNo_); } diff --git a/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C b/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C index 33900b98ac..b0f1692721 100644 --- a/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C +++ b/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C @@ -467,13 +467,13 @@ void Foam::faPatch::resetEdges(const labelList& newEdges) void Foam::faPatch::write(Ostream& os) const { - os.writeKeyword("type") << type() << token::END_STATEMENT << nl; + os.writeEntry("type", type()); + patchIdentifier::write(os); const labelList& edgeLabels = *this; edgeLabels.writeEntry("edgeLabels", os); - os.writeKeyword("ngbPolyPatchIndex") << ngbPolyPatchIndex_ - << token::END_STATEMENT << nl; + os.writeEntry("ngbPolyPatchIndex", ngbPolyPatchIndex_); } diff --git a/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.C b/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.C index f05745ca68..2f8404f730 100644 --- a/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.C +++ b/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.C @@ -68,7 +68,7 @@ Foam::inletOutletFaPatchField::inletOutletFaPatchField ) : mixedFaPatchField(p, iF), - phiName_("phi") + phiName_(dict.lookupOrDefault("phi", "phi")) { this->refValue() = Field("inletValue", dict, p.size()); @@ -86,8 +86,6 @@ Foam::inletOutletFaPatchField::inletOutletFaPatchField this->refGrad() = pTraits::zero; this->valueFraction() = 0.0; - - dict.readIfPresent("phi", phiName_); } @@ -140,11 +138,7 @@ template void Foam::inletOutletFaPatchField::write(Ostream& os) const { faPatchField::write(os); - if (phiName_ != "phi") - { - os.writeKeyword("phi") - << phiName_ << token::END_STATEMENT << nl; - } + os.writeEntryIfDifferent("phi", "phi", phiName_); this->refValue().writeEntry("inletValue", os); this->writeEntry("value", os); } diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.C b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.C index eb71ad8d4b..436845ca36 100644 --- a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.C +++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.C @@ -199,7 +199,7 @@ void Foam::faPatchField::evaluate(const Pstream::commsTypes) template void Foam::faPatchField::write(Ostream& os) const { - os.writeKeyword("type") << type() << token::END_STATEMENT << nl; + os.writeEntry("type", type()); } diff --git a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.C b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.C index 08408db544..a77a568707 100644 --- a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.C +++ b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.C @@ -169,7 +169,7 @@ void Foam::faePatchField::rmap template void Foam::faePatchField::write(Ostream& os) const { - os.writeKeyword("type") << type() << token::END_STATEMENT << nl; + os.writeEntry("type", type()); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/Sampled/Sampled.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/Sampled/Sampled.C index 130337d0c8..32dfbe4163 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/Sampled/Sampled.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/Sampled/Sampled.C @@ -334,8 +334,8 @@ void Foam::PatchFunction1Types::Sampled::writeData ) const { PatchFunction1::writeData(os); - os.writeKeyword(this->name()) << type(); - os << token::END_STATEMENT << nl; + + os.writeEntry(this->name(), type()); mappedPatchBase::write(os); diff --git a/src/meshTools/PatchFunction1/MappedFile/MappedFile.C b/src/meshTools/PatchFunction1/MappedFile/MappedFile.C index 6a283a329e..ab9ac1aceb 100644 --- a/src/meshTools/PatchFunction1/MappedFile/MappedFile.C +++ b/src/meshTools/PatchFunction1/MappedFile/MappedFile.C @@ -602,8 +602,7 @@ void Foam::PatchFunction1Types::MappedFile::writeData // bc) if (dictConstructed_) { - os.writeKeyword(this->name()) << type(); - os << token::END_STATEMENT << nl; + os.writeEntry(this->name(), type()); os.writeEntryIfDifferent (