ENH: remove specialisations for scalar symmetry/transform patch fields

- previously used template specialisations, but now simply check
  pTrait<Type>::rank == 0. This aids for future extension to support
  other scalar-like fields.
This commit is contained in:
Mark Olesen
2023-02-01 13:02:32 +01:00
parent 20566a87f5
commit 2ea26ffadf
25 changed files with 190 additions and 338 deletions

View File

@ -86,6 +86,12 @@ Foam::transformFaPatchField<Type>::valueInternalCoeffs
const tmp<scalarField>&
) const
{
if (pTraits<Type>::rank == 0)
{
// Transform-invariant types
return tmp<Field<Type>>::New(this->size(), pTraits<Type>::one);
}
return pTraits<Type>::one - snGradTransformDiag();
}
@ -111,6 +117,12 @@ template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::transformFaPatchField<Type>::gradientInternalCoeffs() const
{
if (pTraits<Type>::rank == 0)
{
// Transform-invariant types
return tmp<Field<Type>>::New(this->size(), Zero);
}
return -this->patch().deltaCoeffs()*snGradTransformDiag();
}