/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "clampedPlateFaPatchField.H"
#include "areaFields.H"
#include "uniformDimensionedFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
clampedPlateFaPatchField::clampedPlateFaPatchField
(
const faPatch& p,
const DimensionedField& iF
)
:
faPatchField(p, iF)
{}
template
clampedPlateFaPatchField::clampedPlateFaPatchField
(
const faPatch& p,
const DimensionedField& iF,
const dictionary& dict
)
:
faPatchField(p, iF, dict, IOobjectOption::NO_READ)
{
this->extrapolateInternal(); // Zero-gradient patch values
}
template
clampedPlateFaPatchField::clampedPlateFaPatchField
(
const clampedPlateFaPatchField& ptf,
const faPatch& p,
const DimensionedField& iF,
const faPatchFieldMapper& mapper
)
:
faPatchField(ptf, p, iF, mapper)
{}
template
clampedPlateFaPatchField::clampedPlateFaPatchField
(
const clampedPlateFaPatchField& ptf
)
:
faPatchField(ptf)
{}
template
clampedPlateFaPatchField::clampedPlateFaPatchField
(
const clampedPlateFaPatchField& ptf,
const DimensionedField& iF
)
:
faPatchField(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
void clampedPlateFaPatchField::evaluate(const Pstream::commsTypes)
{
notImplemented(type() + "::evaluate(const Pstream::commsType)");
}
template<>
void clampedPlateFaPatchField::evaluate(const Pstream::commsTypes)
{
if (!this->updated())
{
this->updateCoeffs();
}
Field::operator=(Zero);
auto& iF = const_cast&>(this->primitiveField());
for (const label facei : this->patch().edgeFaces())
{
iF[facei] = Zero;
}
faPatchField::evaluate();
}
template
tmp> clampedPlateFaPatchField::valueInternalCoeffs
(
const tmp&
) const
{
return tmp>::New(this->size(), Zero);
}
template
tmp> clampedPlateFaPatchField::valueBoundaryCoeffs
(
const tmp&
) const
{
return *this;
}
template
tmp>
clampedPlateFaPatchField::gradientInternalCoeffs() const
{
return -Type(pTraits::one)*this->patch().deltaCoeffs();
}
template
tmp>
clampedPlateFaPatchField::gradientBoundaryCoeffs() const
{
return this->patch().deltaCoeffs()*(*this);
}
template
void clampedPlateFaPatchField::write(Ostream& os) const
{
faPatchField::write(os);
faPatchField::writeValueEntry(os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //