STYLE: remove erroneous reference in dynamicCast use

This commit is contained in:
Mark Olesen 2021-05-31 09:02:57 +02:00
parent 5d9e42cb70
commit 0ba43df9c5
7 changed files with 63 additions and 76 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,46 +60,45 @@ bool Foam::dictionaryTokens::setIterator() const
{
const entry& base = *entryIter_;
if (isA<primitiveEntry>(base))
{
primIter_.reset
(
new dictionaryTokens::primitive_iterator
const auto* eptr = isA<primitiveEntry>(base);
if (eptr)
{
primIter_.reset
(
dynamicCast<const primitiveEntry&>(base)
)
);
return true;
}
else if (isA<dictionaryListEntry>(base))
{
// Must check for isA<dictionaryListEntry> before checking
// for isA<dictionaryEntry> !
dictIter_.reset
(
new dictionaryTokens::dictionary_iterator
(
dynamicCast<const dictionaryListEntry&>(base)
)
);
return true;
}
else if (isA<dictionaryEntry>(base))
{
dictIter_.reset
(
new dictionaryTokens::dictionary_iterator
(
dynamicCast<const dictionaryEntry&>(base)
)
);
return true;
new dictionaryTokens::primitive_iterator(*eptr)
);
return true;
}
}
// NB: Must check for isA<dictionaryListEntry> before checking
// for isA<dictionaryEntry> !
{
const auto* eptr = isA<dictionaryListEntry>(base);
if (eptr)
{
dictIter_.reset
(
new dictionaryTokens::dictionary_iterator(*eptr)
);
return true;
}
}
{
const auto* eptr = isA<dictionaryEntry>(base);
if (eptr)
{
dictIter_.reset
(
new dictionaryTokens::dictionary_iterator(*eptr)
);
return true;
}
}
}
return false;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Original code Copyright (C) 2014-2018 Bernhard Gschaider
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -92,14 +92,14 @@ addNamedToRunTimeSelectionTable
#define defineExpressionEntryType(DimType) \
Foam::string Foam::exprTools::DimType##Entry::evaluate(const entry& e) \
{ \
DimType dt(dynamicCast<const primitiveEntry&>(e)); \
DimType dt(dynamicCast<const primitiveEntry>(e)); \
return toExprStr<DimType::value_type>(dt.value()); \
}
Foam::string Foam::exprTools::dimensionedScalarEntry::evaluate(const entry& e)
{
dimensionedScalar dt(dynamicCast<const primitiveEntry&>(e));
dimensionedScalar dt(dynamicCast<const primitiveEntry>(e));
return std::to_string(dt.value());
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,38 +43,26 @@ bool Foam::vtk::writeTopoSet
bool parallel
)
{
if (isA<pointSet>(set))
{
return vtk::writePointSet
(
mesh,
dynamicCast<const pointSet&>(set),
opts,
file,
parallel
);
const auto* ptr = isA<pointSet>(set);
if (ptr)
{
return vtk::writePointSet(mesh, *ptr, opts, file, parallel);
}
}
else if (isA<faceSet>(set))
{
return vtk::writeFaceSet
(
mesh,
dynamicCast<const faceSet&>(set),
opts,
file,
parallel
);
const auto* ptr = isA<faceSet>(set);
if (ptr)
{
return vtk::writeFaceSet(mesh, *ptr, opts, file, parallel);
}
}
else if (isA<cellSet>(set))
{
return vtk::writeCellSetFaces
(
mesh,
dynamicCast<const cellSet&>(set),
opts,
file,
parallel
);
const auto* ptr = isA<cellSet>(set);
if (ptr)
{
return vtk::writeCellSetFaces(mesh, *ptr, opts, file, parallel);
}
}
WarningInFunction

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -162,20 +162,20 @@ Foam::label Foam::cuttingPlane::calcCellCuts
if (debug && isA<fvMesh>(mesh))
{
const fvMesh& fvm = dynamicCast<const fvMesh&>(mesh);
const auto& fvmesh = dynamicCast<const fvMesh>(mesh);
volScalarField cCuts
(
IOobject
(
"cuttingPlane.cellCuts",
fvm.time().timeName(),
fvm.time(),
fvmesh.time().timeName(),
fvmesh.time(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
fvm,
fvmesh,
dimensionedScalar(dimless, Zero)
);

View File

@ -1196,7 +1196,7 @@ Foam::isoSurfaceCell::isoSurfaceCell
if (debug && isA<fvMesh>(mesh))
{
const fvMesh& fvmesh = dynamicCast<const fvMesh&>(mesh);
const auto& fvmesh = dynamicCast<const fvMesh>(mesh);
volScalarField debugField
(

View File

@ -1021,7 +1021,7 @@ Foam::isoSurfaceTopo::isoSurfaceTopo
if (debug && isA<fvMesh>(mesh))
{
const fvMesh& fvmesh = dynamicCast<const fvMesh&>(mesh);
const auto& fvmesh = dynamicCast<const fvMesh>(mesh);
volScalarField debugField
(

View File

@ -77,7 +77,7 @@ Foam::TDACChemistryModel<ReactionThermo, ThermoType>::TDACChemistryModel
autoPtr<HashTable<List<specieElement>>> specCompPtr
(
dynamicCast<const reactingMixture<ThermoType>&>(this->thermo())
dynamicCast<const reactingMixture<ThermoType>>(this->thermo())
.specieComposition()
);