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
{
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_);
}

View File

@ -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_);
}

View File

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

View File

@ -199,7 +199,7 @@ void Foam::faPatchField<Type>::evaluate(const Pstream::commsTypes)
template<class Type>
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>
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
{
PatchFunction1<Type>::writeData(os);
os.writeKeyword(this->name()) << type();
os << token::END_STATEMENT << nl;
os.writeEntry(this->name(), type());
mappedPatchBase::write(os);

View File

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