Merge branch 'style-write-entry' into 'develop'

STYLE: use Ostream writeEntry when writing key/value entries

See merge request Development/OpenFOAM-plus!168
This commit is contained in:
Andrew Heather
2017-11-14 08:32:13 +00:00
232 changed files with 854 additions and 1291 deletions

View File

@ -209,16 +209,14 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_); os.writeEntryIfDifferent<word>("U", "U", UName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_); os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_); os.writeEntryIfDifferent<word>("mu", "thermo:mu", muName_);
os.writeKeyword("accommodationCoeff") os.writeEntry("accommodationCoeff", accommodationCoeff_);
<< accommodationCoeff_ << token::END_STATEMENT << nl;
Twall_.writeEntry("Twall", os); Twall_.writeEntry("Twall", os);
os.writeKeyword("gamma") os.writeEntry("gamma", gamma_);
<< gamma_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -200,18 +200,16 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "T", "T", TName_); os.writeEntryIfDifferent<word>("T", "T", TName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_); os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_); os.writeEntryIfDifferent<word>("mu", "thermo:mu", muName_);
writeEntryIfDifferent<word>(os, "tauMC", "tauMC", tauMCName_); os.writeEntryIfDifferent<word>("tauMC", "tauMC", tauMCName_);
os.writeKeyword("accommodationCoeff") os.writeEntry("accommodationCoeff", accommodationCoeff_);
<< accommodationCoeff_ << token::END_STATEMENT << nl;
Uwall_.writeEntry("Uwall", os); Uwall_.writeEntry("Uwall", os);
os.writeKeyword("thermalCreep") os.writeEntry("thermalCreep", thermalCreep_);
<< thermalCreep_ << token::END_STATEMENT << nl; os.writeEntry("curvature", curvature_);
os.writeKeyword("curvature") << curvature_ << token::END_STATEMENT << nl;
refValue().writeEntry("refValue", os); refValue().writeEntry("refValue", os);
valueFraction().writeEntry("valueFraction", os); valueFraction().writeEntry("valueFraction", os);

View File

@ -117,8 +117,8 @@ void Foam::fixedRhoFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
writeEntryIfDifferent<word>(os, "p", "p", this->pName_); os.writeEntryIfDifferent<word>("p", "p", pName_);
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_); os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -125,8 +125,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("thetaProperties") os.writeEntry("thetaProperties", thetaProps_);
<< thetaProps_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -125,8 +125,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("thetaProperties") os.writeEntry("thetaProperties", thetaProps_);
<< thetaProps_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -125,8 +125,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("thetaProperties") os.writeEntry("thetaProperties", thetaProps_);
<< thetaProps_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -125,8 +125,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("thetaProperties") os.writeEntry("thetaProperties", thetaProps_);
<< thetaProps_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -138,9 +138,9 @@ void alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::write
) const ) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl; os.writeEntry("relax", relax_);
os.writeKeyword("fixedDmdt") << fixedDmdt_ << token::END_STATEMENT << nl; os.writeEntry("fixedDmdt", fixedDmdt_);
os.writeKeyword("L") << L_ << token::END_STATEMENT << nl; os.writeEntry("L", L_);
dmdt_.writeEntry("dmdt", os); dmdt_.writeEntry("dmdt", os);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -334,10 +334,10 @@ void alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::write
) const ) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; os.writeEntry("Prt", Prt_);
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; os.writeEntry("Cmu", Cmu_);
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; os.writeEntry("kappa", kappa_);
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; os.writeEntry("E", E_);
dmdt_.writeEntry("dmdt", os); dmdt_.writeEntry("dmdt", os);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -596,42 +596,36 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
os.writeKeyword("phaseType") << phaseTypeNames_[phaseType_] os.writeEntry("phaseType", phaseTypeNames_[phaseType_]);
<< token::END_STATEMENT << nl;
os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl; os.writeEntry("relax", relax_);
switch (phaseType_) switch (phaseType_)
{ {
case vaporPhase: case vaporPhase:
{ {
os.writeKeyword("partitioningModel") << nl; os.beginBlock("partitioningModel");
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
partitioningModel_->write(os); partitioningModel_->write(os);
os << decrIndent << indent << token::END_BLOCK << nl; os.endBlock();
break; break;
} }
case liquidPhase: case liquidPhase:
{ {
os.writeKeyword("partitioningModel") << nl; os.beginBlock("partitioningModel");
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
partitioningModel_->write(os); partitioningModel_->write(os);
os << decrIndent << indent << token::END_BLOCK << nl; os.endBlock();
os.writeKeyword("nucleationSiteModel") << nl; os.beginBlock("nucleationSiteModel");
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
nucleationSiteModel_->write(os); nucleationSiteModel_->write(os);
os << decrIndent << indent << token::END_BLOCK << nl; os.endBlock();
os.writeKeyword("departureDiamModel") << nl; os.beginBlock("departureDiamModel");
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
departureDiamModel_->write(os); departureDiamModel_->write(os);
os << decrIndent << indent << token::END_BLOCK << nl; os.endBlock();
os.writeKeyword("departureFreqModel") << nl; os.beginBlock("departureFreqModel");
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
departureFreqModel_->write(os); departureFreqModel_->write(os);
os << decrIndent << indent << token::END_BLOCK << nl; os.endBlock();
break; break;
} }

View File

@ -109,8 +109,7 @@ void Foam::copiedFixedValueFvPatchScalarField::updateCoeffs()
void Foam::copiedFixedValueFvPatchScalarField::write(Ostream& os) const void Foam::copiedFixedValueFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
os.writeKeyword("sourceField") os.writeEntry("sourceField", sourceFieldName_);
<< sourceFieldName_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -183,7 +183,7 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs()
void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::write(Ostream& os) const void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl; os.writeEntry("relax", relax_);
q_.writeEntry("q", os); q_.writeEntry("q", os);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -114,7 +114,7 @@ void Foam::wallBoilingModels::departureDiameterModels::
KocamustafaogullariIshii::write(Ostream& os) const KocamustafaogullariIshii::write(Ostream& os) const
{ {
departureDiameterModel::write(os); departureDiameterModel::write(os);
os.writeKeyword("phi") << phi_ << token::END_STATEMENT << nl; os.writeEntry("phi", phi_);
} }

View File

@ -90,9 +90,9 @@ void Foam::wallBoilingModels::departureDiameterModels::
TolubinskiKostanchuk::write(Ostream& os) const TolubinskiKostanchuk::write(Ostream& os) const
{ {
departureDiameterModel::write(os); departureDiameterModel::write(os);
os.writeKeyword("dRef") << dRef_ << token::END_STATEMENT << nl; os.writeEntry("dRef", dRef_);
os.writeKeyword("dMax") << dMax_ << token::END_STATEMENT << nl; os.writeEntry("dMax", dMax_);
os.writeKeyword("dMin") << dMin_ << token::END_STATEMENT << nl; os.writeEntry("dMin", dMin_);
} }

View File

@ -53,7 +53,7 @@ Foam::wallBoilingModels::departureDiameterModel::~departureDiameterModel()
void Foam::wallBoilingModels::departureDiameterModel::write(Ostream& os) const void Foam::wallBoilingModels::departureDiameterModel::write(Ostream& os) const
{ {
os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl; os.writeEntry("type", this->type());
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -53,7 +53,7 @@ Foam::wallBoilingModels::departureFrequencyModel::~departureFrequencyModel()
void Foam::wallBoilingModels::departureFrequencyModel::write(Ostream& os) const void Foam::wallBoilingModels::departureFrequencyModel::write(Ostream& os) const
{ {
os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl; os.writeEntry("type", this->type());
} }

View File

@ -53,7 +53,7 @@ Foam::wallBoilingModels::nucleationSiteModel::~nucleationSiteModel()
void Foam::wallBoilingModels::nucleationSiteModel::write(Ostream& os) const void Foam::wallBoilingModels::nucleationSiteModel::write(Ostream& os) const
{ {
os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl; os.writeEntry("type", this->type());
} }

View File

@ -88,7 +88,7 @@ void Foam::wallBoilingModels::partitioningModels::
Lavieville::write(Ostream& os) const Lavieville::write(Ostream& os) const
{ {
partitioningModel::write(os); partitioningModel::write(os);
os.writeKeyword("alphaCrit") << alphaCrit_ << token::END_STATEMENT << nl; os.writeEntry("alphaCrit", alphaCrit_);
} }

View File

@ -97,10 +97,8 @@ void Foam::wallBoilingModels::partitioningModels::
cosine::write(Ostream& os) const cosine::write(Ostream& os) const
{ {
partitioningModel::write(os); partitioningModel::write(os);
os.writeKeyword("alphaLiquid1") << alphaLiquid1_ os.writeEntry("alphaLiquid1", alphaLiquid1_);
<< token::END_STATEMENT << nl; os.writeEntry("alphaLiquid0", alphaLiquid0_);
os.writeKeyword("alphaLiquid0") << alphaLiquid0_
<< token::END_STATEMENT << nl;
} }

View File

@ -90,10 +90,8 @@ void Foam::wallBoilingModels::partitioningModels::
linear::write(Ostream& os) const linear::write(Ostream& os) const
{ {
partitioningModel::write(os); partitioningModel::write(os);
os.writeKeyword("alphaLiquid1") << alphaLiquid1_ os.writeEntry("alphaLiquid1", alphaLiquid1_);
<< token::END_STATEMENT << nl; os.writeEntry("alphaLiquid0", alphaLiquid0_);
os.writeKeyword("alphaLiquid0") << alphaLiquid0_
<< token::END_STATEMENT << nl;
} }

View File

@ -53,7 +53,7 @@ Foam::wallBoilingModels::partitioningModel::~partitioningModel()
void Foam::wallBoilingModels::partitioningModel::write(Ostream& os) const void Foam::wallBoilingModels::partitioningModel::write(Ostream& os) const
{ {
os.writeKeyword("type") << this->type() << token::END_STATEMENT << nl; os.writeEntry("type", this->type());
} }

View File

@ -245,8 +245,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::write
) const ) const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
os.writeKeyword("specularityCoefficient") os.writeEntry("specularityCoefficient", specularityCoefficient_);
<< specularityCoefficient_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -289,10 +289,8 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::write
) const ) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("restitutionCoefficient") os.writeEntry("restitutionCoefficient", restitutionCoefficient_);
<< restitutionCoefficient_ << token::END_STATEMENT << nl; os.writeEntry("specularityCoefficient", specularityCoefficient_);
os.writeKeyword("specularityCoefficient")
<< specularityCoefficient_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -245,8 +245,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::write
) const ) const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
os.writeKeyword("specularityCoefficient") os.writeEntry("specularityCoefficient", specularityCoefficient_);
<< specularityCoefficient_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -289,10 +289,8 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::write
) const ) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("restitutionCoefficient") os.writeEntry("restitutionCoefficient", restitutionCoefficient_);
<< restitutionCoefficient_ << token::END_STATEMENT << nl; os.writeEntry("specularityCoefficient", specularityCoefficient_);
os.writeKeyword("specularityCoefficient")
<< specularityCoefficient_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

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

