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:
@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user