ENH: patch fields writeValueEntry method (frequently used)

- add base-level readValueEntry, readMixedEntries methods
  that allow optional or mandatory reading.

STYLE: wording for patch fields comments
This commit is contained in:
Mark Olesen
2023-01-31 15:26:31 +01:00
parent b71a05a72f
commit fe4688c27f
310 changed files with 1138 additions and 648 deletions

View File

@ -203,7 +203,7 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
// Write
void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
fvPatchField<scalar>::write(os);
os.writeEntryIfDifferent<word>("U", "U", UName_);
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
@ -213,7 +213,7 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
os.writeEntry("accommodationCoeff", accommodationCoeff_);
Twall_.writeEntry("Twall", os);
os.writeEntry("gamma", gamma_);
writeEntry("value", os);
fvPatchField<scalar>::writeValueEntry(os);
}

View File

@ -197,7 +197,7 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
fvPatchField<vector>::write(os);
os.writeEntryIfDifferent<word>("T", "T", TName_);
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
@ -212,7 +212,7 @@ void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
refValue().writeEntry("refValue", os);
valueFraction().writeEntry("valueFraction", os);
writeEntry("value", os);
fvPatchField<vector>::writeValueEntry(os);
}

View File

@ -115,11 +115,10 @@ void Foam::fixedRhoFvPatchScalarField::updateCoeffs()
void Foam::fixedRhoFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
fvPatchField<scalar>::write(os);
os.writeEntryIfDifferent<word>("p", "p", pName_);
os.writeEntryIfDifferent<word>("psi", "thermo:psi", psiName_);
writeEntry("value", os);
fvPatchField<scalar>::writeValueEntry(os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -485,7 +485,7 @@ void turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField::write
Ostream& os
) const
{
mixedFvPatchScalarField::write(os);
mixedFvPatchField<scalar>::write(os);
os.writeEntry("kappaMethod", KMethodTypeNames_[method_]);
os.writeEntryIfDifferent<word>("kappa","none", kappaName_);

View File

@ -102,8 +102,8 @@ void Foam::adjointOutletPressureFvPatchScalarField::updateCoeffs()
void Foam::adjointOutletPressureFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
writeEntry("value", os);
fvPatchField<scalar>::write(os);
fvPatchField<scalar>::writeValueEntry(os);
}

View File

@ -107,8 +107,8 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs()
void Foam::adjointOutletVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
writeEntry("value", os);
fvPatchField<vector>::write(os);
fvPatchField<vector>::writeValueEntry(os);
}

View File

@ -126,9 +126,9 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
fvPatchField<scalar>::write(os);
os.writeEntry("thetaProperties", thetaProps_);
writeEntry("value", os);
fvPatchField<scalar>::writeValueEntry(os);
}

View File

@ -126,9 +126,9 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
fvPatchField<scalar>::write(os);
os.writeEntry("thetaProperties", thetaProps_);
writeEntry("value", os);
fvPatchField<scalar>::writeValueEntry(os);
}

View File

@ -195,10 +195,10 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
void tractionDisplacementFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
fvPatchField<vector>::write(os);
traction_.writeEntry("traction", os);
pressure_.writeEntry("pressure", os);
writeEntry("value", os);
fvPatchField<vector>::writeValueEntry(os);
}

View File

@ -182,10 +182,10 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs()
// Write
void tractionDisplacementCorrectionFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
fvPatchField<vector>::write(os);
traction_.writeEntry("traction", os);
pressure_.writeEntry("pressure", os);
writeEntry("value", os);
fvPatchField<vector>::writeValueEntry(os);
}