ENH: use pointer checks for dynamicCast, refCast

- avoids try/catch exception handling

STYLE: prefer refCast (shorter) to dynamicCast where possible
This commit is contained in:
Mark Olesen
2022-09-15 10:20:57 +02:00
parent 512f558549
commit b9ca63b118
11 changed files with 120 additions and 132 deletions

View File

@ -65,7 +65,7 @@ label writeDimFields
{
typedef VolumeInternalField<Type> FieldType;
const fvMesh& mesh = dynamicCast<const fvMesh>(ensMesh.mesh());
const auto& mesh = refCast<const fvMesh>(ensMesh.mesh());
label count = 0;

View File

@ -88,7 +88,7 @@ label writeVolFields
{
typedef VolumeField<Type> FieldType;
const fvMesh& mesh = dynamicCast<const fvMesh>(ensMesh.mesh());
const auto& mesh = refCast<const fvMesh>(ensMesh.mesh());
label count = 0;