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);
writeEntryIfDifferent<word>(os, "U", "U", UName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_);
os.writeEntryIfDifferent<word>("U", "U", UName_);
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
os.writeEntryIfDifferent<word>("mu", "thermo:mu", muName_);
os.writeKeyword("accommodationCoeff")
<< accommodationCoeff_ << token::END_STATEMENT << nl;
os.writeEntry("accommodationCoeff", accommodationCoeff_);
Twall_.writeEntry("Twall", os);
os.writeKeyword("gamma")
<< gamma_ << token::END_STATEMENT << nl;
os.writeEntry("gamma", gamma_);
writeEntry("value", os);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -114,7 +114,7 @@ void Foam::wallBoilingModels::departureDiameterModels::
KocamustafaogullariIshii::write(Ostream& os) const
{
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
{
departureDiameterModel::write(os);
os.writeKeyword("dRef") << dRef_ << token::END_STATEMENT << nl;
os.writeKeyword("dMax") << dMax_ << token::END_STATEMENT << nl;
os.writeKeyword("dMin") << dMin_ << token::END_STATEMENT << nl;
os.writeEntry("dRef", dRef_);
os.writeEntry("dMax", dMax_);
os.writeEntry("dMin", dMin_);
}

View File

@ -53,7 +53,7 @@ Foam::wallBoilingModels::departureDiameterModel::~departureDiameterModel()
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
{
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
{
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
{
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
{
partitioningModel::write(os);
os.writeKeyword("alphaLiquid1") << alphaLiquid1_
<< token::END_STATEMENT << nl;
os.writeKeyword("alphaLiquid0") << alphaLiquid0_
<< token::END_STATEMENT << nl;
os.writeEntry("alphaLiquid1", alphaLiquid1_);
os.writeEntry("alphaLiquid0", alphaLiquid0_);
}

View File

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

View File

@ -53,7 +53,7 @@ Foam::wallBoilingModels::partitioningModel::~partitioningModel()
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
{
fvPatchVectorField::write(os);
os.writeKeyword("specularityCoefficient")
<< specularityCoefficient_ << token::END_STATEMENT << nl;
os.writeEntry("specularityCoefficient", specularityCoefficient_);
writeEntry("value", os);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -211,6 +211,26 @@ public:
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

View File

@ -744,16 +744,15 @@ void Foam::Field<Type>::writeEntry(const word& keyword, Ostream& os) const
if (uniform)
{
os << "uniform " << this->operator[](0) << token::END_STATEMENT;
os << "uniform " << this->operator[](0);
}
else
{
os << "nonuniform ";
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;
os.writeKeyword("dimensions");
this->dimensions().write(os, multiplier) << token::END_STATEMENT
<< nl;
os.writeKeyword("value") << this->value()/multiplier << token::END_STATEMENT
<< nl << nl;
this->dimensions().write(os, multiplier) << token::END_STATEMENT << nl;
os.writeEntry("value", this->value()/multiplier) << nl;
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
OStringStream os;
os.writeKeyword("type") << name_ << token::END_STATEMENT
<< nl;
os.writeEntry("type", name_);
static_cast<const Field<Type>&>(*this).writeEntry("value", os);
IStringStream is(os.str());
dictionary dict(is);
@ -333,8 +332,7 @@ template<class Type>
void Foam::codedFixedValuePointPatchField<Type>::write(Ostream& os) const
{
fixedValuePointPatchField<Type>::write(os);
os.writeKeyword("name") << name_
<< token::END_STATEMENT << nl;
os.writeEntry("name", name_);
codedBase::writeCodeDict(os, dict_);
}

View File

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

View File

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

View File

@ -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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -71,11 +71,13 @@ void Foam::Function1Types::Scale<Type>::writeData(Ostream& os) const
{
Function1<Type>::writeData(os);
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);
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>
void Foam::Function1Types::TableBase<Type>::writeEntries(Ostream& os) const
{
if (bounding_ != bounds::repeatableBounding::CLAMP)
{
os.writeEntry
(
"outOfBounds",
bounds::repeatableBoundingNames[bounding_]
);
}
if (interpolationScheme_ != "linear")
{
os.writeEntry("interpolationScheme", interpolationScheme_);
}
os.writeEntryIfDifferent<word>
(
"outOfBounds",
bounds::repeatableBoundingNames[bounds::repeatableBounding::CLAMP],
bounds::repeatableBoundingNames[bounding_]
);
os.writeEntryIfDifferent<word>
(
"interpolationScheme",
"linear",
interpolationScheme_
);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -45,14 +45,8 @@ namespace Foam
);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from dictionary
Foam::setUpdater::setUpdater
(
const word& name,
@ -111,22 +105,13 @@ void Foam::setUpdater::write(Ostream& os) const
void Foam::setUpdater::writeDict(Ostream& os) const
{
os << nl << name() << nl << token::BEGIN_BLOCK << nl
<< " type " << type()
<< token::END_STATEMENT << nl
<< " active " << active()
<< token::END_STATEMENT << nl
<< token::END_BLOCK << endl;
os << nl;
os.beginBlock(name());
os.writeEntry("type", type());
os.writeEntry("active", active());
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
{
os << nl << name() << nl << token::BEGIN_BLOCK << nl
<< " type " << type() << token::END_STATEMENT << nl
<< " masterFaceZoneName " << masterFaceZoneID_.name()
<< token::END_STATEMENT << nl
<< " slaveFaceZoneName " << slaveFaceZoneID_.name()
<< token::END_STATEMENT << nl
<< " cutPointZoneName " << cutPointZoneID_.name()
<< token::END_STATEMENT << nl
<< " cutFaceZoneName " << cutFaceZoneID_.name()
<< token::END_STATEMENT << nl
<< " masterPatchName " << masterPatchID_.name()
<< token::END_STATEMENT << nl
<< " slavePatchName " << slavePatchID_.name()
<< token::END_STATEMENT << nl
<< " typeOfMatch " << typeOfMatchNames_[matchType_]
<< token::END_STATEMENT << nl
<< " 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;
os << nl;
os.beginBlock(name());
os.writeEntry("type", type());
os.writeEntry("masterFaceZoneName", masterFaceZoneID_.name());
os.writeEntry("slaveFaceZoneName", slaveFaceZoneID_.name());
os.writeEntry("cutPointZoneName", cutPointZoneID_.name());
os.writeEntry("cutFaceZoneName", cutFaceZoneID_.name());
os.writeEntry("masterPatchName", masterPatchID_.name());
os.writeEntry("slavePatchName", slavePatchID_.name());
os.writeEntry("typeOfMatch", typeOfMatchNames_[matchType_]);
os.writeEntry("coupleDecouple", coupleDecouple_);
os.writeEntry("projection", intersection::algorithmNames_[projectionAlgo_]);
os.writeEntry("attached", attached_);
os.writeEntry("active", active());
if (attached_)
{
@ -797,10 +789,8 @@ void Foam::slidingInterface::writeDict(Ostream& os) const
masterStickOutFacesPtr_->writeEntry("masterStickOutFaces", os);
slaveStickOutFacesPtr_->writeEntry("slaveStickOutFaces", os);
os << " retiredPointMap " << retiredPointMap()
<< token::END_STATEMENT << nl
<< " cutPointEdgePairMap " << cutPointEdgePairMap()
<< token::END_STATEMENT << nl;
os.writeEntry("retiredPointMap", retiredPointMap());
os.writeEntry("cutPointEdgePairMap", cutPointEdgePairMap());
}
WRITE_NON_DEFAULT(pointMergeTol)
@ -812,7 +802,7 @@ void Foam::slidingInterface::writeDict(Ostream& os) const
WRITE_NON_DEFAULT(edgeCoPlanarTol)
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
{
os << nl;
os.write(name_) << nl;
os << token::BEGIN_BLOCK << incrIndent << nl;
os.writeKeyword("active") << active_ << token::END_STATEMENT << nl;
os.writeKeyword("cellZone") << cellZoneName_ << token::END_STATEMENT << nl;
os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl;
os.writeKeyword("axis") << axis_ << token::END_STATEMENT << nl;
os.beginBlock(name_);
os.writeEntry("active", active_);
os.writeEntry("cellZone", cellZoneName_);
os.writeEntry("origin", origin_);
os.writeEntry("axis", axis_);
omega_->writeData(os);
if (excludedPatchNames_.size())
{
os.writeKeyword("nonRotatingPatches") << excludedPatchNames_
<< token::END_STATEMENT << nl;
os.writeEntry("nonRotatingPatches", excludedPatchNames_);
}
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
{
fvPatchVectorField::write(os);
os.writeKeyword("relative") << relative_ << token::END_STATEMENT << nl;
os.writeKeyword("UInf") << UInf_ << token::END_STATEMENT << nl;
os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl;
os.writeEntry("relative", relative_);
os.writeEntry("UInf", UInf_);
os.writeEntry("phi", this->phiName_);
writeEntry("value", os);
}

View File

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

View File

@ -29,24 +29,23 @@ License
void Foam::fv::option::writeHeader(Ostream& os) const
{
os << indent << name_ << nl
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
os.beginBlock(name_);
}
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
{
os.writeKeyword("type") << type() << token::END_STATEMENT << nl;
os.writeKeyword("active") << active_ << token::END_STATEMENT << nl << nl;
os.writeEntry("type", type());
os.writeEntry("active", active_);
os << indent << word(type() + "Coeffs");
coeffs_.write(os);
os << nl;
coeffs_.writeEntry(word(type() + "Coeffs"), os);
}

View File

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

View File

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

View File

@ -339,13 +339,13 @@ void Foam::advectiveFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
this->template writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
this->template writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
if (lInf_ > 0)
{
os.writeKeyword("fieldInf") << fieldInf_ << token::END_STATEMENT << nl;
os.writeKeyword("lInf") << lInf_ << token::END_STATEMENT << nl;
os.writeEntry("fieldInf", fieldInf_);
os.writeEntry("lInf", lInf_);
}
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
OStringStream os;
os.writeKeyword("type") << name_ << token::END_STATEMENT
<< nl;
os.writeEntry("type", name_);
static_cast<const Field<Type>&>(*this).writeEntry("value", os);
IStringStream is(os.str());
dictionary dict(is);
@ -331,8 +330,7 @@ template<class Type>
void Foam::codedFixedValueFvPatchField<Type>::write(Ostream& os) const
{
fixedValueFvPatchField<Type>::write(os);
os.writeKeyword("name") << name_
<< token::END_STATEMENT << nl;
os.writeEntry("name", name_);
codedBase::writeCodeDict(os, dict_);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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