From 0fa65b7819806d6803dfa2a51b3f7dd726f7d328 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 14 Oct 2015 09:22:34 +0100 Subject: [PATCH] uniformFixedValueFvPatchField: Remove the inconsistent optional "value" read in the construction from dictionary. It is important that the initial value is obtained from the table provided to avoid the user having to evaluate a consistent one or risk the code crashing from a very sudden change in the value. The current value is now written for post-processing convenience only. --- .../uniformFixedValueFvPatchField.C | 40 ++++++------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C index 20fb99a0..e5870388 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,15 +25,10 @@ License #include "uniformFixedValueFvPatchField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -uniformFixedValueFvPatchField::uniformFixedValueFvPatchField +Foam::uniformFixedValueFvPatchField::uniformFixedValueFvPatchField ( const fvPatch& p, const DimensionedField& iF @@ -45,7 +40,7 @@ uniformFixedValueFvPatchField::uniformFixedValueFvPatchField template -uniformFixedValueFvPatchField::uniformFixedValueFvPatchField +Foam::uniformFixedValueFvPatchField::uniformFixedValueFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -58,7 +53,7 @@ uniformFixedValueFvPatchField::uniformFixedValueFvPatchField template -uniformFixedValueFvPatchField::uniformFixedValueFvPatchField +Foam::uniformFixedValueFvPatchField::uniformFixedValueFvPatchField ( const uniformFixedValueFvPatchField& ptf, const fvPatch& p, @@ -76,7 +71,7 @@ uniformFixedValueFvPatchField::uniformFixedValueFvPatchField template -uniformFixedValueFvPatchField::uniformFixedValueFvPatchField +Foam::uniformFixedValueFvPatchField::uniformFixedValueFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -86,20 +81,13 @@ uniformFixedValueFvPatchField::uniformFixedValueFvPatchField fixedValueFvPatchField(p, iF), uniformValue_(DataEntry::New("uniformValue", dict)) { - if (dict.found("value")) - { - fvPatchField::operator==(Field("value", dict, p.size())); - } - else - { - const scalar t = this->db().time().timeOutputValue(); - fvPatchField::operator==(uniformValue_->value(t)); - } + const scalar t = this->db().time().timeOutputValue(); + fvPatchField::operator==(uniformValue_->value(t)); } template -uniformFixedValueFvPatchField::uniformFixedValueFvPatchField +Foam::uniformFixedValueFvPatchField::uniformFixedValueFvPatchField ( const uniformFixedValueFvPatchField& ptf ) @@ -115,7 +103,7 @@ uniformFixedValueFvPatchField::uniformFixedValueFvPatchField template -uniformFixedValueFvPatchField::uniformFixedValueFvPatchField +Foam::uniformFixedValueFvPatchField::uniformFixedValueFvPatchField ( const uniformFixedValueFvPatchField& ptf, const DimensionedField& iF @@ -142,7 +130,7 @@ uniformFixedValueFvPatchField::uniformFixedValueFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void uniformFixedValueFvPatchField::updateCoeffs() +void Foam::uniformFixedValueFvPatchField::updateCoeffs() { if (this->updated()) { @@ -157,16 +145,12 @@ void uniformFixedValueFvPatchField::updateCoeffs() template -void uniformFixedValueFvPatchField::write(Ostream& os) const +void Foam::uniformFixedValueFvPatchField::write(Ostream& os) const { - // Note: do not write value fvPatchField::write(os); uniformValue_->writeData(os); + this->writeEntry("value", os); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* //