writeEntry: Rationalised for consistency, ease of use and maintainability

The writeEntry form is now defined and used consistently throughout OpenFOAM
making it easier to use and extend, particularly to support binary IO of complex
dictionary entries.
This commit is contained in:
Henry Weller
2019-03-14 20:54:10 +00:00
parent c1d0fa6cac
commit d41166187a
246 changed files with 1009 additions and 971 deletions

View File

@ -204,7 +204,6 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
}
// Write
void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
@ -214,10 +213,10 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_);
Foam::writeEntry(os, "accommodationCoeff", accommodationCoeff_);
Twall_.writeEntry("Twall", os);
Foam::writeEntry(os, "gamma", gamma_);
writeEntry("value", os);
writeEntry(os, "accommodationCoeff", accommodationCoeff_);
writeEntry(os, "Twall", Twall_);
writeEntry(os, "gamma", gamma_);
writeEntry(os, "value", *this);
}

View File

@ -206,15 +206,15 @@ void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_);
writeEntryIfDifferent<word>(os, "tauMC", "tauMC", tauMCName_);
Foam::writeEntry(os, "accommodationCoeff", accommodationCoeff_);
Uwall_.writeEntry("Uwall", os);
Foam::writeEntry(os, "thermalCreep", thermalCreep_);
Foam::writeEntry(os, "curvature", curvature_);
writeEntry(os, "accommodationCoeff", accommodationCoeff_);
writeEntry(os, "Uwall", Uwall_);
writeEntry(os, "thermalCreep", thermalCreep_);
writeEntry(os, "curvature", curvature_);
refValue().writeEntry("refValue", os);
valueFraction().writeEntry("valueFraction", os);
writeEntry(os, "refValue", refValue());
writeEntry(os, "valueFraction", valueFraction());
writeEntry("value", os);
writeEntry(os, "value", *this);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -188,8 +188,8 @@ template<class Type>
void Foam::mixedFixedValueSlipFvPatchField<Type>::write(Ostream& os) const
{
transformFvPatchField<Type>::write(os);
refValue_.writeEntry("refValue", os);
valueFraction_.writeEntry("valueFraction", os);
writeEntry(os, "refValue", refValue_);
writeEntry(os, "valueFraction", valueFraction_);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -119,7 +119,7 @@ void Foam::fixedRhoFvPatchScalarField::write(Ostream& os) const
writeEntryIfDifferent<word>(os, "p", "p", this->pName_);
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
writeEntry("value", os);
writeEntry(os, "value", *this);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -108,7 +108,7 @@ void Foam::adjointOutletPressureFvPatchScalarField::updateCoeffs()
void Foam::adjointOutletPressureFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
writeEntry("value", os);
writeEntry(os, "value", *this);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -109,7 +109,7 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs()
void Foam::adjointOutletVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
writeEntry("value", os);
writeEntry(os, "value", *this);
}

View File

@ -125,8 +125,8 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
Foam::writeEntry(os, "thetaProperties", thetaProps_);
writeEntry("value", os);
writeEntry(os, "thetaProperties", thetaProps_);
writeEntry(os, "value", *this);
}

View File

@ -125,8 +125,8 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
Foam::writeEntry(os, "thetaProperties", thetaProps_);
writeEntry("value", os);
writeEntry(os, "thetaProperties", thetaProps_);
writeEntry(os, "value", *this);
}

View File

@ -125,8 +125,8 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
Foam::writeEntry(os, "thetaProperties", thetaProps_);
writeEntry("value", os);
writeEntry(os, "thetaProperties", thetaProps_);
writeEntry(os, "value", *this);
}

View File

@ -191,12 +191,12 @@ void alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::write
) const
{
fvPatchField<scalar>::write(os);
Foam::writeEntry(os, "vaporPhase", vaporPhaseName_);
Foam::writeEntry(os, "relax", relax_);
Foam::writeEntry(os, "fixedDmdt", fixedDmdt_);
Foam::writeEntry(os, "L", L_);
dmdt_.writeEntry("dmdt", os);
writeEntry("value", os);
writeEntry(os, "vaporPhase", vaporPhaseName_);
writeEntry(os, "relax", relax_);
writeEntry(os, "fixedDmdt", fixedDmdt_);
writeEntry(os, "L", L_);
writeEntry(os, "dmdt", dmdt_);
writeEntry(os, "value", *this);
}

View File

@ -323,12 +323,12 @@ void alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::write
) const
{
fvPatchField<scalar>::write(os);
Foam::writeEntry(os, "Prt", Prt_);
Foam::writeEntry(os, "Cmu", Cmu_);
Foam::writeEntry(os, "kappa", kappa_);
Foam::writeEntry(os, "E", E_);
dmdt_.writeEntry("dmdt", os);
writeEntry("value", os);
writeEntry(os, "Prt", Prt_);
writeEntry(os, "Cmu", Cmu_);
writeEntry(os, "kappa", kappa_);
writeEntry(os, "E", E_);
writeEntry(os, "dmdt", dmdt_);
writeEntry(os, "value", *this);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -124,9 +124,9 @@ void alphatPhaseChangeWallFunctionFvPatchScalarField::
write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
dmdt_.writeEntry("dmdt", os);
mDotL_.writeEntry("mDotL", os);
writeEntry("value", os);
writeEntry(os, "dmdt", dmdt_);
writeEntry(os, "mDotL", mDotL_);
writeEntry(os, "value", *this);
}

View File

@ -682,9 +682,9 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
Foam::writeEntry(os, "phaseType", phaseTypeNames_[phaseType_]);
writeEntry(os, "phaseType", phaseTypeNames_[phaseType_]);
Foam::writeEntry(os, "relax", relax_);
writeEntry(os, "relax", relax_);
switch (phaseType_)
{
@ -722,12 +722,12 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const
}
}
Foam::writeEntry(os, "otherPhase", otherPhaseName_);
dmdt_.writeEntry("dmdt", os);
dDep_.writeEntry("dDep", os);
qq_.writeEntry("qQuenching", os);
alphatConv_.writeEntry("alphatConv", os);
writeEntry("value", os);
writeEntry(os, "otherPhase", otherPhaseName_);
writeEntry(os, "dmdt", dmdt_);
writeEntry(os, "dDep", dDep_);
writeEntry(os, "qQuenching", qq_);
writeEntry(os, "alphatConv", alphatConv_);
writeEntry(os, "value", *this);
}

View File

