type aliasing for geometric fields
In several places we have a fair bit of templating cruft dealing with GeometricFields where it would be convenient to have C++11 type aliases instead.
Eg,
// Alias
template<class Type>
using VolumeField = GeometricField<Type, fvPatchField, volMesh>;
Later on:
const auto* vfield = cfindObject<VolumeField<Type>>(fieldName_);
if (vfield)
{
return calcComponents(*vfield);
}
const auto* sfield = cfindObject<SurfaceField<Type>>(fieldName_);
if (vfield)
{
return calcComponents(*sfield);
}
Compared to many places where we have an intermediate typedef:
typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
typedef GeometricField<Type, fvsPatchField, surfaceMesh> SurfaceFieldType;
if (foundObject<VolFieldType>(fieldName_))
{
...
}
// which is still better than this...
const auto* sfield =
cfindObject<GeometricField<Type, fvsPatchField, surfaceMesh>>(fieldName_);
if (sfield)
{
...
}
Edited by Mark OLESEN