View File

@ -174,26 +174,12 @@ void Foam::cpuInfo::write(Ostream& os) const
{ {
os.writeEntry("model_name", model_name); os.writeEntry("model_name", model_name);
} }
if (cpu_family != -1)
{ os.writeEntryIfDifferent<int>("cpu_family", -1, cpu_family);
os.writeEntry("cpu_family", cpu_family); os.writeEntryIfDifferent<int>("model", -1, model);
} os.writeEntryIfDifferent<float>("cpu_MHz", 0, cpu_MHz);
if (model != -1) os.writeEntryIfDifferent<int>("cpu_cores", 0, cpu_cores);
{ os.writeEntryIfDifferent<int>("siblings", 0, siblings);
os.writeEntry("model", model);
}
if (cpu_MHz > 0)
{
os.writeEntry("cpu_MHz", cpu_MHz);
}
if (cpu_cores > 0)
{
os.writeEntry("cpu_cores", cpu_cores);
}
if (siblings > 0)
{
os.writeEntry("siblings", siblings);
}
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -211,6 +211,26 @@ public:
return endEntry(); return endEntry();
} }
//- Write a keyword/value entry only when the two values differ.
// \param key the name of the entry
// \param value1 the reference value
// \param value2 the value to write if it differs from value1
template<class T>
Ostream& writeEntryIfDifferent
(
const word& key,
const T& value1,
const T& value2
)
{
if (value1 != value2)
{
writeEntry(key, value2);
}
return *this;
}
// Stream state functions // Stream state functions

View File

@ -744,16 +744,15 @@ void Foam::Field<Type>::writeEntry(const word& keyword, Ostream& os) const
if (uniform) if (uniform)
{ {
os << "uniform " << this->operator[](0) << token::END_STATEMENT; os << "uniform " << this->operator[](0);
} }
else else
{ {
os << "nonuniform "; os << "nonuniform ";
List<Type>::writeEntry(os); List<Type>::writeEntry(os);
os << token::END_STATEMENT;
} }
os << endl; os << token::END_STATEMENT << nl;
} }

View File

@ -97,10 +97,8 @@ bool Foam::UniformDimensionedField<Type>::writeData(Ostream& os) const
{ {
scalar multiplier; scalar multiplier;
os.writeKeyword("dimensions"); os.writeKeyword("dimensions");
this->dimensions().write(os, multiplier) << token::END_STATEMENT this->dimensions().write(os, multiplier) << token::END_STATEMENT << nl;
<< nl; os.writeEntry("value", this->value()/multiplier) << nl;
os.writeKeyword("value") << this->value()/multiplier << token::END_STATEMENT
<< nl << nl;
return os.good(); return os.good();
} }

View File