@ -109,8 +109,8 @@ void Foam::copiedFixedValueFvPatchScalarField::updateCoeffs()
void Foam::copiedFixedValueFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
Foam::writeEntry(os, "sourceFieldName", sourceFieldName_);
writeEntry("value", os);
writeEntry(os, "sourceFieldName", sourceFieldName_);
writeEntry(os, "value", *this);
}

View File

@ -170,9 +170,9 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs()
void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
Foam::writeEntry(os, "relax", relax_);
q_.writeEntry("q", os);
writeEntry("value", os);
writeEntry(os, "relax", relax_);
writeEntry(os, "q", q_);
writeEntry(os, "value", *this);
}

View File

@ -125,8 +125,8 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
Foam::writeEntry(os, "thetaProperties", thetaProps_);
writeEntry("value", os);
writeEntry(os, "thetaProperties", thetaProps_);
writeEntry(os, "value", *this);
}

View File

@ -245,8 +245,8 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::write
) const
{
fvPatchVectorField::write(os);
Foam::writeEntry(os, "specularityCoefficient", specularityCoefficient_);
writeEntry("value", os);
writeEntry(os, "specularityCoefficient", specularityCoefficient_);
writeEntry(os, "value", *this);
}

View File

@ -289,9 +289,9 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::write
) const
{
fvPatchScalarField::write(os);
Foam::writeEntry(os, "restitutionCoefficient", restitutionCoefficient_);
Foam::writeEntry(os, "specularityCoefficient", specularityCoefficient_);
writeEntry("value", os);
writeEntry(os, "restitutionCoefficient", restitutionCoefficient_);
writeEntry(os, "specularityCoefficient", specularityCoefficient_);
writeEntry(os, "value", *this);
}

View File

@ -245,8 +245,8 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::write
) const
{
fvPatchVectorField::write(os);
Foam::writeEntry(os, "specularityCoefficient", specularityCoefficient_);
writeEntry("value", os);
writeEntry(os, "specularityCoefficient", specularityCoefficient_);
writeEntry(os, "value", *this);
}

View File

@ -289,9 +289,9 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::write
) const
{
fvPatchScalarField::write(os);
Foam::writeEntry(os, "restitutionCoefficient", restitutionCoefficient_);
Foam::writeEntry(os, "specularityCoefficient", specularityCoefficient_);
writeEntry("value", os);
writeEntry(os, "restitutionCoefficient", restitutionCoefficient_);
writeEntry(os, "specularityCoefficient", specularityCoefficient_);
writeEntry(os, "value", *this);
}

View File

@ -125,10 +125,10 @@ void Foam::hydrostaticDisplacementFvPatchVectorField::updateCoeffs()
void Foam::hydrostaticDisplacementFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
Foam::writeEntry(os, "rhoLiquid", rhoLiquid_);
Foam::writeEntry(os, "liquidSurfacePressure", liquidSurfacePressure_);
Foam::writeEntry(os, "liquidSurfacePoint", liquidSurfacePoint_);
writeEntry("value", os);
writeEntry(os, "rhoLiquid", rhoLiquid_);
writeEntry(os, "liquidSurfacePressure", liquidSurfacePressure_);
writeEntry(os, "liquidSurfacePoint", liquidSurfacePoint_);
writeEntry(os, "value", *this);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -200,9 +200,9 @@ void Foam::tractionDisplacementFvPatchVectorField::updateCoeffs()
void Foam::tractionDisplacementFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
traction_.writeEntry("traction", os);
pressure_.writeEntry("pressure", os);
writeEntry("value", os);
writeEntry(os, "traction", traction_);
writeEntry(os, "pressure", pressure_);
writeEntry(os, "value", *this);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -187,13 +187,12 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs()
}
// Write
void tractionDisplacementCorrectionFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
traction_.writeEntry("traction", os);
pressure_.writeEntry("pressure", os);
writeEntry("value", os);
writeEntry(os, "traction", traction_);
writeEntry(os, "pressure", pressure_);
writeEntry(os, "value", *this);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -198,7 +198,7 @@ int main(int argc, char *argv[])
list4.write(Info, true) << endl;
list4.writeEntry("PackedBoolList", Info);
writeEntry(Info, "PackedBoolList", list4);
return 0;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,8 +54,6 @@ int main(int argc, char *argv[])
autoPtr<tabulatedWallFunctions::tabulatedWallFunction>
twf(tabulatedWallFunctions::tabulatedWallFunction::New(dict, mesh));
// twf->writeData(Info);
twf->write();
Info<< "End\n" << endl;

View File

