/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki 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 "transformFaPatchField.H"
#include "transformField.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
Foam::transformFaPatchField::transformFaPatchField
(
const faPatch& p,
const DimensionedField& iF
)
:
faPatchField(p, iF)
{}
template
Foam::transformFaPatchField::transformFaPatchField
(
const transformFaPatchField& ptf,
const faPatch& p,
const DimensionedField& iF,
const faPatchFieldMapper& mapper
)
:
faPatchField(ptf, p, iF, mapper)
{}
template
Foam::transformFaPatchField::transformFaPatchField
(
const faPatch& p,
const DimensionedField& iF,
const dictionary& dict
)
:
faPatchField(p, iF, dict, IOobjectOption::NO_READ)
{}
template
Foam::transformFaPatchField::transformFaPatchField
(
const transformFaPatchField& ptf,
const DimensionedField& iF
)
:
faPatchField(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
Foam::tmp>
Foam::transformFaPatchField::valueInternalCoeffs
(
const tmp&
) const
{
// OR (!is_rotational_vectorspace_v)
if constexpr (std::is_arithmetic_v)
{
return tmp>::New(this->size(), pTraits::one);
}
else
{
return pTraits::one - snGradTransformDiag();
}
}
template
Foam::tmp>
Foam::transformFaPatchField::valueBoundaryCoeffs
(
const tmp&
) const
{
return
*this
- cmptMultiply
(
valueInternalCoeffs(this->patch().weights()),
this->patchInternalField()
);
}
template
Foam::tmp>
Foam::transformFaPatchField::gradientInternalCoeffs() const
{
// OR (!is_rotational_vectorspace_v)
if constexpr (std::is_arithmetic_v)
{
return tmp>::New(this->size(), Foam::zero{});
}
else
{
return -this->patch().deltaCoeffs()*snGradTransformDiag();
}
}
template
Foam::tmp>
Foam::transformFaPatchField::gradientBoundaryCoeffs() const
{
return
snGrad()
- cmptMultiply(gradientInternalCoeffs(), this->patchInternalField());
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template
void Foam::transformFaPatchField::operator=
(
const faPatchField& ptf
)
{
this->evaluate();
}
// ************************************************************************* //