@ -270,8 +270,7 @@ Foam::codedFixedValuePointPatchField<Type>::redirectPatchField() const
// Make sure to construct the patchfield with up-to-date value // Make sure to construct the patchfield with up-to-date value
OStringStream os; OStringStream os;
os.writeKeyword("type") << name_ << token::END_STATEMENT os.writeEntry("type", name_);
<< nl;
static_cast<const Field<Type>&>(*this).writeEntry("value", os); static_cast<const Field<Type>&>(*this).writeEntry("value", os);
IStringStream is(os.str()); IStringStream is(os.str());
dictionary dict(is); dictionary dict(is);
@ -333,8 +332,7 @@ template<class Type>
void Foam::codedFixedValuePointPatchField<Type>::write(Ostream& os) const void Foam::codedFixedValuePointPatchField<Type>::write(Ostream& os) const
{ {
fixedValuePointPatchField<Type>::write(os); fixedValuePointPatchField<Type>::write(os);
os.writeKeyword("name") << name_ os.writeEntry("name", name_);
<< token::END_STATEMENT << nl;
codedBase::writeCodeDict(os, dict_); codedBase::writeCodeDict(os, dict_);
} }

View File

@ -100,8 +100,7 @@ template<class Type>
void Foam::fixedNormalSlipPointPatchField<Type>::write(Ostream& os) const void Foam::fixedNormalSlipPointPatchField<Type>::write(Ostream& os) const
{ {
slipPointPatchField<Type>::write(os); slipPointPatchField<Type>::write(os);
os.writeKeyword("n") os.writeEntry("n", n_);
<< n_ << token::END_STATEMENT << nl;
} }

View File

@ -113,29 +113,11 @@ const Foam::objectRegistry& Foam::pointPatchField<Type>::db() const
template<class Type> template<class Type>
void Foam::pointPatchField<Type>::write(Ostream& os) const void Foam::pointPatchField<Type>::write(Ostream& os) const
{ {
os.writeKeyword("type") << type() << token::END_STATEMENT << nl; os.writeEntry("type", type());
if (patchType_.size()) if (patchType_.size())
{ {
os.writeKeyword("patchType") << patchType_ os.writeEntry("patchType", patchType_);
<< token::END_STATEMENT << nl;
}
}
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)
{
os.writeKeyword(entryName) << value2 << token::END_STATEMENT << nl;
} }
} }

View File

@ -436,17 +436,6 @@ public:
//- Write //- Write
virtual void write(Ostream&) const; 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 // Member operators

View File

@ -128,18 +128,12 @@ Foam::Ostream& Foam::profilingInformation::write
os.beginBlock(word("trigger" + Foam::name(id_))); os.beginBlock(word("trigger" + Foam::name(id_)));
os.writeEntry("id", id_); os.writeEntry("id", id_);
if (id_ != parent().id()) os.writeEntryIfDifferent("parentId", id_, parent().id());
{
os.writeEntry("parentId", parent().id());
}
os.writeEntry("description", description()); os.writeEntry("description", description());
os.writeEntry("calls", calls() + (offset ? 1 : 0)); os.writeEntry("calls", calls() + (offset ? 1 : 0));
os.writeEntry("totalTime", totalTime() + elapsedTime); os.writeEntry("totalTime", totalTime() + elapsedTime);
os.writeEntry("childTime", childTime() + childTimes); os.writeEntry("childTime", childTime() + childTimes);
if (maxMem_) os.writeEntryIfDifferent<int>("maxMem", 0, maxMem_);
{
os.writeEntry("maxMem", maxMem_);
}
os.writeEntry("onStack", Switch(onStack())); os.writeEntry("onStack", Switch(onStack()));
os.endBlock(); os.endBlock();

View File

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

View File

@ -173,10 +173,8 @@ void Foam::csvTableReader<Type>::write(Ostream& os) const
{ {
tableReader<Type>::write(os); tableReader<Type>::write(os);
os.writeKeyword("hasHeaderLine") os.writeEntry("hasHeaderLine", headerLine_);
<< headerLine_ << token::END_STATEMENT << nl; os.writeEntry("timeColumn", timeColumn_);
os.writeKeyword("timeColumn")
<< timeColumn_ << token::END_STATEMENT << nl;
// Force writing labelList in ascii // Force writing labelList in ascii
os.writeKeyword("valueColumns"); os.writeKeyword("valueColumns");
@ -186,10 +184,13 @@ void Foam::csvTableReader<Type>::write(Ostream& os) const
os << componentColumns_; os << componentColumns_;
os.format(IOstream::BINARY); os.format(IOstream::BINARY);
} }
else
{
os << componentColumns_;
}
os << token::END_STATEMENT << nl; os << token::END_STATEMENT << nl;
os.writeKeyword("separator") os.writeEntry("separator", string(separator_));
<< string(separator_) << token::END_STATEMENT << nl;
} }

View File

@ -74,10 +74,7 @@ Foam::tableReader<Type>::~tableReader()
template<class Type> template<class Type>
void Foam::tableReader<Type>::write(Ostream& os) const void Foam::tableReader<Type>::write(Ostream& os) const
{ {
if (this->type() != "openFoam") os.writeEntryIfDifferent<word>("readerType", "openFoam", this->type());
{
os.writeEntry("readerType", this->type());
}
} }

View File

@ -126,10 +126,10 @@ const Foam::word& Foam::genericPolyPatch::actualType() const
void Foam::genericPolyPatch::write(Ostream& os) const void Foam::genericPolyPatch::write(Ostream& os) const
{ {
os.writeKeyword("type") << actualTypeName_ << token::END_STATEMENT << nl; os.writeEntry("type", actualTypeName_);
patchIdentifier::write(os); patchIdentifier::write(os);
os.writeKeyword("nFaces") << size() << token::END_STATEMENT << nl; os.writeEntry("nFaces", size());
os.writeKeyword("startFace") << start() << token::END_STATEMENT << nl; os.writeEntry("startFace", start());
forAllConstIter(dictionary, dict_, iter) forAllConstIter(dictionary, dict_, iter)
{ {

View File

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

View File

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

View File

@ -1112,10 +1112,8 @@ bool Foam::processorPolyPatch::order
void Foam::processorPolyPatch::write(Ostream& os) const void Foam::processorPolyPatch::write(Ostream& os) const
{ {
coupledPolyPatch::write(os); coupledPolyPatch::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

@ -337,13 +337,8 @@ bool Foam::processorCyclicPolyPatch::order
void Foam::processorCyclicPolyPatch::write(Ostream& os) const void Foam::processorCyclicPolyPatch::write(Ostream& os) const
{ {
processorPolyPatch::write(os); processorPolyPatch::write(os);
os.writeKeyword("referPatch") << referPatchName_ os.writeEntry("referPatch", referPatchName_);
<< token::END_STATEMENT << nl; os.writeEntryIfDifferent<label>("tag", -1, tag_);
if (tag_ != -1)
{
os.writeKeyword("tag") << tag_
<< token::END_STATEMENT << nl;
}
} }

View File

@ -374,10 +374,10 @@ void Foam::polyPatch::clearAddressing()
void Foam::polyPatch::write(Ostream& os) const void Foam::polyPatch::write(Ostream& os) const
{ {
os.writeKeyword("type") << type() << token::END_STATEMENT << nl; os.writeEntry("type", type());
patchIdentifier::write(os); patchIdentifier::write(os);
os.writeKeyword("nFaces") << size() << token::END_STATEMENT << nl; os.writeEntry("nFaces", size());
os.writeKeyword("startFace") << start() << token::END_STATEMENT << nl; os.writeEntry("startFace", start());
} }

View File

@ -71,11 +71,13 @@ void Foam::Function1Types::Scale<Type>::writeData(Ostream& os) const
{ {
Function1<Type>::writeData(os); Function1<Type>::writeData(os);
os << token::END_STATEMENT << nl; os << token::END_STATEMENT << nl;
os << indent << word(this->name() + "Coeffs") << nl;
os << indent << token::BEGIN_BLOCK << incrIndent << nl; os.beginBlock(word(this->name() + "Coeffs"));
scale_->writeData(os); scale_->writeData(os);
value_->writeData(os); value_->writeData(os);
os << decrIndent << indent << token::END_BLOCK << endl;
os.endBlock();
} }

View File

@ -345,18 +345,19 @@ Foam::tmp<Foam::Field<Type>> Foam::Function1Types::TableBase<Type>::y() const
template<class Type> template<class Type>
void Foam::Function1Types::TableBase<Type>::writeEntries(Ostream& os) const void Foam::Function1Types::TableBase<Type>::writeEntries(Ostream& os) const
{ {
if (bounding_ != bounds::repeatableBounding::CLAMP) os.writeEntryIfDifferent<word>
{ (
os.writeEntry "outOfBounds",
( bounds::repeatableBoundingNames[bounds::repeatableBounding::CLAMP],
"outOfBounds", bounds::repeatableBoundingNames[bounding_]
bounds::repeatableBoundingNames[bounding_] );
);
} os.writeEntryIfDifferent<word>
if (interpolationScheme_ != "linear") (
{ "interpolationScheme",
os.writeEntry("interpolationScheme", interpolationScheme_); "linear",
} interpolationScheme_
);
} }

View File

@ -58,11 +58,13 @@ void Foam::Function1Types::ramp::writeData(Ostream& os) const
{ {
Function1<scalar>::writeData(os); Function1<scalar>::writeData(os);
os << token::END_STATEMENT << nl; os << token::END_STATEMENT << nl;
os << indent << word(this->name() + "Coeffs") << nl;
os << indent << token::BEGIN_BLOCK << incrIndent << nl; os.beginBlock(word(this->name() + "Coeffs"));
os.writeKeyword("start") << start_ << token::END_STATEMENT << nl;
os.writeKeyword("duration") << duration_ << token::END_STATEMENT << nl; os.writeEntry("start", start_);
os << decrIndent << indent << token::END_BLOCK << endl; os.writeEntry("duration", duration_);
os.endBlock();
} }

View File

@ -161,7 +161,7 @@ void convectiveHeatTransferFvPatchScalarField::updateCoeffs()
void convectiveHeatTransferFvPatchScalarField::write(Ostream& os) const void convectiveHeatTransferFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
os.writeKeyword("L") << L_ << token::END_STATEMENT << nl; os.writeEntry("L", L_);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -190,9 +190,8 @@ void Foam::lumpedMassWallTemperatureFvPatchScalarField::write
mixedFvPatchScalarField::write(os); mixedFvPatchScalarField::write(os);
temperatureCoupledBase::write(os); temperatureCoupledBase::write(os);
os.writeKeyword("Cp")<< Cp_ << token::END_STATEMENT << nl; os.writeEntry("Cp", Cp_);
os.writeKeyword("mass")<< mass_ os.writeEntry("mass", mass_);
<< token::END_STATEMENT << nl;
} }

View File

@ -189,12 +189,11 @@ void Foam::outletMappedUniformInletHeatAdditionFvPatchField::write
) const ) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("outletPatch") os.writeEntry("outletPatch", outletPatchName_);
<< outletPatchName_ << token::END_STATEMENT << nl; os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); os.writeEntry("Q", Q_);
os.writeKeyword("Q") << Q_ << token::END_STATEMENT << nl; os.writeEntry("TMin", TMin_);
os.writeKeyword("TMin") << TMin_ << token::END_STATEMENT << nl; os.writeEntry("TMax", TMax_);
os.writeKeyword("TMax") << TMax_ << token::END_STATEMENT << nl;
this->writeEntry("value", os); this->writeEntry("value", os);
} }

View File

@ -436,9 +436,8 @@ void thermalBaffle1DFvPatchScalarField<solidType>::write(Ostream& os) const
} }
qrPrevious_.writeEntry("qrPrevious", os); qrPrevious_.writeEntry("qrPrevious", os);
os.writeKeyword("qr")<< qrName_ << token::END_STATEMENT << nl; os.writeEntry("qr", qrName_);
os.writeKeyword("relaxation")<< qrRelaxation_ os.writeEntry("relaxation", qrRelaxation_);
<< token::END_STATEMENT << nl;
} }

View File

@ -202,10 +202,9 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::
write(Ostream& os) const write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; os.writeEntry("phi", phiName_);
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; os.writeEntry("rho", rhoName_);
os.writeKeyword("massFluxFraction") << massFluxFraction_ os.writeEntry("massFluxFraction", massFluxFraction_);
<< token::END_STATEMENT << nl;
this->writeEntry("value", os); this->writeEntry("value", os);
} }

View File

@ -260,8 +260,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write
) const ) const
{ {
mixedFvPatchScalarField::write(os); mixedFvPatchScalarField::write(os);
os.writeKeyword("Tnbr")<< TnbrName_ os.writeEntry("Tnbr", TnbrName_);
<< token::END_STATEMENT << nl;
thicknessLayers_.writeEntry("thicknessLayers", os); thicknessLayers_.writeEntry("thicknessLayers", os);
kappaLayers_.writeEntry("kappaLayers", os); kappaLayers_.writeEntry("kappaLayers", os);

View File

@ -343,12 +343,11 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::write
) const ) const
{ {
mixedFvPatchScalarField::write(os); mixedFvPatchScalarField::write(os);
os.writeKeyword("Tnbr")<< TnbrName_ << token::END_STATEMENT << nl; os.writeEntry("Tnbr", TnbrName_);
os.writeKeyword("qrNbr")<< qrNbrName_ << token::END_STATEMENT << nl; os.writeEntry("qrNbr", qrNbrName_);
os.writeKeyword("qr")<< qrName_ << token::END_STATEMENT << nl; os.writeEntry("qr", qrName_);
os.writeKeyword("thermalInertia")<< thermalInertia_ os.writeEntry("thermalInertia", thermalInertia_);
<< token::END_STATEMENT << nl;
thicknessLayers_.writeEntry("thicknessLayers", os); thicknessLayers_.writeEntry("thicknessLayers", os);
kappaLayers_.writeEntry("kappaLayers", os); kappaLayers_.writeEntry("kappaLayers", os);

View File

@ -300,10 +300,10 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
void alphatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const void alphatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; os.writeEntry("Prt", Prt_);
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; os.writeEntry("Cmu", Cmu_);
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; os.writeEntry("kappa", kappa_);
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; os.writeEntry("E", E_);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -129,7 +129,7 @@ void alphatWallFunctionFvPatchScalarField::updateCoeffs()
void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; os.writeEntry("Prt", Prt_);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -268,10 +268,10 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
void alphatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const void alphatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; os.writeEntry("Prt", Prt_);
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; os.writeEntry("Cmu", Cmu_);
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; os.writeEntry("kappa", kappa_);
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; os.writeEntry("E", E_);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -154,18 +154,12 @@ tmp<scalarField> atmBoundaryLayer::epsilon(const vectorField& p) const
void atmBoundaryLayer::write(Ostream& os) const void atmBoundaryLayer::write(Ostream& os) const
{ {
z0_.writeEntry("z0", os) ; z0_.writeEntry("z0", os) ;
os.writeKeyword("flowDir") os.writeEntry("flowDir", flowDir_);
<< flowDir_ << token::END_STATEMENT << nl; os.writeEntry("zDir", zDir_);
os.writeKeyword("zDir") os.writeEntry("kappa", kappa_);
<< zDir_ << token::END_STATEMENT << nl; os.writeEntry("Cmu", Cmu_);
os.writeKeyword("kappa") os.writeEntry("Uref", Uref_);
<< kappa_ << token::END_STATEMENT << nl; os.writeEntry("Zref", Zref_);
os.writeKeyword("Cmu")
<< Cmu_ << token::END_STATEMENT << nl;
os.writeKeyword("Uref")
<< Uref_ << token::END_STATEMENT << nl;
os.writeKeyword("Zref")
<< Zref_ << token::END_STATEMENT << nl;
zGround_.writeEntry("zGround", os) ; zGround_.writeEntry("zGround", os) ;
} }

View File

@ -159,10 +159,9 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write
) const ) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("mixingLength") os.writeEntry("mixingLength", mixingLength_);
<< mixingLength_ << token::END_STATEMENT << nl; os.writeEntry("phi", this->phiName_);
os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; os.writeEntry("k", kName_);
os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -155,10 +155,9 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::write
) const ) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("mixingLength") os.writeEntry("mixingLength", mixingLength_);
<< mixingLength_ << token::END_STATEMENT << nl; os.writeEntry("phi", this->phiName_);
os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; os.writeEntry("k", kName_);
os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -126,7 +126,7 @@ void Foam::fixedShearStressFvPatchVectorField::updateCoeffs()
void Foam::fixedShearStressFvPatchVectorField::write(Ostream& os) const void Foam::fixedShearStressFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
os.writeKeyword("tau") << tau0_ << token::END_STATEMENT << nl; os.writeEntry("tau", tau0_);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -190,13 +190,12 @@ void Foam::porousBafflePressureFvPatchField::updateCoeffs()
void Foam::porousBafflePressureFvPatchField::write(Ostream& os) const void Foam::porousBafflePressureFvPatchField::write(Ostream& os) const
{ {
fixedJumpFvPatchField<scalar>::write(os); fixedJumpFvPatchField<scalar>::write(os);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
D_->writeData(os); D_->writeData(os);
I_->writeData(os); I_->writeData(os);
os.writeKeyword("length") << length_ << token::END_STATEMENT << nl; os.writeEntry("length", length_);
os.writeKeyword("uniformJump") << uniformJump_ os.writeEntry("uniformJump", uniformJump_);
<< token::END_STATEMENT << nl;
} }

View File

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

View File

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

View File

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

View File

@ -294,12 +294,9 @@ void nutURoughWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
writeLocalEntries(os); writeLocalEntries(os);
os.writeKeyword("roughnessHeight") os.writeEntry("roughnessHeight", roughnessHeight_);
<< roughnessHeight_ << token::END_STATEMENT << nl; os.writeEntry("roughnessConstant", roughnessConstant_);
os.writeKeyword("roughnessConstant") os.writeEntry("roughnessFactor", roughnessFactor_);
<< roughnessConstant_ << token::END_STATEMENT << nl;
os.writeKeyword("roughnessFactor")
<< roughnessFactor_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -204,8 +204,7 @@ tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::yPlus() const
void nutUTabulatedWallFunctionFvPatchScalarField::write(Ostream& os) const void nutUTabulatedWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
os.writeKeyword("uPlusTable") << uPlusTableName_ os.writeEntry("uPlusTable", uPlusTableName_);
<< token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -57,9 +57,9 @@ void Foam::nutWallFunctionFvPatchScalarField::writeLocalEntries
Ostream& os Ostream& os
) const ) const
{ {
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; os.writeEntry("Cmu", Cmu_);
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; os.writeEntry("kappa", kappa_);
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; os.writeEntry("E", E_);
} }

View File

@ -59,11 +59,11 @@ void omegaWallFunctionFvPatchScalarField::checkType()
void omegaWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const void omegaWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
{ {
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; os.writeEntry("Cmu", Cmu_);
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; os.writeEntry("kappa", kappa_);
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; os.writeEntry("E", E_);
os.writeKeyword("beta1") << beta1_ << token::END_STATEMENT << nl; os.writeEntry("beta1", beta1_);
os.writeKeyword("blended") << blended_ << token::END_STATEMENT << nl; os.writeEntry("blended", blended_);
} }

View File

@ -55,9 +55,9 @@ void v2WallFunctionFvPatchScalarField::checkType()
void v2WallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const void v2WallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
{ {
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; os.writeEntry("Cmu", Cmu_);
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; os.writeEntry("kappa", kappa_);
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; os.writeEntry("E", E_);
} }

View File

@ -463,22 +463,18 @@ void Foam::attachDetach::write(Ostream& os) const
void Foam::attachDetach::writeDict(Ostream& os) const void Foam::attachDetach::writeDict(Ostream& os) const
{ {
os << nl << name() << nl << token::BEGIN_BLOCK << nl os << nl;
<< " type " << type() os.beginBlock(name());
<< token::END_STATEMENT << nl
<< " faceZoneName " << faceZoneID_.name() os.writeEntry("type", type());
<< token::END_STATEMENT << nl os.writeEntry("faceZoneName", faceZoneID_.name());
<< " masterPatchName " << masterPatchID_.name() os.writeEntry("masterPatchName", masterPatchID_.name());
<< token::END_STATEMENT << nl os.writeEntry("slavePatchName", slavePatchID_.name());
<< " slavePatchName " << slavePatchID_.name() os.writeEntry("triggerTimes", triggerTimes_);
<< token::END_STATEMENT << nl os.writeEntry("manualTrigger", manualTrigger());
<< " triggerTimes " << triggerTimes_ os.writeEntry("active", active());
<< token::END_STATEMENT << nl
<< " manualTrigger " << manualTrigger() os.endBlock();
<< token::END_STATEMENT << nl
<< " active " << active()
<< token::END_STATEMENT << nl
<< token::END_BLOCK << endl;
} }

View File

@ -90,8 +90,8 @@ Foam::boundaryPatch::~boundaryPatch()
void Foam::boundaryPatch::write(Ostream& os) const void Foam::boundaryPatch::write(Ostream& os) const
{ {
patchIdentifier::write(os); patchIdentifier::write(os);
os.writeKeyword("nFaces") << size_ << token::END_STATEMENT << nl; os.writeEntry("nFaces", size_);
os.writeKeyword("startFace") << start_ << token::END_STATEMENT << nl; os.writeEntry("startFace", start_);
} }

View File