@ -27,6 +27,11 @@ cyclicSlip
type cyclicSlip;
}
conformalCoupled
{
type conformalCoupled;
}
empty
{
type empty;

View File

@ -220,12 +220,12 @@ void Foam::CLASS::write
) const
{
FVPATCHF::write(os);
Foam::writeEntry(os, "scalarData", scalarData_);
Foam::writeEntry(os, "data", data_);
fieldData_.writeEntry("fieldData", os);
timeVsData_->writeData(os);
Foam::writeEntry(os, "wordData", wordData_);
this->writeEntry("value", os);
writeEntry(os, "scalarData", scalarData_);
writeEntry(os, "data", data_);
writeEntry(os, "fieldData", fieldData_);
writeEntry(os, timeVsData_());
writeEntry(os, "wordData", wordData_);
writeEntry(os, "value", *this);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,6 +66,9 @@ template<class T, class Key, class Hash> class HashPtrTable;
template<class Type1, class Type2>
class Tuple2;
template<class T, class Key, class Hash>
void writeEntry(Ostream& os, const HashTable<T, Key, Hash>& ht);
template<class T, class Key, class Hash>
Istream& operator>>(Istream&, HashTable<T, Key, Hash>&);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -90,6 +90,15 @@ Foam::HashTable<T, Key, Hash>::printInfo(Ostream& os) const
}
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
template<class T, class Key, class Hash>
void Foam::writeEntry(Ostream& os, const HashTable<T, Key, Hash>& ht)
{
os << ht;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class T, class Key, class Hash>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,6 +54,9 @@ namespace Foam
template<class T, unsigned Size> class FixedList;
template<class T, unsigned Size>
void writeEntry(Ostream& os, const FixedList<T, Size>&);
template<class T, unsigned Size>
Istream& operator>>(Istream&, FixedList<T, Size>&);
@ -207,12 +210,6 @@ public:
// needed to make FixedList consistent with List
void transfer(const FixedList<T, Size>&);
//- Write the FixedList as a dictionary entry
void writeEntry(Ostream&) const;
//- Write the FixedList as a dictionary entry with keyword
void writeEntry(const word& keyword, Ostream&) const;
// Member operators

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,6 +29,15 @@ License
#include "token.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
template<class T, unsigned Size>
void Foam::writeEntry(Ostream& os, const FixedList<T, Size>& l)
{
writeListEntry(os, l);
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class T, unsigned Size>
@ -133,34 +142,6 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L)
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class T, unsigned Size>
void Foam::FixedList<T, Size>::writeEntry(Ostream& os) const
{
if
(
token::compound::isCompound("List<" + word(pTraits<T>::typeName) + '>')
)
{
os << word("List<" + word(pTraits<T>::typeName) + '>') << " ";
}
os << *this;
}
template<class T, unsigned Size>
void Foam::FixedList<T, Size>::writeEntry
(
const word& keyword,
Ostream& os
) const
{
os.writeKeyword(keyword);
writeEntry(os);
os << token::END_STATEMENT << endl;
}
template<class T, unsigned Size>
Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,7 +31,7 @@ License
#if (UINT_MAX == 0xFFFFFFFF)
// 32-bit counting, Hamming weight method
#define COUNT_PACKEDBITS(sum, x) \
#define COUNT_PACKEDBITS(sum, x) \
{ \
x -= (x >> 1) & 0x55555555; \
x = (x & 0x33333333) + ((x >> 2) & 0x33333333); \
@ -39,7 +39,7 @@ License
}
#elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF)
// 64-bit counting, Hamming weight method
#define COUNT_PACKEDBITS(sum, x) \
#define COUNT_PACKEDBITS(sum, x) \
{ \
x -= (x >> 1) & 0x5555555555555555; \
x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333); \
@ -490,26 +490,6 @@ Foam::Ostream& Foam::PackedList<nBits>::write
}
template<unsigned nBits>
void Foam::PackedList<nBits>::writeEntry(Ostream& os) const
{
os << *this;
}
template<unsigned nBits>
void Foam::PackedList<nBits>::writeEntry
(
const word& keyword,
Ostream& os
) const
{
os.writeKeyword(keyword);
writeEntry(os);
os << token::END_STATEMENT << endl;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<unsigned nBits>
@ -546,6 +526,15 @@ void Foam::PackedList<nBits>::operator=(const UIndirectList<label>& lst)
}
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
template<unsigned nBits>
void Foam::writeEntry(Ostream& os, const PackedList<nBits>& l)
{
os << l;
}
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
template<unsigned nBits>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -117,8 +117,12 @@ class Ostream;
// Forward declaration of friend functions and operators
template<unsigned nBits> class PackedList;
template<unsigned nBits>
void writeEntry(Ostream& os, const PackedList<nBits>&);
template<unsigned nBits>
Istream& operator>>(Istream&, PackedList<nBits>&);
template<unsigned nBits>
Ostream& operator<<(Ostream&, const PackedList<nBits>&);
@ -377,13 +381,6 @@ public:
) const;
//- Write as a dictionary entry
void writeEntry(Ostream&) const;
//- Write as a dictionary entry with keyword
void writeEntry(const word& keyword, Ostream&) const;
// Member operators
//- Append a value at the end of the list

View File

@ -59,11 +59,13 @@ template<class T> class SubList;
// Forward declaration of friend functions and operators
template<class T> class UList;
template<class T> void writeEntry(Ostream& os, const UList<T>&);
template<class T> Ostream& operator<<(Ostream&, const UList<T>&);
template<class T> Istream& operator>>(Istream&, UList<T>&);
typedef UList<label> labelUList;
/*---------------------------------------------------------------------------*\
Class UList Declaration
\*---------------------------------------------------------------------------*/
@ -221,21 +223,6 @@ public:
void deepCopy(const UList<T>&);
// Write
//- Write the UList as a dictionary entry
void writeEntry(Ostream&) const;
//- Write the UList as a dictionary entry with keyword
void writeEntry(const word& keyword, Ostream&) const;
//- Write the UList as a dictionary entry
void writeEntryList(Ostream&) const;
//- Write the UList as a dictionary entry with keyword
void writeEntryList(const word& keyword, Ostream&) const;
// Member operators
//- Return element of UList
@ -416,6 +403,15 @@ inline void reverse(UList<T>&, const label n);
template<class T>
inline void reverse(UList<T>&);
template<class ListType>
void writeListEntry(Ostream& os, const ListType& l);
template<class ListType>
void writeListEntries(Ostream& os, const ListType& l);
template<class ListType>
void writeListEntries(Ostream& os, const word& keyword, const ListType& l);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -29,46 +29,42 @@ License
#include "SLList.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
template<class T>
void Foam::UList<T>::writeEntry(Ostream& os) const
template<class ListType>
void Foam::writeListEntry(Ostream& os, const ListType& l)
{
if
(
size()
l.size()
&& token::compound::isCompound
(
"List<" + word(pTraits<T>::typeName) + '>'
"List<"
+ word(pTraits<typename ListType::value_type>::typeName) + '>'
)
)
{
os << word("List<" + word(pTraits<T>::typeName) + '>') << " ";
os << word
(
"List<"
+ word(pTraits<typename ListType::value_type>::typeName) + '>'
) << " ";
}
os << *this;
os << l;
}
template<class T>
void Foam::UList<T>::writeEntry(const word& keyword, Ostream& os) const
{
os.writeKeyword(keyword);
writeEntry(os);
os << token::END_STATEMENT << endl;
}
template<class T>
void Foam::UList<T>::writeEntryList(Ostream& os) const
template<class ListType>
void Foam::writeListEntries(Ostream& os, const ListType& l)
{
// Write size and start delimiter
os << nl << size() << nl << token::BEGIN_LIST;
os << nl << l.size() << nl << token::BEGIN_LIST;
// Write contents
forAll(*this, i)
forAll(l, i)
{
this->operator[](i).writeEntry(os);
writeEntry(os, l[i]);
os << nl;
}
@ -77,15 +73,22 @@ void Foam::UList<T>::writeEntryList(Ostream& os) const
}
template<class T>
void Foam::UList<T>::writeEntryList(const word& keyword, Ostream& os) const
template<class ListType>
void Foam::writeListEntries(Ostream& os, const word& keyword, const ListType& l)
{
os.writeKeyword(keyword);
writeEntryList(os);
writeListEntries(os, l);
os << token::END_STATEMENT << endl;
}
template<class T>
void Foam::writeEntry(Ostream& os, const UList<T>& l)
{
writeListEntry(os, l);
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class T>

View File

@ -53,12 +53,9 @@ template<class T> class PtrList;
// Forward declaration of friend functions and operators
template<class T> class UPtrList;
template<class T>
Istream& operator>>(Istream&, UPtrList<T>&);
template<class T>
Ostream& operator<<(Ostream&, const UPtrList<T>&);
template<class T> void writeEntry(Ostream& os, const UPtrList<T>&);
template<class T> Istream& operator>>(Istream&, UPtrList<T>&);
template<class T> Ostream& operator<<(Ostream&, const UPtrList<T>&);
/*---------------------------------------------------------------------------*\
@ -154,21 +151,6 @@ public:
void reorder(const labelUList&);
// Write
//- Write the UPtrList as a dictionary entry
void writeEntry(Ostream&) const;
//- Write the UPtrList as a dictionary entry with keyword
void writeEntry(const word& keyword, Ostream&) const;
//- Write the UPtrList as a dictionary entry
void writeEntryList(Ostream&) const;
//- Write the UPtrList as a dictionary entry with keyword
void writeEntryList(const word& keyword, Ostream&) const;
// Member operators
//- Return element const reference

View File

@ -26,60 +26,12 @@ License
#include "UPtrList.H"
#include "Ostream.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
template<class T>
void Foam::UPtrList<T>::writeEntry(Ostream& os) const
void Foam::writeEntry(Ostream& os, const UPtrList<T>& l)
{
if
(
size()
&& token::compound::isCompound
(
"List<" + word(pTraits<T>::typeName) + '>'
)
)
{
os << word("List<" + word(pTraits<T>::typeName) + '>') << " ";
}
os << *this;
}
template<class T>
void Foam::UPtrList<T>::writeEntry(const word& keyword, Ostream& os) const
{
os.writeKeyword(keyword);
writeEntry(os);
os << token::END_STATEMENT << endl;
}
template<class T>
void Foam::UPtrList<T>::writeEntryList(Ostream& os) const
{
// Write size and start delimiter
os << nl << size() << nl << token::BEGIN_LIST;
// Write contents
forAll(*this, i)
{
this->operator[](i).writeEntry(os);
os << nl;
}
// Write end delimiter
os << nl << token::END_LIST << nl;
}
template<class T>
void Foam::UPtrList<T>::writeEntryList(const word& keyword, Ostream& os) const
{
os.writeKeyword(keyword);
writeEntryList(os);
os << token::END_STATEMENT << endl;
writeListEntry(os, l);
}

View File

@ -130,40 +130,6 @@ Foam::ListCompactIO<T, BaseType>::ListCompactIO(Istream& is)
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T, class BaseType>
void Foam::ListCompactIO<T, BaseType>::writeEntry(Ostream& os) const
{
// Keep ascii writing same.
if (os.format() == IOstream::ASCII)
{
os << static_cast<const List<T>&>(*this);
}
else
{
labelList start;
List<BaseType> elems;
convertToCompact(start, elems);
start.writeEntry(os);
elems.writeEntry(os);
}
}
template<class T, class BaseType>
void Foam::ListCompactIO<T, BaseType>::writeEntry
(
const word& keyword,
Ostream& os
) const
{
os.writeKeyword(keyword);
writeEntry(os);
os << token::END_STATEMENT << endl;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T, class BaseType>
@ -183,6 +149,27 @@ void Foam::ListCompactIO<T, BaseType>::operator=(const List<T>& rhs)
}
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
template<class T, class BaseType>
void Foam::writeEntry(Ostream& os, const ListCompactIO<T, BaseType>& l)
{
// Keep ascii writing same.
if (os.format() == IOstream::ASCII)
{
os << static_cast<const List<T>&>(l);
}
else
{
labelList start;
List<BaseType> elems;
l.convertToCompact(start, elems);
writeEntry(os, start);
writeEntry(os, elems);
}
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class T, class BaseType>

View File

@ -52,17 +52,22 @@ class Ostream;
// Forward declaration of friend functions and operators
template<class T, class BaseType> class ListCompactIO;
template<class T, class BaseType>
void writeEntry(Ostream& os, const ListCompactIO<T, BaseType>& l);
template<class T, class BaseType> Istream& operator>>
(
Istream&,
ListCompactIO<T, BaseType>&
);
template<class T, class BaseType> Ostream& operator<<
(
Ostream&,
const ListCompactIO<T, BaseType>&
);
/*---------------------------------------------------------------------------*\
Class ListCompactIO Declaration
\*---------------------------------------------------------------------------*/
@ -106,16 +111,6 @@ public:
ListCompactIO(Istream&);
// Member functions
//- Write the list in compact form as a dictionary entry to Ostream
void writeEntry(Ostream& os) const;
//- Write the list in compact form as a dictionary entry with keyword
// to Ostream
void writeEntry(const word& keyword, Ostream& os) const;
// Member operators
void operator=(const ListCompactIO<T, BaseType>&);
@ -123,6 +118,15 @@ public:
void operator=(const List<T>&);
// IOstream functions
friend void writeEntry <T, BaseType>
(
Ostream& os,
const ListCompactIO<T, BaseType>& l
);
// IOstream operators
//- Read List from Istream, discarding contents of existing List.

View File

@ -59,6 +59,8 @@ SourceFiles
#include "wordList.H"
#include "className.H"
#include "VectorSpace.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -586,15 +588,14 @@ dictionary operator+(const dictionary& dict1, const dictionary& dict2);
dictionary operator|(const dictionary& dict1, const dictionary& dict2);
// Global Functions
//- Write a dictionary entry
void writeEntry(Ostream& os, const dictionary& dict);
//- Helper function to write the keyword and entry
template<class EntryType>
void writeEntry
(
Ostream& os,
const word& entryName,
const EntryType& value
);
void writeEntry(Ostream& os, const word& entryName, const EntryType& value);
//- Helper function to write the keyword and entry only if the
// values are not equal. The value is then output as value2

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -152,6 +152,14 @@ bool Foam::dictionary::substituteKeyword(const word& keyword)
}
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
void Foam::writeEntry(Ostream& os, const dictionary& value)
{
os << value;
}
// * * * * * * * * * * * * * * Istream Operator * * * * * * * * * * * * * * //
Foam::Istream& Foam::operator>>(Istream& is, dictionary& dict)

View File

@ -158,6 +158,8 @@ void Foam::dictionary::set(const keyType& k, const T& t)
}
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
template<class EntryType>
void Foam::writeEntry
(
@ -166,7 +168,9 @@ void Foam::writeEntry
const EntryType& value
)
{
os.writeKeyword(entryName) << value << token::END_STATEMENT << nl;
os.writeKeyword(entryName);
writeEntry(os, value);
os << token::END_STATEMENT << endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,7 +50,7 @@ Description
const IOdictionary& d = static_cast<const IOdictionary&>(dict);
const fvMesh& mesh = refCast<const fvMesh>(d.db());
scalarField fld(mesh.nCells(), 12.34);
fld.writeEntry("", os);
writeEntry(os, "", fld);
#};
//- Optional:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -430,6 +430,9 @@ public:
};
void writeEntry(Ostream& os, const dimensionSet& value);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -708,6 +708,12 @@ Foam::Ostream& Foam::dimensionSet::write
}
void Foam::writeEntry(Ostream& os, const dimensionSet& value)
{
os << value;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Istream& Foam::operator>>(Istream& is, dimensionSet& dset)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -594,6 +594,15 @@ Foam::dimensioned<Type> Foam::min
}
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
template<class Type>
void Foam::writeEntry(Ostream& os, const dimensioned<Type>& dt)
{
os << dt;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -229,6 +229,10 @@ public:
};
template<class Type>
void writeEntry(Ostream& os, const dimensioned<Type>& dt);
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
template<class Type, direction r>

View File

@ -110,7 +110,7 @@ bool Foam::DimensionedField<Type, GeoMesh>::writeData
writeEntry(os, "dimensions", dimensions());
os << nl;
Field<Type>::writeEntry(fieldDictEntry, os);
writeEntry(os, fieldDictEntry, static_cast<const Field<Type>&>(*this));
// Check state of Ostream
os.check

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -720,42 +720,6 @@ Foam::tmp<Foam::Field<Type>> Foam::Field<Type>::T() const
}
template<class Type>
void Foam::Field<Type>::writeEntry(const word& keyword, Ostream& os) const
{
os.writeKeyword(keyword);
bool uniform = false;
if (this->size() && contiguous<Type>())
{
uniform = true;
forAll(*this, i)
{
if (this->operator[](i) != this->operator[](0))
{
uniform = false;
break;
}
}
}
if (uniform)
{
os << "uniform " << this->operator[](0) << token::END_STATEMENT;
}
else
{
os << "nonuniform ";
List<Type>::writeEntry(os);
os << token::END_STATEMENT;
}
os << endl;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Type>
@ -851,6 +815,39 @@ COMPUTED_ASSIGNMENT(scalar, /=)
#undef COMPUTED_ASSIGNMENT
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
template<class Type>
void Foam::writeEntry(Ostream& os, const Field<Type>& f)
{
bool uniform = false;
if (f.size() && contiguous<Type>())
{
uniform = true;
forAll(f, i)
{
if (f[i] != f[0])
{
uniform = false;
break;
}
}
}
if (uniform)
{
os << "uniform " << f[0];
}
else
{
os << "nonuniform ";
writeEntry(os, static_cast<const List<Type>&>(f));
}
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -61,6 +61,9 @@ class Field;
template<class Type>
class SubField;
template<class Type>
void writeEntry(Ostream& os, const Field<Type>&);
template<class Type>
Ostream& operator<<(Ostream&, const Field<Type>&);
@ -349,9 +352,6 @@ public:
//- Return the field transpose (only defined for second rank tensors)
tmp<Field<Type>> T() const;
//- Write the field as a dictionary entry
void writeEntry(const word& keyword, Ostream& os) const;
// Member operators

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -179,7 +179,7 @@ template<class Type>
void Foam::valuePointPatchField<Type>::write(Ostream& os) const
{
pointPatchField<Type>::write(os);
this->writeEntry("value", os);
writeEntry(os, "value", static_cast<const Field<Type>&>(*this));
}

View File

@ -285,7 +285,7 @@ Foam::codedFixedValuePointPatchField<Type>::redirectPatchField() const
OStringStream os;
writeEntry(os, "type", name_);
static_cast<const Field<Type>&>(*this).writeEntry("value", os);
writeEntry(os, "value", static_cast<const Field<Type>&>(*this));
IStringStream is(os.str());
dictionary dict(is);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -138,7 +138,7 @@ write(Ostream& os) const
{
// Note: write value
fixedValuePointPatchField<Type>::write(os);
uniformValue_->writeData(os);
writeEntry(os, uniformValue_());
}

View File

@ -122,23 +122,6 @@ void Foam::pointPatchField<Type>::write(Ostream& os) const
}
template<class Type>
template<class EntryType>
void Foam::pointPatchField<Type>::writeEntryIfDifferent
(
Ostream& os,
const word& entryName,
const EntryType& value1,
const EntryType& value2
) const
{
if (value1 != value2)
{
writeEntry(os, entryName, value2);
}
}
template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::pointPatchField<Type>::patchInternalField() const

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -436,17 +436,6 @@ public:
//- Write
virtual void write(Ostream&) const;
//- Helper function to write the keyword and entry only if the
// values are not equal. The value is then output as value2
template<class EntryType>
void writeEntryIfDifferent
(
Ostream& os,
const word& entryName,
const EntryType& value1,
const EntryType& value2
) const;
// Member operators

View File

@ -354,16 +354,16 @@ void Foam::interpolationLookUpTable<Type>::write
control.writeHeader(os);
Foam::writeEntry(os, "fields", entries_);
writeEntry(os, "fields", entries_);
Foam::writeEntry(os, "output", output_);
writeEntry(os, "output", output_);
if (this->size() == 0)
{
FatalErrorInFunction
<< "table is empty" << nl << exit(FatalError);
}
Foam::writeEntry(os, "values", *this);
writeEntry(os, "values", *this);
}

View File

@ -563,8 +563,8 @@ void Foam::coupledPolyPatch::write(Ostream& os) const
polyPatch::write(os);
// if (matchTolerance_ != defaultMatchTol_)
{
Foam::writeEntry(os, "matchTolerance", matchTolerance_);
Foam::writeEntry(os, "transform", transformTypeNames[transform_]);
writeEntry(os, "matchTolerance", matchTolerance_);
writeEntry(os, "transform", transformTypeNames[transform_]);
}
}

View File

