STYLE: writeEntry instead of writeKeyword + END

This commit is contained in:
Mark Olesen
2019-01-11 11:03:36 +01:00
parent dcb6969361
commit 6c419174e1
7 changed files with 12 additions and 21 deletions

View File

@ -506,10 +506,8 @@ Foam::tmp<Foam::labelField> Foam::processorFaPatch::internalFieldTransfer
void Foam::processorFaPatch::write(Ostream& os) const void Foam::processorFaPatch::write(Ostream& os) const
{ {
faPatch::write(os); faPatch::write(os);
os.writeKeyword("myProcNo") << myProcNo_ os.writeEntry("myProcNo", myProcNo_);
<< token::END_STATEMENT << nl; os.writeEntry("neighbProcNo", neighbProcNo_);
os.writeKeyword("neighbProcNo") << neighbProcNo_
<< token::END_STATEMENT << nl;
} }

View File

@ -467,13 +467,13 @@ void Foam::faPatch::resetEdges(const labelList& newEdges)
void Foam::faPatch::write(Ostream& os) const void Foam::faPatch::write(Ostream& os) const
{ {
os.writeKeyword("type") << type() << token::END_STATEMENT << nl; os.writeEntry("type", type());
patchIdentifier::write(os); patchIdentifier::write(os);
const labelList& edgeLabels = *this; const labelList& edgeLabels = *this;
edgeLabels.writeEntry("edgeLabels", os); edgeLabels.writeEntry("edgeLabels", os);
os.writeKeyword("ngbPolyPatchIndex") << ngbPolyPatchIndex_ os.writeEntry("ngbPolyPatchIndex", ngbPolyPatchIndex_);
<< token::END_STATEMENT << nl;
} }

View File

@ -68,7 +68,7 @@ Foam::inletOutletFaPatchField<Type>::inletOutletFaPatchField
) )
: :
mixedFaPatchField<Type>(p, iF), mixedFaPatchField<Type>(p, iF),
phiName_("phi") phiName_(dict.lookupOrDefault<word>("phi", "phi"))
{ {
this->refValue() = Field<Type>("inletValue", dict, p.size()); this->refValue() = Field<Type>("inletValue", dict, p.size());
@ -86,8 +86,6 @@ Foam::inletOutletFaPatchField<Type>::inletOutletFaPatchField
this->refGrad() = pTraits<Type>::zero; this->refGrad() = pTraits<Type>::zero;
this->valueFraction() = 0.0; this->valueFraction() = 0.0;
dict.readIfPresent("phi", phiName_);
} }
@ -140,11 +138,7 @@ template<class Type>
void Foam::inletOutletFaPatchField<Type>::write(Ostream& os) const void Foam::inletOutletFaPatchField<Type>::write(Ostream& os) const
{ {
faPatchField<Type>::write(os); faPatchField<Type>::write(os);
if (phiName_ != "phi") os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
{
os.writeKeyword("phi")
<< phiName_ << token::END_STATEMENT << nl;
}
this->refValue().writeEntry("inletValue", os); this->refValue().writeEntry("inletValue", os);
this->writeEntry("value", os); this->writeEntry("value", os);
} }

View File

@ -199,7 +199,7 @@ void Foam::faPatchField<Type>::evaluate(const Pstream::commsTypes)
template<class Type> template<class Type>
void Foam::faPatchField<Type>::write(Ostream& os) const void Foam::faPatchField<Type>::write(Ostream& os) const
{ {
os.writeKeyword("type") << type() << token::END_STATEMENT << nl; os.writeEntry("type", type());
} }

View File

@ -169,7 +169,7 @@ void Foam::faePatchField<Type>::rmap
template<class Type> template<class Type>
void Foam::faePatchField<Type>::write(Ostream& os) const void Foam::faePatchField<Type>::write(Ostream& os) const
{ {
os.writeKeyword("type") << type() << token::END_STATEMENT << nl; os.writeEntry("type", type());
} }

View File

@ -334,8 +334,8 @@ void Foam::PatchFunction1Types::Sampled<Type>::writeData
) const ) const
{ {
PatchFunction1<Type>::writeData(os); PatchFunction1<Type>::writeData(os);
os.writeKeyword(this->name()) << type();
os << token::END_STATEMENT << nl; os.writeEntry(this->name(), type());
mappedPatchBase::write(os); mappedPatchBase::write(os);

View File

@ -602,8 +602,7 @@ void Foam::PatchFunction1Types::MappedFile<Type>::writeData
// bc) // bc)
if (dictConstructed_) if (dictConstructed_)
{ {
os.writeKeyword(this->name()) << type(); os.writeEntry(this->name(), type());
os << token::END_STATEMENT << nl;
os.writeEntryIfDifferent os.writeEntryIfDifferent
( (