@ -174,8 +174,8 @@ write(Ostream& os) const
// Note: write value // Note: write value
fixedValuePointPatchVectorField::write(os); fixedValuePointPatchVectorField::write(os);
os.writeKeyword(solidBodyMotionFunction::typeName) << SBMFPtr_->type() os.writeEntry(solidBodyMotionFunction::typeName, SBMFPtr_->type());
<< token::END_STATEMENT << nl;
os << indent << word(SBMFPtr_->type() + "Coeffs"); os << indent << word(SBMFPtr_->type() + "Coeffs");
SBMFPtr_->writeData(os); SBMFPtr_->writeData(os);
} }

View File

@ -506,34 +506,16 @@ void Foam::perfectInterface::write(Ostream& os) const
void Foam::perfectInterface::writeDict(Ostream& os) const void Foam::perfectInterface::writeDict(Ostream& os) const
{ {
os << nl << name() << nl << token::BEGIN_BLOCK << nl os << nl;
<< " type " << type() os.beginBlock(name());
<< token::END_STATEMENT << nl os.writeEntry("type", type());
os.writeEntry("active", active());
<< " active " << active() os.writeEntry("faceZoneName", faceZoneID_.name());
<< token::END_STATEMENT << nl os.writeEntry("masterPatchName", masterPatchID_.name());
os.writeEntry("slavePatchName", slavePatchID_.name());
<< " faceZoneName " << faceZoneID_.name() os.endBlock();
<< token::END_STATEMENT << nl
<< " masterPatchName " << masterPatchID_.name()
<< token::END_STATEMENT << nl
<< " slavePatchName " << slavePatchID_.name()
<< token::END_STATEMENT << nl
<< token::END_BLOCK << endl;
} }
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// ************************************************************************* // // ************************************************************************* //

View File