@ -120,10 +120,10 @@ Foam::genericPolyPatch::~genericPolyPatch()
void Foam::genericPolyPatch::write(Ostream& os) const
{
Foam::writeEntry(os, "type", actualTypeName_);
writeEntry(os, "type", actualTypeName_);
patchIdentifier::write(os);
Foam::writeEntry(os, "nFaces", size());
Foam::writeEntry(os, "startFace", start());
writeEntry(os, "nFaces", size());
writeEntry(os, "startFace", start());
forAllConstIter(dictionary, dict_, iter)
{

View File

@ -1446,20 +1446,20 @@ void Foam::cyclicPolyPatch::write(Ostream& os) const
coupledPolyPatch::write(os);
if (!neighbPatchName_.empty())
{
Foam::writeEntry(os, "neighbourPatch", neighbPatchName_);
writeEntry(os, "neighbourPatch", neighbPatchName_);
}
coupleGroup_.write(os);
switch (transform())
{
case ROTATIONAL:
{
Foam::writeEntry(os, "rotationAxis", rotationAxis_);
Foam::writeEntry(os, "rotationCentre", rotationCentre_);
writeEntry(os, "rotationAxis", rotationAxis_);
writeEntry(os, "rotationCentre", rotationCentre_);
break;
}
case TRANSLATIONAL:
{
Foam::writeEntry(os, "separationVector", separationVector_);
writeEntry(os, "separationVector", separationVector_);
break;
}
case NOORDERING:

View File

@ -1219,24 +1219,24 @@ bool Foam::oldCyclicPolyPatch::order
void Foam::oldCyclicPolyPatch::write(Ostream& os) const
{
// Replacement of polyPatch::write to write 'cyclic' instead of type():
Foam::writeEntry(os, "type", cyclicPolyPatch::typeName);
writeEntry(os, "type", cyclicPolyPatch::typeName);
patchIdentifier::write(os);
Foam::writeEntry(os, "nFaces", size());
Foam::writeEntry(os, "startFace", start());
writeEntry(os, "nFaces", size());
writeEntry(os, "startFace", start());
Foam::writeEntry(os, "featureCos", featureCos_);
writeEntry(os, "featureCos", featureCos_);
switch (transform())
{
case ROTATIONAL:
{
Foam::writeEntry(os, "rotationAxis", rotationAxis_);
Foam::writeEntry(os, "rotationCentre", rotationCentre_);
writeEntry(os, "rotationAxis", rotationAxis_);
writeEntry(os, "rotationCentre", rotationCentre_);
break;
}
case TRANSLATIONAL:
{
Foam::writeEntry(os, "separationVector", separationVector_);
writeEntry(os, "separationVector", separationVector_);
break;
}
default:

View File

@ -1112,8 +1112,8 @@ bool Foam::processorPolyPatch::order
void Foam::processorPolyPatch::write(Ostream& os) const
{
coupledPolyPatch::write(os);
Foam::writeEntry(os, "myProcNo", myProcNo_);
Foam::writeEntry(os, "neighbProcNo", neighbProcNo_);
writeEntry(os, "myProcNo", myProcNo_);
writeEntry(os, "neighbProcNo", neighbProcNo_);
}

View File

@ -337,10 +337,10 @@ bool Foam::processorCyclicPolyPatch::order
void Foam::processorCyclicPolyPatch::write(Ostream& os) const
{
processorPolyPatch::write(os);
Foam::writeEntry(os, "referPatch", referPatchName_);
writeEntry(os, "referPatch", referPatchName_);
if (tag_ != -1)
{
Foam::writeEntry(os, "tag", tag_);
writeEntry(os, "tag", tag_);
}
}

View File

@ -356,10 +356,10 @@ void Foam::polyPatch::clearAddressing()
void Foam::polyPatch::write(Ostream& os) const
{
Foam::writeEntry(os, "type", type());
writeEntry(os, "type", type());
patchIdentifier::write(os);
Foam::writeEntry(os, "nFaces", size());
Foam::writeEntry(os, "startFace", start());
writeEntry(os, "nFaces", size());
writeEntry(os, "startFace", start());
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -139,7 +139,7 @@ void Foam::cellZone::writeDict(Ostream& os) const
os << nl << name() << nl << token::BEGIN_BLOCK << nl
<< " type " << type() << token::END_STATEMENT << nl;
writeEntry(this->labelsName, os);
writeEntry(os, this->labelsName, *this);
os << token::END_BLOCK << endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -532,8 +532,8 @@ void Foam::faceZone::writeDict(Ostream& os) const
os << nl << name() << nl << token::BEGIN_BLOCK << nl
<< " type " << type() << token::END_STATEMENT << nl;
writeEntry(this->labelsName, os);
flipMap().writeEntry("flipMap", os);
writeEntry(os, this->labelsName, *this);
writeEntry(os, "flipMap", flipMap());
os << token::END_BLOCK << endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -191,7 +191,7 @@ void Foam::pointZone::writeDict(Ostream& os) const
os << nl << name_ << nl << token::BEGIN_BLOCK << nl
<< " type " << type() << token::END_STATEMENT << nl;
writeEntry(this->labelsName, os);
writeEntry(os, this->labelsName, *this);
os << token::END_BLOCK << endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -62,7 +62,7 @@ word name(const Scalar val)
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
Scalar readScalar(Istream& is)
{
@ -73,6 +73,14 @@ Scalar readScalar(Istream& is)
}
void writeEntry(Ostream& os, const Scalar value)
{
os << value;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Istream& operator>>(Istream& is, Scalar& s)
{
token t(is);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -362,9 +362,15 @@ inline Scalar stabilise(const Scalar s, const Scalar small)
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
Scalar readScalar(Istream&);
void writeEntry(Ostream& os, const Scalar value);
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Istream& operator>>(Istream&, Scalar&);
Ostream& operator<<(Ostream&, const Scalar);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -69,6 +69,11 @@ class Tuple2
public:
// Static data members
static const char* const typeName;
// Constructors
//- Null constructor for lists

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -73,6 +73,15 @@ Foam::word Foam::name
}
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
template<class Form, class Cmpt, Foam::direction Ncmpts>
void Foam::writeEntry(Ostream& os, const VectorSpace<Form, Cmpt, Ncmpts>& value)
{
os << value;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class Form, class Cmpt, Foam::direction Ncmpts>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -53,6 +53,9 @@ namespace Foam
template<class Form, class Cmpt, direction Ncmpts> class VectorSpace;
template<class Form, class Cmpt, direction Ncmpts>
void writeEntry(Ostream& os, const VectorSpace<Form, Cmpt, Ncmpts>& value);
template<class Form, class Cmpt, direction Ncmpts>
Istream& operator>>
(

View File

@ -271,7 +271,7 @@ void Foam::Function1Types::CSV<Type>::writeData(Ostream& os) const
writeEntry(os, "nHeaderLine", nHeaderLine_);
writeEntry(os, "refColumn", refColumn_);
componentColumns_.writeEntry("componentColumns", os);
writeEntry(os, componentColumns_);
writeEntry(os, "separator", string(separator_));
writeEntry(os, "mergeSeparators", mergeSeparators_);
writeEntry(os, "file", fName_);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -149,6 +149,15 @@ void Foam::Function1<Type>::writeData(Ostream& os) const
}
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
template<class Type>
void Foam::writeEntry(Ostream& os, const Function1<Type>& f1)
{
f1.writeData(os);
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
template<class Type>
@ -164,7 +173,6 @@ Foam::Ostream& Foam::operator<<
"Ostream& operator<<(Ostream&, const Function1<Type>&)"
);
os << f1.name_;
f1.writeData(os);
return os;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -169,6 +169,10 @@ public:
};
template<class Type>
void writeEntry(Ostream& os, const Function1<Type>& f1);
/*---------------------------------------------------------------------------*\
Class FieldFunction1 Declaration
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,6 +66,11 @@ inline label readLabel(Istream& is)
return INT_SIZE(readInt,) (is);
}
inline void writeEntry(Ostream& os, const label value)
{
os << value;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -282,6 +282,15 @@ inline spatialTransform Xt(const vector& r)
}
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
//- Write the spatial transformation as an entry
inline void writeEntry(Ostream& os, const spatialTransform& st)
{
os << st;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -224,6 +224,10 @@ public:
};
void writeEntry(Ostream& os, const char* value);
void writeEntry(Ostream& os, const string& value);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,6 +34,20 @@ Foam::string::string(Istream& is)
}
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
void Foam::writeEntry(Ostream& os, const char* value)
{
os << value;
}
void Foam::writeEntry(Ostream& os, const string& value)
{
os << value;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Istream& Foam::operator>>(Istream& is, string& s)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,4 +32,13 @@ const char* const Foam::word::typeName = "word";
int Foam::word::debug(Foam::debug::debugSwitch(word::typeName, 0));
const Foam::word Foam::word::null;
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
void Foam::writeEntry(Ostream& os, const word& value)
{
os << value;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -135,6 +135,9 @@ public:
};
void writeEntry(Ostream& os, const word& value);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -161,8 +161,8 @@ void convectiveHeatTransferFvPatchScalarField::updateCoeffs()
void convectiveHeatTransferFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
Foam::writeEntry(os, "L", L_);
writeEntry("value", os);
writeEntry(os, "L", L_);
writeEntry(os, "value", *this);
}

View File

@ -479,61 +479,61 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
{
fvPatchScalarField::write(os);
Foam::writeEntry(os, "mode", operationModeNames[mode_]);
writeEntry(os, "mode", operationModeNames[mode_]);
temperatureCoupledBase::write(os);
switch (mode_)
{
case fixedPower:
{
Foam::writeEntry(os, "Q", Q_);
writeEntry(os, "Q", Q_);
break;
}
case fixedHeatFlux:
{
q_.writeEntry("q", os);
writeEntry(os, "q", q_);
break;
}
case fixedHeatTransferCoeff:
{
h_.writeEntry("h", os);
Ta_->writeData(os);
writeEntry(os, "h", h_);
writeEntry(os, Ta_());
if (relaxation_ < 1)
{
Foam::writeEntry(os, "relaxation", relaxation_);
writeEntry(os, "relaxation", relaxation_);
}
if (emissivity_ > 0)
{
Foam::writeEntry(os, "emissivity", emissivity_);
writeEntry(os, "emissivity", emissivity_);
}
if (thicknessLayers_.size())
{
thicknessLayers_.writeEntry("thicknessLayers", os);
kappaLayers_.writeEntry("kappaLayers", os);
writeEntry(os, "thicknessLayers", thicknessLayers_);
writeEntry(os, "kappaLayers", kappaLayers_);
}
break;
}
}
Foam::writeEntry(os, "qr", qrName_);
writeEntry(os, "qr", qrName_);
if (qrName_ != "none")
{
Foam::writeEntry(os, "qrRelaxation", qrRelaxation_);
writeEntry(os, "qrRelaxation", qrRelaxation_);
qrPrevious_.writeEntry("qrPrevious", os);
writeEntry(os, "qrPrevious", qrPrevious_);
}
refValue().writeEntry("refValue", os);
refGrad().writeEntry("refGradient", os);
valueFraction().writeEntry("valueFraction", os);
writeEntry("value", os);
writeEntry(os, "refValue", refValue());
writeEntry(os, "refGradient", refGrad());
writeEntry(os, "valueFraction", valueFraction());
writeEntry(os, "value", *this);
}

View File

@ -430,14 +430,14 @@ void thermalBaffle1DFvPatchScalarField<solidType>::write(Ostream& os) const
if (this->owner())
{
baffleThickness()().writeEntry("thickness", os);
Qs()().writeEntry("Qs", os);
writeEntry(os, "thickness", baffleThickness()());
writeEntry(os, "Qs", Qs()());
solid().write(os);
}
qrPrevious_.writeEntry("qrPrevious", os);
Foam::writeEntry(os, "qr", qrName_);
Foam::writeEntry(os, "qrRelaxation", qrRelaxation_);
writeEntry(os, "qrPrevious", qrPrevious_);
writeEntry(os, "qr", qrName_);
writeEntry(os, "qrRelaxation", qrRelaxation_);
}

View File

@ -199,10 +199,10 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::
write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
Foam::writeEntry(os, "phi", phiName_);
Foam::writeEntry(os, "rho", rhoName_);
Foam::writeEntry(os, "massFluxFraction", massFluxFraction_);
this->writeEntry("value", os);
writeEntry(os, "phi", phiName_);
writeEntry(os, "rho", rhoName_);
writeEntry(os, "massFluxFraction", massFluxFraction_);
writeEntry(os, "value", *this);
}

View File

@ -265,9 +265,9 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write
) const
{
mixedFvPatchScalarField::write(os);
Foam::writeEntry(os, "Tnbr", TnbrName_);
thicknessLayers_.writeEntry("thicknessLayers", os);
kappaLayers_.writeEntry("kappaLayers", os);
writeEntry(os, "Tnbr", TnbrName_);
writeEntry(os, "thicknessLayers", thicknessLayers_);
writeEntry(os, "kappaLayers", kappaLayers_);
temperatureCoupledBase::write(os);
}

View File

@ -270,11 +270,11 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::write
) const
{
mixedFvPatchScalarField::write(os);
Foam::writeEntry(os, "Tnbr", TnbrName_);
Foam::writeEntry(os, "qrNbr", qrNbrName_);
Foam::writeEntry(os, "qr", qrName_);
thicknessLayers_.writeEntry("thicknessLayers", os);
kappaLayers_.writeEntry("kappaLayers", os);
writeEntry(os, "Tnbr", TnbrName_);
writeEntry(os, "qrNbr", qrNbrName_);
writeEntry(os, "qr", qrName_);
writeEntry(os, "thicknessLayers", thicknessLayers_);
writeEntry(os, "kappaLayers", kappaLayers_);
temperatureCoupledBase::write(os);
}

View File

@ -300,11 +300,11 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
void alphatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
Foam::writeEntry(os, "Prt", Prt_);
Foam::writeEntry(os, "Cmu", Cmu_);
Foam::writeEntry(os, "kappa", kappa_);
Foam::writeEntry(os, "E", E_);
writeEntry("value", os);
writeEntry(os, "Prt", Prt_);
writeEntry(os, "Cmu", Cmu_);
writeEntry(os, "kappa", kappa_);
writeEntry(os, "E", E_);
writeEntry(os, "value", *this);
}

View File

@ -129,8 +129,8 @@ void alphatWallFunctionFvPatchScalarField::updateCoeffs()
void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
Foam::writeEntry(os, "Prt", Prt_);
writeEntry("value", os);
writeEntry(os, "Prt", Prt_);
writeEntry(os, "value", *this);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -174,9 +174,9 @@ void Foam::wallHeatTransferFvPatchScalarField::updateCoeffs()
void Foam::wallHeatTransferFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
Tinf_.writeEntry("Tinf", os);
alphaWall_.writeEntry("alphaWall", os);
writeEntry("value", os);
writeEntry(os, "Tinf", Tinf_);
writeEntry(os, "alphaWall", alphaWall_);
writeEntry(os, "value", *this);
}

View File

@ -268,11 +268,11 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
void alphatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
Foam::writeEntry(os, "Prt", Prt_);
Foam::writeEntry(os, "Cmu", Cmu_);
Foam::writeEntry(os, "kappa", kappa_);
Foam::writeEntry(os, "E", E_);
writeEntry("value", os);
writeEntry(os, "Prt", Prt_);
writeEntry(os, "Cmu", Cmu_);
writeEntry(os, "kappa", kappa_);
writeEntry(os, "E", E_);
writeEntry(os, "value", *this);
}

View File

@ -159,10 +159,10 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write
) const
{
fvPatchScalarField::write(os);
Foam::writeEntry(os, "mixingLength", mixingLength_);
Foam::writeEntry(os, "phi", this->phiName_);
Foam::writeEntry(os, "k", kName_);
writeEntry("value", os);
writeEntry(os, "mixingLength", mixingLength_);
writeEntry(os, "phi", this->phiName_);
writeEntry(os, "k", kName_);
writeEntry(os, "value", *this);
}

View File

@ -155,10 +155,10 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::write
) const
{
fvPatchScalarField::write(os);
Foam::writeEntry(os, "mixingLength", mixingLength_);
Foam::writeEntry(os, "phi", this->phiName_);
Foam::writeEntry(os, "k", kName_);
writeEntry("value", os);
writeEntry(os, "mixingLength", mixingLength_);
writeEntry(os, "phi", this->phiName_);
writeEntry(os, "k", kName_);
writeEntry(os, "value", *this);
}

View File

@ -126,8 +126,8 @@ void Foam::fixedShearStressFvPatchVectorField::updateCoeffs()
void Foam::fixedShearStressFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
Foam::writeEntry(os, "tau", tau0_);
writeEntry("value", os);
writeEntry(os, "tau", tau0_);
writeEntry(os, "value", *this);
}

View File

@ -178,9 +178,9 @@ void Foam::porousBafflePressureFvPatchField::write(Ostream& os) const
fixedJumpFvPatchField<scalar>::write(os);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
Foam::writeEntry(os, "D", D_);
Foam::writeEntry(os, "I", I_);
Foam::writeEntry(os, "length", length_);
writeEntry(os, "D", D_);
writeEntry(os, "I", I_);
writeEntry(os, "length", length_);
}

View File

@ -57,9 +57,9 @@ void Foam::epsilonWallFunctionFvPatchScalarField::writeLocalEntries
Ostream& os
) const
{
Foam::writeEntry(os, "Cmu", Cmu_);
Foam::writeEntry(os, "kappa", kappa_);
Foam::writeEntry(os, "E", E_);
writeEntry(os, "Cmu", Cmu_);
writeEntry(os, "kappa", kappa_);
writeEntry(os, "E", E_);
}

View File

@ -55,9 +55,9 @@ void fWallFunctionFvPatchScalarField::checkType()
void fWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
{
Foam::writeEntry(os, "Cmu", Cmu_);
Foam::writeEntry(os, "kappa", kappa_);
Foam::writeEntry(os, "E", E_);
writeEntry(os, "Cmu", Cmu_);
writeEntry(os, "kappa", kappa_);
writeEntry(os, "E", E_);
}

View File

@ -233,10 +233,10 @@ void kLowReWallFunctionFvPatchScalarField::evaluate
void kLowReWallFunctionFvPatchScalarField::write(Ostream& os) const
{
Foam::writeEntry(os, "Cmu", Cmu_);
Foam::writeEntry(os, "kappa", kappa_);
Foam::writeEntry(os, "E", E_);
Foam::writeEntry(os, "Ceps2", Ceps2_);
writeEntry(os, "Cmu", Cmu_);
writeEntry(os, "kappa", kappa_);
writeEntry(os, "E", E_);
writeEntry(os, "Ceps2", Ceps2_);
fixedValueFvPatchField<scalar>::write(os);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -131,7 +131,7 @@ template<class Type>
void Foam::kqRWallFunctionFvPatchField<Type>::write(Ostream& os) const
{
zeroGradientFvPatchField<Type>::write(os);
this->writeEntry("value", os);
writeEntry(os, "value", *this);
}

View File

@ -294,10 +294,10 @@ void nutURoughWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
writeLocalEntries(os);
Foam::writeEntry(os, "roughnessHeight", roughnessHeight_);
Foam::writeEntry(os, "roughnessConstant", roughnessConstant_);
Foam::writeEntry(os, "roughnessFactor", roughnessFactor_);
writeEntry("value", os);
writeEntry(os, "roughnessHeight", roughnessHeight_);
writeEntry(os, "roughnessConstant", roughnessConstant_);
writeEntry(os, "roughnessFactor", roughnessFactor_);
writeEntry(os, "value", *this);
}

Some files were not shown because too many files have changed in this diff Show More