Replacing const_cast lookupObject to lookupObjectRef
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -90,16 +90,13 @@ Foam::diameterModels::IATEsources::wallBoiling::R
|
|||||||
);
|
);
|
||||||
|
|
||||||
const phaseCompressibleTurbulenceModel& turbulence =
|
const phaseCompressibleTurbulenceModel& turbulence =
|
||||||
const_cast<phaseCompressibleTurbulenceModel&>
|
phase().db().lookupObjectRef<phaseCompressibleTurbulenceModel>
|
||||||
(
|
|
||||||
phase().db().lookupObject<phaseCompressibleTurbulenceModel>
|
|
||||||
(
|
(
|
||||||
IOobject::groupName
|
IOobject::groupName
|
||||||
(
|
(
|
||||||
turbulenceModel::propertiesName,
|
turbulenceModel::propertiesName,
|
||||||
otherPhase().name()
|
otherPhase().name()
|
||||||
)
|
)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const tmp<volScalarField> talphat(turbulence.alphat());
|
const tmp<volScalarField> talphat(turbulence.alphat());
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -91,8 +91,7 @@ void Foam::fvMotionSolverEngineMesh::move()
|
|||||||
if (engineDB_.foundObject<surfaceScalarField>("phi"))
|
if (engineDB_.foundObject<surfaceScalarField>("phi"))
|
||||||
{
|
{
|
||||||
surfaceScalarField& phi =
|
surfaceScalarField& phi =
|
||||||
const_cast<surfaceScalarField&>
|
engineDB_.lookupObjectRef<surfaceScalarField>("phi");
|
||||||
(engineDB_.lookupObject<surfaceScalarField>("phi"));
|
|
||||||
|
|
||||||
const volScalarField& rho =
|
const volScalarField& rho =
|
||||||
engineDB_.lookupObject<volScalarField>("rho");
|
engineDB_.lookupObject<volScalarField>("rho");
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -86,8 +86,7 @@ void Foam::layeredEngineMesh::move()
|
|||||||
if (engineDB_.foundObject<surfaceScalarField>("phi"))
|
if (engineDB_.foundObject<surfaceScalarField>("phi"))
|
||||||
{
|
{
|
||||||
surfaceScalarField& phi =
|
surfaceScalarField& phi =
|
||||||
const_cast<surfaceScalarField&>
|
engineDB_.lookupObjectRef<surfaceScalarField>("phi");
|
||||||
(engineDB_.lookupObject<surfaceScalarField>("phi"));
|
|
||||||
|
|
||||||
const volScalarField& rho =
|
const volScalarField& rho =
|
||||||
engineDB_.lookupObject<volScalarField>("rho");
|
engineDB_.lookupObject<volScalarField>("rho");
|
||||||
|
|||||||
@ -172,10 +172,7 @@ CrankNicolsonDdtScheme<Type>::ddt0_
|
|||||||
|
|
||||||
DDt0Field<GeoField>& ddt0 = static_cast<DDt0Field<GeoField>&>
|
DDt0Field<GeoField>& ddt0 = static_cast<DDt0Field<GeoField>&>
|
||||||
(
|
(
|
||||||
const_cast<GeoField&>
|
mesh().objectRegistry::template lookupObjectRef<GeoField>(name)
|
||||||
(
|
|
||||||
mesh().objectRegistry::template lookupObject<GeoField>(name)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return ddt0;
|
return ddt0;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -109,9 +109,10 @@ Foam::fv::gradScheme<Type>::grad
|
|||||||
}
|
}
|
||||||
|
|
||||||
solution::cachePrintMessage("Retrieving", name, vsf);
|
solution::cachePrintMessage("Retrieving", name, vsf);
|
||||||
GradFieldType& gGrad = const_cast<GradFieldType&>
|
GradFieldType& gGrad =
|
||||||
|
mesh().objectRegistry::template lookupObjectRef<GradFieldType>
|
||||||
(
|
(
|
||||||
mesh().objectRegistry::template lookupObject<GradFieldType>(name)
|
name
|
||||||
);
|
);
|
||||||
|
|
||||||
if (gGrad.upToDate(vsf))
|
if (gGrad.upToDate(vsf))
|
||||||
@ -129,12 +130,10 @@ Foam::fv::gradScheme<Type>::grad
|
|||||||
|
|
||||||
solution::cachePrintMessage("Storing", name, vsf);
|
solution::cachePrintMessage("Storing", name, vsf);
|
||||||
regIOobject::store(tgGrad.ptr());
|
regIOobject::store(tgGrad.ptr());
|
||||||
GradFieldType& gGrad = const_cast<GradFieldType&>
|
GradFieldType& gGrad =
|
||||||
(
|
mesh().objectRegistry::template lookupObjectRef<GradFieldType>
|
||||||
mesh().objectRegistry::template lookupObject<GradFieldType>
|
|
||||||
(
|
(
|
||||||
name
|
name
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return gGrad;
|
return gGrad;
|
||||||
@ -144,12 +143,10 @@ Foam::fv::gradScheme<Type>::grad
|
|||||||
{
|
{
|
||||||
if (mesh().objectRegistry::template foundObject<GradFieldType>(name))
|
if (mesh().objectRegistry::template foundObject<GradFieldType>(name))
|
||||||
{
|
{
|
||||||
GradFieldType& gGrad = const_cast<GradFieldType&>
|
GradFieldType& gGrad =
|
||||||
(
|
mesh().objectRegistry::template lookupObjectRef<GradFieldType>
|
||||||
mesh().objectRegistry::template lookupObject<GradFieldType>
|
|
||||||
(
|
(
|
||||||
name
|
name
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (gGrad.ownedByRegistry())
|
if (gGrad.ownedByRegistry())
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -169,12 +169,9 @@ Foam::LimitedScheme<Type, Limiter, LimitFunc>::limiter
|
|||||||
}
|
}
|
||||||
|
|
||||||
surfaceScalarField& limiterField =
|
surfaceScalarField& limiterField =
|
||||||
const_cast<surfaceScalarField&>
|
mesh.lookupObjectRef<surfaceScalarField>
|
||||||
(
|
|
||||||
mesh.lookupObject<surfaceScalarField>
|
|
||||||
(
|
(
|
||||||
limiterFieldName
|
limiterFieldName
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
calcLimiter(phi, limiterField);
|
calcLimiter(phi, limiterField);
|
||||||
|
|||||||
@ -372,9 +372,10 @@ Foam::volPointInterpolation::interpolate
|
|||||||
// Delete any old occurences to avoid double registration
|
// Delete any old occurences to avoid double registration
|
||||||
if (db.objectRegistry::template foundObject<PointFieldType>(name))
|
if (db.objectRegistry::template foundObject<PointFieldType>(name))
|
||||||
{
|
{
|
||||||
PointFieldType& pf = const_cast<PointFieldType&>
|
PointFieldType& pf =
|
||||||
|
db.objectRegistry::template lookupObjectRef<PointFieldType>
|
||||||
(
|
(
|
||||||
db.objectRegistry::template lookupObject<PointFieldType>(name)
|
name
|
||||||
);
|
);
|
||||||
|
|
||||||
if (pf.ownedByRegistry())
|
if (pf.ownedByRegistry())
|
||||||
@ -417,9 +418,10 @@ Foam::volPointInterpolation::interpolate
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PointFieldType& pf = const_cast<PointFieldType&>
|
PointFieldType& pf =
|
||||||
|
db.objectRegistry::template lookupObjectRef<PointFieldType>
|
||||||
(
|
(
|
||||||
db.objectRegistry::template lookupObject<PointFieldType>(name)
|
name
|
||||||
);
|
);
|
||||||
|
|
||||||
if (pf.upToDate(vf)) //TBD: , vf.mesh().points()))
|
if (pf.upToDate(vf)) //TBD: , vf.mesh().points()))
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -85,13 +85,7 @@ bool Foam::functionObjects::CourantNo::calc()
|
|||||||
|
|
||||||
if (foundObject<volScalarField>(resultName_))
|
if (foundObject<volScalarField>(resultName_))
|
||||||
{
|
{
|
||||||
volScalarField& Co
|
volScalarField& Co = lookupObjectRef<volScalarField>(resultName_);
|
||||||
(
|
|
||||||
const_cast<volScalarField&>
|
|
||||||
(
|
|
||||||
lookupObject<volScalarField>(resultName_)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Co.ref() = Coi();
|
Co.ref() = Coi();
|
||||||
Co.correctBoundaryConditions();
|
Co.correctBoundaryConditions();
|
||||||
|
|||||||
@ -196,10 +196,8 @@ void Foam::functionObjects::fieldAverage::calculateMeanFieldType
|
|||||||
{
|
{
|
||||||
const Type& baseField = obr_.lookupObject<Type>(fieldName);
|
const Type& baseField = obr_.lookupObject<Type>(fieldName);
|
||||||
|
|
||||||
Type& meanField = const_cast<Type&>
|
Type& meanField =
|
||||||
(
|
obr_.lookupObjectRef<Type>(faItems_[fieldi].meanFieldName());
|
||||||
obr_.lookupObject<Type>(faItems_[fieldi].meanFieldName())
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar dt = obr_.time().deltaTValue();
|
scalar dt = obr_.time().deltaTValue();
|
||||||
scalar Dt = totalTime_[fieldi];
|
scalar Dt = totalTime_[fieldi];
|
||||||
@ -258,10 +256,8 @@ void Foam::functionObjects::fieldAverage::calculatePrime2MeanFieldType
|
|||||||
const Type1& meanField =
|
const Type1& meanField =
|
||||||
obr_.lookupObject<Type1>(faItems_[fieldi].meanFieldName());
|
obr_.lookupObject<Type1>(faItems_[fieldi].meanFieldName());
|
||||||
|
|
||||||
Type2& prime2MeanField = const_cast<Type2&>
|
Type2& prime2MeanField =
|
||||||
(
|
obr_.lookupObjectRef<Type2>(faItems_[fieldi].prime2MeanFieldName());
|
||||||
obr_.lookupObject<Type2>(faItems_[fieldi].prime2MeanFieldName())
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar dt = obr_.time().deltaTValue();
|
scalar dt = obr_.time().deltaTValue();
|
||||||
scalar Dt = totalTime_[fieldi];
|
scalar Dt = totalTime_[fieldi];
|
||||||
@ -328,10 +324,8 @@ void Foam::functionObjects::fieldAverage::addMeanSqrToPrime2MeanType
|
|||||||
const Type1& meanField =
|
const Type1& meanField =
|
||||||
obr_.lookupObject<Type1>(faItems_[fieldi].meanFieldName());
|
obr_.lookupObject<Type1>(faItems_[fieldi].meanFieldName());
|
||||||
|
|
||||||
Type2& prime2MeanField = const_cast<Type2&>
|
Type2& prime2MeanField =
|
||||||
(
|
obr_.lookupObjectRef<Type2>(faItems_[fieldi].prime2MeanFieldName());
|
||||||
obr_.lookupObject<Type2>(faItems_[fieldi].prime2MeanFieldName())
|
|
||||||
);
|
|
||||||
|
|
||||||
prime2MeanField += sqr(meanField);
|
prime2MeanField += sqr(meanField);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -91,10 +91,7 @@ bool Foam::functionObjects::processorField::read(const dictionary& dict)
|
|||||||
|
|
||||||
bool Foam::functionObjects::processorField::execute()
|
bool Foam::functionObjects::processorField::execute()
|
||||||
{
|
{
|
||||||
const volScalarField& procField =
|
mesh_.lookupObjectRef<volScalarField>("processorID") ==
|
||||||
mesh_.lookupObject<volScalarField>("processorID");
|
|
||||||
|
|
||||||
const_cast<volScalarField&>(procField) ==
|
|
||||||
dimensionedScalar("proci", dimless, Pstream::myProcNo());
|
dimensionedScalar("proci", dimless, Pstream::myProcNo());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -103,10 +100,7 @@ bool Foam::functionObjects::processorField::execute()
|
|||||||
|
|
||||||
bool Foam::functionObjects::processorField::write()
|
bool Foam::functionObjects::processorField::write()
|
||||||
{
|
{
|
||||||
const volScalarField& procField =
|
mesh_.lookupObject<volScalarField>("processorID").write();
|
||||||
mesh_.lookupObject<volScalarField>("processorID");
|
|
||||||
|
|
||||||
procField.write();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -193,10 +193,7 @@ bool Foam::functionObjects::wallShearStress::execute()
|
|||||||
typedef incompressible::turbulenceModel icoModel;
|
typedef incompressible::turbulenceModel icoModel;
|
||||||
|
|
||||||
volVectorField& wallShearStress =
|
volVectorField& wallShearStress =
|
||||||
const_cast<volVectorField&>
|
mesh_.lookupObjectRef<volVectorField>(type());
|
||||||
(
|
|
||||||
mesh_.lookupObject<volVectorField>(type())
|
|
||||||
);
|
|
||||||
|
|
||||||
tmp<volSymmTensorField> Reff;
|
tmp<volSymmTensorField> Reff;
|
||||||
if (mesh_.foundObject<cmpModel>(turbulenceModel::propertiesName))
|
if (mesh_.foundObject<cmpModel>(turbulenceModel::propertiesName))
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -169,10 +169,7 @@ bool Foam::functionObjects::yPlus::read(const dictionary& dict)
|
|||||||
bool Foam::functionObjects::yPlus::execute()
|
bool Foam::functionObjects::yPlus::execute()
|
||||||
{
|
{
|
||||||
volScalarField& yPlus =
|
volScalarField& yPlus =
|
||||||
const_cast<volScalarField&>
|
mesh_.lookupObjectRef<volScalarField>(type());
|
||||||
(
|
|
||||||
mesh_.lookupObject<volScalarField>(type())
|
|
||||||
);
|
|
||||||
|
|
||||||
if (mesh_.foundObject<turbulenceModel>(turbulenceModel::propertiesName))
|
if (mesh_.foundObject<turbulenceModel>(turbulenceModel::propertiesName))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -91,8 +91,8 @@ bool Foam::functionObjects::removeRegisteredObject::execute()
|
|||||||
{
|
{
|
||||||
if (obr_.foundObject<regIOobject>(objectNames_[i]))
|
if (obr_.foundObject<regIOobject>(objectNames_[i]))
|
||||||
{
|
{
|
||||||
const regIOobject& obj =
|
regIOobject& obj =
|
||||||
obr_.lookupObject<regIOobject>(objectNames_[i]);
|
obr_.lookupObjectRef<regIOobject>(objectNames_[i]);
|
||||||
|
|
||||||
if (obj.ownedByRegistry())
|
if (obj.ownedByRegistry())
|
||||||
{
|
{
|
||||||
@ -100,7 +100,7 @@ bool Foam::functionObjects::removeRegisteredObject::execute()
|
|||||||
<< " removing object " << obj.name() << nl
|
<< " removing object " << obj.name() << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
const_cast<regIOobject&>(obj).release();
|
obj.release();
|
||||||
delete &obj;
|
delete &obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -210,15 +210,8 @@ void uniformInterpolatedDisplacementPointPatchVectorField::updateCoeffs()
|
|||||||
const objectRegistry&
|
const objectRegistry&
|
||||||
>(*fieldsCacheIter());
|
>(*fieldsCacheIter());
|
||||||
|
|
||||||
|
timeCache.lookupObjectRef<pointVectorField>(fieldName_)
|
||||||
pointVectorField& d = const_cast<pointVectorField&>
|
.correctBoundaryConditions();
|
||||||
(
|
|
||||||
timeCache.lookupObject<pointVectorField>
|
|
||||||
(
|
|
||||||
fieldName_
|
|
||||||
)
|
|
||||||
);
|
|
||||||
d.correctBoundaryConditions();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -44,10 +44,7 @@ void Foam::fv::tabulatedAccelerationSource::addSup
|
|||||||
if (mesh_.foundObject<uniformDimensionedVectorField>("g"))
|
if (mesh_.foundObject<uniformDimensionedVectorField>("g"))
|
||||||
{
|
{
|
||||||
uniformDimensionedVectorField& g =
|
uniformDimensionedVectorField& g =
|
||||||
const_cast<uniformDimensionedVectorField&>
|
mesh_.lookupObjectRef<uniformDimensionedVectorField>("g");
|
||||||
(
|
|
||||||
mesh_.lookupObject<uniformDimensionedVectorField>("g")
|
|
||||||
);
|
|
||||||
|
|
||||||
const uniformDimensionedScalarField& hRef =
|
const uniformDimensionedScalarField& hRef =
|
||||||
mesh_.lookupObject<uniformDimensionedScalarField>("hRef");
|
mesh_.lookupObject<uniformDimensionedScalarField>("hRef");
|
||||||
@ -61,15 +58,10 @@ void Foam::fv::tabulatedAccelerationSource::addSup
|
|||||||
: dimensionedScalar("ghRef", g.dimensions()*dimLength, 0)
|
: dimensionedScalar("ghRef", g.dimensions()*dimLength, 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
const_cast<volScalarField&>
|
mesh_.lookupObjectRef<volScalarField>("gh") = (g & mesh_.C()) - ghRef;
|
||||||
(
|
|
||||||
mesh_.lookupObject<volScalarField>("gh")
|
|
||||||
) = (g & mesh_.C()) - ghRef;
|
|
||||||
|
|
||||||
const_cast<surfaceScalarField&>
|
mesh_.lookupObjectRef<surfaceScalarField>("ghf") =
|
||||||
(
|
(g & mesh_.Cf()) - ghRef;
|
||||||
mesh_.lookupObject<surfaceScalarField>("ghf")
|
|
||||||
) = (g & mesh_.Cf()) - ghRef;
|
|
||||||
}
|
}
|
||||||
// ... otherwise include explicitly in the momentum equation
|
// ... otherwise include explicitly in the momentum equation
|
||||||
else
|
else
|
||||||
|
|||||||
@ -152,10 +152,7 @@ Foam::volScalarField& Foam::basicThermo::lookupOrConstruct
|
|||||||
fPtr->store(fPtr);
|
fPtr->store(fPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return const_cast<volScalarField&>
|
return mesh.objectRegistry::lookupObjectRef<volScalarField>(name);
|
||||||
(
|
|
||||||
mesh.objectRegistry::lookupObject<volScalarField>(name)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -133,12 +133,7 @@ Foam::radiation::greyMeanAbsorptionEmission::greyMeanAbsorptionEmission
|
|||||||
}
|
}
|
||||||
else if (mesh.foundObject<volScalarField>(iter.key()))
|
else if (mesh.foundObject<volScalarField>(iter.key()))
|
||||||
{
|
{
|
||||||
volScalarField& Y =
|
Yj_.set(j, &mesh.lookupObjectRef<volScalarField>(iter.key()));
|
||||||
const_cast<volScalarField&>
|
|
||||||
(
|
|
||||||
mesh.lookupObject<volScalarField>(iter.key())
|
|
||||||
);
|
|
||||||
Yj_.set(j, &Y);
|
|
||||||
specieIndex_[iter()] = 0;
|
specieIndex_[iter()] = 0;
|
||||||
j++;
|
j++;
|
||||||
Info<< "specie: " << iter.key() << " is being solved" << endl;
|
Info<< "specie: " << iter.key() << " is being solved" << endl;
|
||||||
@ -155,13 +150,7 @@ Foam::radiation::greyMeanAbsorptionEmission::greyMeanAbsorptionEmission
|
|||||||
}
|
}
|
||||||
else if (mesh.foundObject<volScalarField>(iter.key()))
|
else if (mesh.foundObject<volScalarField>(iter.key()))
|
||||||
{
|
{
|
||||||
volScalarField& Y =
|
Yj_.set(j, &mesh.lookupObjectRef<volScalarField>(iter.key()));
|
||||||
const_cast<volScalarField&>
|
|
||||||
(
|
|
||||||
mesh.lookupObject<volScalarField>(iter.key())
|
|
||||||
);
|
|
||||||
|
|
||||||
Yj_.set(j, &Y);
|
|
||||||
specieIndex_[iter()] = 0;
|
specieIndex_[iter()] = 0;
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,10 +121,7 @@ Foam::radiation::wideBandAbsorptionEmission::wideBandAbsorptionEmission
|
|||||||
}
|
}
|
||||||
else if (mesh.foundObject<volScalarField>(iter.key()))
|
else if (mesh.foundObject<volScalarField>(iter.key()))
|
||||||
{
|
{
|
||||||
volScalarField& Y = const_cast<volScalarField&>
|
Yj_.set(j, &mesh.lookupObjectRef<volScalarField>(iter.key()));
|
||||||
(mesh.lookupObject<volScalarField>(iter.key()));
|
|
||||||
|
|
||||||
Yj_.set(j, &Y);
|
|
||||||
|
|
||||||
specieIndex_[iter()] = 0.0;
|
specieIndex_[iter()] = 0.0;
|
||||||
j++;
|
j++;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -142,10 +142,7 @@ bool Foam::rawTopoChangerFvMesh::update()
|
|||||||
Info<< "rawTopoChangerFvMesh :"
|
Info<< "rawTopoChangerFvMesh :"
|
||||||
<< " recreating phi for unmapped boundary values." << endl;
|
<< " recreating phi for unmapped boundary values." << endl;
|
||||||
const volVectorField& U = lookupObject<volVectorField>("U");
|
const volVectorField& U = lookupObject<volVectorField>("U");
|
||||||
surfaceScalarField& phi = const_cast<surfaceScalarField&>
|
surfaceScalarField& phi = lookupObjectRef<surfaceScalarField>("phi");
|
||||||
(
|
|
||||||
lookupObject<surfaceScalarField>("phi")
|
|
||||||
);
|
|
||||||
setUnmappedValues
|
setUnmappedValues
|
||||||
(
|
(
|
||||||
phi,
|
phi,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,10 +75,7 @@ void Foam::rawTopoChangerFvMesh::zeroUnmappedValues
|
|||||||
{
|
{
|
||||||
//Pout<< "Checking field " << fldNames[i] << endl;
|
//Pout<< "Checking field " << fldNames[i] << endl;
|
||||||
|
|
||||||
FieldType& fld = const_cast<FieldType&>
|
FieldType& fld = lookupObjectRef<FieldType>(fldNames[i]);
|
||||||
(
|
|
||||||
lookupObject<FieldType>(fldNames[i])
|
|
||||||
);
|
|
||||||
|
|
||||||
setUnmappedValues
|
setUnmappedValues
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user