@ -45,14 +45,8 @@ namespace Foam
); );
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from dictionary
Foam::setUpdater::setUpdater Foam::setUpdater::setUpdater
( (
const word& name, const word& name,
@ -111,22 +105,13 @@ void Foam::setUpdater::write(Ostream& os) const
void Foam::setUpdater::writeDict(Ostream& os) const void Foam::setUpdater::writeDict(Ostream& os) const
{ {
os << nl << name() << nl << token::BEGIN_BLOCK << nl os << nl;
<< " type " << type()
<< token::END_STATEMENT << nl os.beginBlock(name());
<< " active " << active() os.writeEntry("type", type());
<< token::END_STATEMENT << nl os.writeEntry("active", active());
<< token::END_BLOCK << endl; os.endBlock();
} }
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// ************************************************************************* // // ************************************************************************* //

View File

@ -765,30 +765,22 @@ void Foam::slidingInterface::write(Ostream& os) const
void Foam::slidingInterface::writeDict(Ostream& os) const void Foam::slidingInterface::writeDict(Ostream& os) const
{ {
os << nl << name() << nl << token::BEGIN_BLOCK << nl os << nl;
<< " type " << type() << token::END_STATEMENT << nl
<< " masterFaceZoneName " << masterFaceZoneID_.name() os.beginBlock(name());
<< token::END_STATEMENT << nl
<< " slaveFaceZoneName " << slaveFaceZoneID_.name() os.writeEntry("type", type());
<< token::END_STATEMENT << nl os.writeEntry("masterFaceZoneName", masterFaceZoneID_.name());
<< " cutPointZoneName " << cutPointZoneID_.name() os.writeEntry("slaveFaceZoneName", slaveFaceZoneID_.name());
<< token::END_STATEMENT << nl os.writeEntry("cutPointZoneName", cutPointZoneID_.name());
<< " cutFaceZoneName " << cutFaceZoneID_.name() os.writeEntry("cutFaceZoneName", cutFaceZoneID_.name());
<< token::END_STATEMENT << nl os.writeEntry("masterPatchName", masterPatchID_.name());
<< " masterPatchName " << masterPatchID_.name() os.writeEntry("slavePatchName", slavePatchID_.name());
<< token::END_STATEMENT << nl os.writeEntry("typeOfMatch", typeOfMatchNames_[matchType_]);
<< " slavePatchName " << slavePatchID_.name() os.writeEntry("coupleDecouple", coupleDecouple_);
<< token::END_STATEMENT << nl os.writeEntry("projection", intersection::algorithmNames_[projectionAlgo_]);
<< " typeOfMatch " << typeOfMatchNames_[matchType_] os.writeEntry("attached", attached_);
<< token::END_STATEMENT << nl os.writeEntry("active", active());
<< " coupleDecouple " << coupleDecouple_
<< token::END_STATEMENT << nl
<< " projection " << intersection::algorithmNames_[projectionAlgo_]
<< token::END_STATEMENT << nl
<< " attached " << attached_
<< token::END_STATEMENT << nl
<< " active " << active()
<< token::END_STATEMENT << nl;
if (attached_) if (attached_)
{ {
@ -797,10 +789,8 @@ void Foam::slidingInterface::writeDict(Ostream& os) const
masterStickOutFacesPtr_->writeEntry("masterStickOutFaces", os); masterStickOutFacesPtr_->writeEntry("masterStickOutFaces", os);
slaveStickOutFacesPtr_->writeEntry("slaveStickOutFaces", os); slaveStickOutFacesPtr_->writeEntry("slaveStickOutFaces", os);
os << " retiredPointMap " << retiredPointMap() os.writeEntry("retiredPointMap", retiredPointMap());
<< token::END_STATEMENT << nl os.writeEntry("cutPointEdgePairMap", cutPointEdgePairMap());
<< " cutPointEdgePairMap " << cutPointEdgePairMap()
<< token::END_STATEMENT << nl;
} }
WRITE_NON_DEFAULT(pointMergeTol) WRITE_NON_DEFAULT(pointMergeTol)
@ -812,7 +802,7 @@ void Foam::slidingInterface::writeDict(Ostream& os) const
WRITE_NON_DEFAULT(edgeCoPlanarTol) WRITE_NON_DEFAULT(edgeCoPlanarTol)
WRITE_NON_DEFAULT(edgeEndCutoffTol) WRITE_NON_DEFAULT(edgeEndCutoffTol)
os << token::END_BLOCK << endl; os.endBlock();
} }

View File

@ -571,21 +571,20 @@ void Foam::MRFZone::correctBoundaryVelocity(volVectorField& U) const
void Foam::MRFZone::writeData(Ostream& os) const void Foam::MRFZone::writeData(Ostream& os) const
{ {
os << nl; os << nl;
os.write(name_) << nl; os.beginBlock(name_);
os << token::BEGIN_BLOCK << incrIndent << nl;
os.writeKeyword("active") << active_ << token::END_STATEMENT << nl; os.writeEntry("active", active_);
os.writeKeyword("cellZone") << cellZoneName_ << token::END_STATEMENT << nl; os.writeEntry("cellZone", cellZoneName_);
os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl; os.writeEntry("origin", origin_);
os.writeKeyword("axis") << axis_ << token::END_STATEMENT << nl; os.writeEntry("axis", axis_);
omega_->writeData(os); omega_->writeData(os);
if (excludedPatchNames_.size()) if (excludedPatchNames_.size())
{ {
os.writeKeyword("nonRotatingPatches") << excludedPatchNames_ os.writeEntry("nonRotatingPatches", excludedPatchNames_);
<< token::END_STATEMENT << nl;
} }
os << decrIndent << token::END_BLOCK << nl; os.endBlock();
} }

View File

@ -158,9 +158,9 @@ void Foam::SRFFreestreamVelocityFvPatchVectorField::updateCoeffs()
void Foam::SRFFreestreamVelocityFvPatchVectorField::write(Ostream& os) const void Foam::SRFFreestreamVelocityFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
os.writeKeyword("relative") << relative_ << token::END_STATEMENT << nl; os.writeEntry("relative", relative_);
os.writeKeyword("UInf") << UInf_ << token::END_STATEMENT << nl; os.writeEntry("UInf", UInf_);
os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; os.writeEntry("phi", this->phiName_);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -153,7 +153,7 @@ void Foam::SRFVelocityFvPatchVectorField::updateCoeffs()
void Foam::SRFVelocityFvPatchVectorField::write(Ostream& os) const void Foam::SRFVelocityFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
os.writeKeyword("relative") << relative_ << token::END_STATEMENT << nl; os.writeEntry("relative", relative_);
inletValue_.writeEntry("inletValue", os); inletValue_.writeEntry("inletValue", os);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -29,24 +29,23 @@ License
void Foam::fv::option::writeHeader(Ostream& os) const void Foam::fv::option::writeHeader(Ostream& os) const
{ {
os << indent << name_ << nl os.beginBlock(name_);
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
} }
void Foam::fv::option::writeFooter(Ostream& os) const void Foam::fv::option::writeFooter(Ostream& os) const
{ {
os << decrIndent << indent << token::END_BLOCK << endl; os.endBlock();
} }
void Foam::fv::option::writeData(Ostream& os) const void Foam::fv::option::writeData(Ostream& os) const
{ {
os.writeKeyword("type") << type() << token::END_STATEMENT << nl; os.writeEntry("type", type());
os.writeKeyword("active") << active_ << token::END_STATEMENT << nl << nl; os.writeEntry("active", active_);
os << indent << word(type() + "Coeffs"); os << nl;
coeffs_.write(os); coeffs_.writeEntry(word(type() + "Coeffs"), os);
} }

View File

@ -292,18 +292,12 @@ void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs()
void Foam::activeBaffleVelocityFvPatchVectorField::write(Ostream& os) const void Foam::activeBaffleVelocityFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "p", "p", pName_); os.writeEntryIfDifferent<word>("p", "p", pName_);
os.writeKeyword("cyclicPatch") os.writeEntry("cyclicPatch", cyclicPatchName_);
<< cyclicPatchName_ << token::END_STATEMENT << nl; os.writeEntry("orientation", orientation_);
os.writeKeyword("orientation") os.writeEntry("openingTime", openingTime_);
<< orientation_ << token::END_STATEMENT << nl; os.writeEntry("maxOpenFractionDelta", maxOpenFractionDelta_);
os.writeKeyword("openingTime") os.writeEntry("openFraction", openFraction_);
<< openingTime_ << token::END_STATEMENT << nl;
os.writeKeyword("maxOpenFractionDelta")
<< maxOpenFractionDelta_ << token::END_STATEMENT << nl;
os.writeKeyword("openFraction")
<< openFraction_ << token::END_STATEMENT << nl;
writeEntryIfDifferent<word>(os, "p", "p", pName_);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -377,21 +377,14 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::
write(Ostream& os) const write(Ostream& os) const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "p", "p", pName_); os.writeEntryIfDifferent<word>("p", "p", pName_);
os.writeKeyword("cyclicPatch") os.writeEntry("cyclicPatch", cyclicPatchName_);
<< cyclicPatchName_ << token::END_STATEMENT << nl; os.writeEntry("openingTime", openingTime_);
os.writeKeyword("openingTime") os.writeEntry("maxOpenFractionDelta", maxOpenFractionDelta_);
<< openingTime_ << token::END_STATEMENT << nl; os.writeEntry("openFraction", openFraction_);
os.writeKeyword("maxOpenFractionDelta") os.writeEntry("minThresholdValue", minThresholdValue_);
<< maxOpenFractionDelta_ << token::END_STATEMENT << nl; os.writeEntry("forceBased", fBased_);
os.writeKeyword("openFraction") os.writeEntry("opening", opening_);
<< openFraction_ << token::END_STATEMENT << nl;
os.writeKeyword("minThresholdValue")
<< minThresholdValue_ << token::END_STATEMENT << nl;
os.writeKeyword("forceBased")
<< fBased_ << token::END_STATEMENT << nl;
os.writeKeyword("opening")
<< opening_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -339,13 +339,13 @@ void Foam::advectiveFvPatchField<Type>::write(Ostream& os) const
{ {
fvPatchField<Type>::write(os); fvPatchField<Type>::write(os);
this->template writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
this->template writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
if (lInf_ > 0) if (lInf_ > 0)
{ {
os.writeKeyword("fieldInf") << fieldInf_ << token::END_STATEMENT << nl; os.writeEntry("fieldInf", fieldInf_);
os.writeKeyword("lInf") << lInf_ << token::END_STATEMENT << nl; os.writeEntry("lInf", lInf_);
} }
this->writeEntry("value", os); this->writeEntry("value", os);

View File

@ -268,8 +268,7 @@ Foam::codedFixedValueFvPatchField<Type>::redirectPatchField() const
// Make sure to construct the patchfield with up-to-date value // Make sure to construct the patchfield with up-to-date value
OStringStream os; OStringStream os;
os.writeKeyword("type") << name_ << token::END_STATEMENT os.writeEntry("type", name_);
<< nl;
static_cast<const Field<Type>&>(*this).writeEntry("value", os); static_cast<const Field<Type>&>(*this).writeEntry("value", os);
IStringStream is(os.str()); IStringStream is(os.str());
dictionary dict(is); dictionary dict(is);
@ -331,8 +330,7 @@ template<class Type>
void Foam::codedFixedValueFvPatchField<Type>::write(Ostream& os) const void Foam::codedFixedValueFvPatchField<Type>::write(Ostream& os) const
{ {
fixedValueFvPatchField<Type>::write(os); fixedValueFvPatchField<Type>::write(os);
os.writeKeyword("name") << name_ os.writeEntry("name", name_);
<< token::END_STATEMENT << nl;
codedBase::writeCodeDict(os, dict_); codedBase::writeCodeDict(os, dict_);
} }

View File

@ -343,8 +343,7 @@ template<class Type>
void Foam::codedMixedFvPatchField<Type>::write(Ostream& os) const void Foam::codedMixedFvPatchField<Type>::write(Ostream& os) const
{ {
mixedFvPatchField<Type>::write(os); mixedFvPatchField<Type>::write(os);
os.writeKeyword("name") << name_ os.writeEntry("name", name_);
<< token::END_STATEMENT << nl;
codedBase::writeCodeDict(os, dict_); codedBase::writeCodeDict(os, dict_);
} }

View File

@ -147,8 +147,8 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::updateCoeffs()
void Foam::cylindricalInletVelocityFvPatchVectorField::write(Ostream& os) const void Foam::cylindricalInletVelocityFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchField<vector>::write(os); fvPatchField<vector>::write(os);
os.writeKeyword("centre") << centre_ << token::END_STATEMENT << nl; os.writeEntry("centre", centre_);
os.writeKeyword("axis") << axis_ << token::END_STATEMENT << nl; os.writeEntry("axis", axis_);
axialVelocity_->writeData(os); axialVelocity_->writeData(os);
radialVelocity_->writeData(os); radialVelocity_->writeData(os);
rpm_->writeData(os); rpm_->writeData(os);

View File

@ -132,12 +132,9 @@ template<class Type>
void Foam::fanFvPatchField<Type>::write(Ostream& os) const void Foam::fanFvPatchField<Type>::write(Ostream& os) const
{ {
uniformJumpFvPatchField<Type>::write(os); uniformJumpFvPatchField<Type>::write(os);
this->template writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
this->template writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
this->template writeEntryIfDifferent<bool> os.writeEntryIfDifferent<bool>("uniformJump", false, uniformJump_);
(
os, "uniformJump", false, uniformJump_
);
} }

View File

@ -155,8 +155,7 @@ template<class Type>
void Foam::fixedJumpFvPatchField<Type>::write(Ostream& os) const void Foam::fixedJumpFvPatchField<Type>::write(Ostream& os) const
{ {
fvPatchField<Type>::write(os); fvPatchField<Type>::write(os);
os.writeKeyword("patchType") << this->interfaceFieldType() os.writeEntry("patchType", this->interfaceFieldType());
<< token::END_STATEMENT << nl;
if (this->cyclicPatch().owner()) if (this->cyclicPatch().owner())
{ {

View File

@ -169,8 +169,7 @@ template<class Type>
void Foam::fixedJumpAMIFvPatchField<Type>::write(Ostream& os) const void Foam::fixedJumpAMIFvPatchField<Type>::write(Ostream& os) const
{ {
fvPatchField<Type>::write(os); fvPatchField<Type>::write(os);
os.writeKeyword("patchType") << this->interfaceFieldType() os.writeEntry("patchType", this->interfaceFieldType());
<< token::END_STATEMENT << nl;
if (this->cyclicAMIPatch().owner()) if (this->cyclicAMIPatch().owner())
{ {

View File

@ -181,13 +181,13 @@ void Foam::fixedNormalInletOutletVelocityFvPatchVectorField::write
const const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
os.writeKeyword("fixTangentialInflow") os.writeEntry("fixTangentialInflow", fixTangentialInflow_);
<< fixTangentialInflow_ << token::END_STATEMENT << nl;
os.writeKeyword("normalVelocity") os.beginBlock("normalVelocity");
<< nl << indent << token::BEGIN_BLOCK << nl << incrIndent;
normalVelocity_->write(os); normalVelocity_->write(os);
os << decrIndent << indent << token::END_BLOCK << endl; os.endBlock();
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -128,7 +128,7 @@ void Foam::fixedPressureCompressibleDensityFvPatchScalarField::write
) const ) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
writeEntryIfDifferent<word>(os, "p", "p", pName_); os.writeEntryIfDifferent<word>("p", "p", pName_);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -158,8 +158,8 @@ void Foam::fixedProfileFvPatchField<Type>::write(Ostream& os) const
{ {
fvPatchField<Type>::write(os); fvPatchField<Type>::write(os);
profile_->writeData(os); profile_->writeData(os);
os.writeKeyword("direction") << dir_ << token::END_STATEMENT << nl; os.writeEntry("direction", dir_);
os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl; os.writeEntry("origin", origin_);
this->writeEntry("value", os); this->writeEntry("value", os);
} }

View File

@ -243,11 +243,10 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
flowRate_->writeData(os); flowRate_->writeData(os);
if (!volumetric_) if (!volumetric_)
{ {
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
writeEntryIfDifferent<scalar>(os, "rhoInlet", -VGREAT, rhoInlet_); os.writeEntryIfDifferent<scalar>("rhoInlet", -VGREAT, rhoInlet_);
} }
os.writeKeyword("extrapolateProfile") os.writeEntry("extrapolateProfile", extrapolateProfile_);
<< extrapolateProfile_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -228,8 +228,8 @@ void Foam::flowRateOutletVelocityFvPatchVectorField::write(Ostream& os) const
flowRate_->writeData(os); flowRate_->writeData(os);
if (!volumetric_) if (!volumetric_)
{ {
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
writeEntryIfDifferent<scalar>(os, "rhoOutlet", -VGREAT, rhoOutlet_); os.writeEntryIfDifferent<scalar>("rhoOutlet", -VGREAT, rhoOutlet_);
} }
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -138,8 +138,8 @@ void Foam::fluxCorrectedVelocityFvPatchVectorField::evaluate
void Foam::fluxCorrectedVelocityFvPatchVectorField::write(Ostream& os) const void Foam::fluxCorrectedVelocityFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -108,11 +108,7 @@ template<class Type>
void Foam::freestreamFvPatchField<Type>::write(Ostream& os) const void Foam::freestreamFvPatchField<Type>::write(Ostream& os) const
{ {
fvPatchField<Type>::write(os); fvPatchField<Type>::write(os);
if (this->phiName_ != "phi") os.writeEntryIfDifferent<word>("phi", "phi", this->phiName_);
{
os.writeKeyword("phi")
<< this->phiName_ << token::END_STATEMENT << nl;
}
freestreamValue().writeEntry("freestreamValue", os); freestreamValue().writeEntry("freestreamValue", os);
this->writeEntry("value", os); this->writeEntry("value", os);
} }

View File

@ -156,9 +156,9 @@ void Foam::freestreamPressureFvPatchScalarField::updateCoeffs()
void Foam::freestreamPressureFvPatchScalarField::write(Ostream& os) const void Foam::freestreamPressureFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_); os.writeEntryIfDifferent<word>("U", "U", UName_);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -138,10 +138,7 @@ template<class Type>
void Foam::inletOutletFvPatchField<Type>::write(Ostream& os) const void Foam::inletOutletFvPatchField<Type>::write(Ostream& os) const
{ {
fvPatchField<Type>::write(os); fvPatchField<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

@ -189,10 +189,10 @@ void Foam::inletOutletTotalTemperatureFvPatchScalarField::write(Ostream& os)
const const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_); os.writeEntryIfDifferent<word>("U", "U", UName_);
writeEntryIfDifferent<word>(os, "phi", "phi", this->phiName_); os.writeEntryIfDifferent<word>("phi", "phi", this->phiName_);
writeEntryIfDifferent<word>(os, "psi", "psi", psiName_); os.writeEntryIfDifferent<word>("psi", "psi", psiName_);
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; os.writeEntry("gamma", gamma_);
T0_.writeEntry("T0", os); T0_.writeEntry("T0", os);
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -143,7 +143,7 @@ void Foam::interstitialInletVelocityFvPatchVectorField::updateCoeffs()
void Foam::interstitialInletVelocityFvPatchVectorField::write(Ostream& os) const void Foam::interstitialInletVelocityFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchField<vector>::write(os); fvPatchField<vector>::write(os);
writeEntryIfDifferent<word>(os, "alpha", "alpha", alphaName_); os.writeEntryIfDifferent<word>("alpha", "alpha", alphaName_);
inletVelocity_.writeEntry("inletVelocity", os); inletVelocity_.writeEntry("inletVelocity", os);
writeEntry("value", os); writeEntry("value", os);
} }

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