/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
#include "failFixedValueFvPatchField.H"
#include "mathematicalConstants.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template
scalar failFixedValueFvPatchField::currentScale() const
{
return 1.0;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
failFixedValueFvPatchField::failFixedValueFvPatchField
(
const fvPatch& p,
const DimensionedField& iF
)
:
fixedValueFvPatchField(p, iF),
refValue_(p.size())
{}
template
failFixedValueFvPatchField::failFixedValueFvPatchField
(
const failFixedValueFvPatchField& ptf,
const fvPatch& p,
const DimensionedField& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchField(ptf, p, iF, mapper),
refValue_(ptf.refValue_, mapper)
{}
template
failFixedValueFvPatchField::failFixedValueFvPatchField
(
const fvPatch& p,
const DimensionedField& iF,
const dictionary& dict
)
:
fixedValueFvPatchField(p, iF),
refValue_("refValue", dict, p.size())
{
if (dict.found("value"))
{
fixedValueFvPatchField::operator==
(
Field("value", dict, p.size())
);
}
else
{
fixedValueFvPatchField::operator==
(
refValue_*currentScale()
);
}
}
template
failFixedValueFvPatchField::failFixedValueFvPatchField
(
const failFixedValueFvPatchField& ptf
)
:
fixedValueFvPatchField(ptf),
refValue_(ptf.refValue_)
{}
template
failFixedValueFvPatchField::failFixedValueFvPatchField
(
const failFixedValueFvPatchField& ptf,
const DimensionedField& iF
)
:
fixedValueFvPatchField(ptf, iF),
refValue_(ptf.refValue_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
void failFixedValueFvPatchField::updateCoeffs()
{
if (this->updated())
{
return;
}
fixedValueFvPatchField::operator==
(
refValue_*currentScale()
);
fixedValueFvPatchField::updateCoeffs();
}
template
void failFixedValueFvPatchField::write(Ostream& os) const
{
fixedValueFvPatchField::write(os);
refValue_.writeEntry("refValue", os);
// Dummy list
scalarField dumlist(10, -1.0);
dumlist[3] = 6.0;
dumlist.writeEntry("dumlist", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //