dictionary scalar lookup: simplified syntax using the type templated lookup function

Replaced
    readScalar(dict.lookup("name"))
with
    dict.lookup<scalar>("name")
This commit is contained in:
Henry Weller
2019-11-27 14:56:32 +00:00
parent d987648ef4
commit 5eaf74c3a4
375 changed files with 1160 additions and 1632 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,7 +49,7 @@ Foam::XiGModels::basicSubGrid::basicSubGrid
)
:
XiGModel(XiGProperties, thermo, turbulence, Su),
k1(readScalar(XiGModelCoeffs_.lookup("k1"))),
k1(XiGModelCoeffs_.lookup<scalar>("k1")),
XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,9 +49,9 @@ Foam::XiEqModels::Gulder::Gulder
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqCoef_(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))),
XiEqCoef_(XiEqModelCoeffs_.lookup<scalar>("XiEqCoef")),
SuMin_(0.01*Su.average()),
uPrimeCoef_(readScalar(XiEqModelCoeffs_.lookup("uPrimeCoef"))),
uPrimeCoef_(XiEqModelCoeffs_.lookup<scalar>("uPrimeCoef")),
subGridSchelkin_
(
readBool(XiEqModelCoeffs_.lookup("subGridSchelkin"))

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,11 +49,11 @@ Foam::XiEqModels::SCOPEXiEq::SCOPEXiEq
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqCoef_(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))),
XiEqExp_(readScalar(XiEqModelCoeffs_.lookup("XiEqExp"))),
lCoef_(readScalar(XiEqModelCoeffs_.lookup("lCoef"))),
XiEqCoef_(XiEqModelCoeffs_.lookup<scalar>("XiEqCoef")),
XiEqExp_(XiEqModelCoeffs_.lookup<scalar>("XiEqExp")),
lCoef_(XiEqModelCoeffs_.lookup<scalar>("lCoef")),
SuMin_(0.01*Su.average()),
uPrimeCoef_(readScalar(XiEqModelCoeffs_.lookup("uPrimeCoef"))),
uPrimeCoef_(XiEqModelCoeffs_.lookup<scalar>("uPrimeCoef")),
subGridSchelkin_
(
readBool(XiEqModelCoeffs_.lookup("subGridSchelkin"))

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,7 +49,7 @@ Foam::XiEqModels::instability::instability
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqIn(readScalar(XiEqModelCoeffs_.lookup("XiEqIn"))),
XiEqIn(XiEqModelCoeffs_.lookup<scalar>("XiEqIn")),
XiEqModel_(XiEqModel::New(XiEqModelCoeffs_, thermo, turbulence, Su))
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,7 +49,7 @@ Foam::XiGModels::KTS::KTS
)
:
XiGModel(XiGProperties, thermo, turbulence, Su),
GEtaCoef_(readScalar(XiGModelCoeffs_.lookup("GEtaCoef")))
GEtaCoef_(XiGModelCoeffs_.lookup<scalar>("GEtaCoef"))
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -52,7 +52,7 @@ Foam::XiModels::algebraic::algebraic
)
:
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
XiShapeCoef(readScalar(XiModelCoeffs_.lookup("XiShapeCoef"))),
XiShapeCoef(XiModelCoeffs_.lookup<scalar>("XiShapeCoef")),
XiEqModel_(XiEqModel::New(XiProperties, thermo, turbulence, Su)),
XiGModel_(XiGModel::New(XiProperties, thermo, turbulence, Su))
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,7 +57,7 @@ Foam::XiModels::transport::transport
)
:
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
XiShapeCoef(readScalar(XiModelCoeffs_.lookup("XiShapeCoef"))),
XiShapeCoef(XiModelCoeffs_.lookup<scalar>("XiShapeCoef")),
XiEqModel_(XiEqModel::New(XiProperties, thermo, turbulence, Su)),
XiGModel_(XiGModel::New(XiProperties, thermo, turbulence, Su))
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -53,8 +53,8 @@ Foam::laminarFlameSpeedModels::SCOPE::polynomial::polynomial
)
:
FixedList<scalar, 7>(polyDict.lookup("coefficients")),
ll(readScalar(polyDict.lookup("lowerLimit"))),
ul(readScalar(polyDict.lookup("upperLimit"))),
ll(polyDict.lookup<scalar>("lowerLimit")),
ul(polyDict.lookup<scalar>("upperLimit")),
llv(polyPhi(ll, *this)),
ulv(polyPhi(ul, *this)),
lu(0)
@ -82,12 +82,12 @@ Foam::laminarFlameSpeedModels::SCOPE::SCOPE
)()
).optionalSubDict(typeName + "Coeffs")
),
LFL_(readScalar(coeffsDict_.lookup("lowerFlamabilityLimit"))),
UFL_(readScalar(coeffsDict_.lookup("upperFlamabilityLimit"))),
LFL_(coeffsDict_.lookup<scalar>("lowerFlamabilityLimit")),
UFL_(coeffsDict_.lookup<scalar>("upperFlamabilityLimit")),
SuPolyL_(coeffsDict_.subDict("lowerSuPolynomial")),
SuPolyU_(coeffsDict_.subDict("upperSuPolynomial")),
Texp_(readScalar(coeffsDict_.lookup("Texp"))),
pexp_(readScalar(coeffsDict_.lookup("pexp"))),
Texp_(coeffsDict_.lookup<scalar>("Texp")),
pexp_(coeffsDict_.lookup<scalar>("pexp")),
MaPolyL_(coeffsDict_.subDict("lowerMaPolynomial")),
MaPolyU_(coeffsDict_.subDict("upperMaPolynomial"))
{

View File

@ -1,2 +1,2 @@
Switch adjustTimeStep(runTime.controlDict().lookup("adjustTimeStep"));
scalar maxDeltaT(readScalar(runTime.controlDict().lookup("maxDeltaT")));
scalar maxDeltaT(runTime.controlDict().lookup<scalar>("maxDeltaT"));

View File

@ -18,8 +18,8 @@
)
);
scalar p0 = readScalar(initialConditions.lookup("p"));
scalar T0 = readScalar(initialConditions.lookup("T"));
scalar p0 = initialConditions.lookup<scalar>("p");
scalar T0 = initialConditions.lookup<scalar>("T");
#include "createBaseFields.H"

View File

@ -1,2 +1,2 @@
runTime.controlDict().lookup("adjustTimeStep") >> adjustTimeStep;
maxDeltaT = readScalar(runTime.controlDict().lookup("maxDeltaT"));
maxDeltaT = runTime.controlDict().lookup<scalar>("maxDeltaT");

View File

@ -35,7 +35,7 @@
const word& name = Y[i].name();
if (fractions.found(name))
{
X0[i] = readScalar(fractions.lookup(name));
X0[i] = fractions.lookup<scalar>(name);
}
}
@ -59,7 +59,7 @@
const word& name = Y[i].name();
if (fractions.found(name))
{
Y0[i] = readScalar(fractions.lookup(name));
Y0[i] = fractions.lookup<scalar>(name);
}
}

View File

@ -29,7 +29,7 @@ License
const dictionary& pimpleDict = pimple.dict();
// Maximum flow Courant number
scalar maxCo(readScalar(pimpleDict.lookup("maxCo")));
scalar maxCo(pimpleDict.lookup<scalar>("maxCo"));
// Maximum time scale
scalar maxDeltaT(pimpleDict.lookupOrDefault<scalar>("maxDeltaT", great));
@ -118,7 +118,7 @@ License
if (Yref.found(Yi.name()))
{
foundY = true;
scalar Yrefi = readScalar(Yref.lookup(Yi.name()));
scalar Yrefi = Yref.lookup<scalar>(Yi.name());
rDeltaTY.field() = max
(

View File

@ -84,7 +84,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
muName_(dict.lookupOrDefault<word>("mu", "thermo:mu")),
accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))),
accommodationCoeff_(dict.lookup<scalar>("accommodationCoeff")),
Twall_("Twall", dict, p.size()),
gamma_(dict.lookupOrDefault<scalar>("gamma", 1.4))
{

View File

@ -85,7 +85,7 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
muName_(dict.lookupOrDefault<word>("mu", "thermo:mu")),
tauMCName_(dict.lookupOrDefault<word>("tauMC", "tauMC")),
accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))),
accommodationCoeff_(dict.lookup<scalar>("accommodationCoeff")),
Uwall_("Uwall", dict, p.size()),
thermalCreep_(dict.lookupOrDefault("thermalCreep", true)),
curvature_(dict.lookupOrDefault("curvature", true))

View File

@ -12,7 +12,5 @@ IOdictionary mdEquilibrationDict
)
);
scalar targetTemperature = readScalar
(
mdEquilibrationDict.lookup("targetTemperature")
);
scalar targetTemperature =
mdEquilibrationDict.lookup<scalar>("targetTemperature");

View File

@ -139,11 +139,8 @@ basicKinematicTypeCloud kinematicCloud
scalar alphacMin
(
1.0
- readScalar
(
kinematicCloud.particleProperties().subDict("constantProperties")
.lookup("alphaMax")
)
- kinematicCloud.particleProperties().subDict("constantProperties")
.lookup<scalar>("alphaMax")
);
// Update alphac from the particle locations

View File

@ -29,7 +29,7 @@ License
const dictionary& pimpleDict = pimple.dict();
// Maximum flow Courant number
scalar maxCo(readScalar(pimpleDict.lookup("maxCo")));
scalar maxCo(pimpleDict.lookup<scalar>("maxCo"));
// Maximum time scale
scalar maxDeltaT(pimpleDict.lookupOrDefault<scalar>("maxDeltaT", great));

View File

@ -29,7 +29,7 @@ License
const dictionary& pimpleDict = pimple.dict();
// Maximum flow Courant number
scalar maxCo(readScalar(pimpleDict.lookup("maxCo")));
scalar maxCo(pimpleDict.lookup<scalar>("maxCo"));
// Maximum time scale
scalar maxDeltaT(pimpleDict.lookupOrDefault<scalar>("maxDeltaT", great));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,7 +31,7 @@ Description
scalar maxAlphaCo
(
readScalar(runTime.controlDict().lookup("maxAlphaCo"))
runTime.controlDict().lookup<scalar>("maxAlphaCo")
);
scalar alphaCoNum = 0.0;

View File

@ -2,5 +2,5 @@
scalar maxAcousticCo
(
readScalar(runTime.controlDict().lookup("maxAcousticCo"))
runTime.controlDict().lookup<scalar>("maxAcousticCo")
);

View File

@ -1,3 +1,3 @@
#include "readDyMControls.H"
maxAcousticCo = readScalar(runTime.controlDict().lookup("maxAcousticCo"));
maxAcousticCo = runTime.controlDict().lookup<scalar>("maxAcousticCo");

View File

@ -892,7 +892,7 @@ void Foam::multiphaseMixtureThermo::solve()
const dictionary& alphaControls = mesh_.solverDict("alpha");
label nAlphaSubCycles(alphaControls.lookup<label>("nAlphaSubCycles"));
scalar cAlpha(readScalar(alphaControls.lookup("cAlpha")));
scalar cAlpha(alphaControls.lookup<scalar>("cAlpha"));
volScalarField& alpha = phases_.first();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -159,14 +159,11 @@ Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties
:
mixture_(mixture),
cAlpha_
(
readScalar
(
mixture.U().mesh().solverDict
(
mixture_.alpha1().name()
).lookup("cAlpha")
)
).lookup<scalar>("cAlpha")
),
sigma12_("sigma12", dimensionSet(1, 0, -2, 0, 0), mixture),
sigma13_("sigma13", dimensionSet(1, 0, -2, 0, 0), mixture),

View File

@ -309,7 +309,7 @@ void Foam::multiphaseMixture::solve()
const dictionary& alphaControls = mesh_.solverDict("alpha");
label nAlphaSubCycles(alphaControls.lookup<label>("nAlphaSubCycles"));
scalar cAlpha(readScalar(alphaControls.lookup("cAlpha")));
scalar cAlpha(alphaControls.lookup<scalar>("cAlpha"));
if (nAlphaSubCycles > 1)
{

View File

@ -61,7 +61,7 @@ KocamustafaogullariIshiiDepartureDiameter
)
:
departureDiameterModel(),
phi_(readScalar(dict.lookup("phi")))
phi_(dict.lookup<scalar>("phi"))
{}

View File

@ -52,7 +52,7 @@ Foam::wallBoilingModels::partitioningModels::
Lavieville::Lavieville(const dictionary& dict)
:
partitioningModel(),
alphaCrit_(readScalar(dict.lookup("alphaCrit")))
alphaCrit_(dict.lookup<scalar>("alphaCrit"))
{}

View File

@ -52,8 +52,8 @@ Foam::wallBoilingModels::partitioningModels::
cosine::cosine(const dictionary& dict)
:
partitioningModel(),
alphaLiquid1_(readScalar(dict.lookup("alphaLiquid1"))),
alphaLiquid0_(readScalar(dict.lookup("alphaLiquid0")))
alphaLiquid1_(dict.lookup<scalar>("alphaLiquid1")),
alphaLiquid0_(dict.lookup<scalar>("alphaLiquid0"))
{}

View File

@ -52,8 +52,8 @@ Foam::wallBoilingModels::partitioningModels::
linear::linear(const dictionary& dict)
:
partitioningModel(),
alphaLiquid1_(readScalar(dict.lookup("alphaLiquid1"))),
alphaLiquid0_(readScalar(dict.lookup("alphaLiquid0")))
alphaLiquid1_(dict.lookup<scalar>("alphaLiquid1")),
alphaLiquid0_(dict.lookup<scalar>("alphaLiquid0"))
{}

View File

@ -51,7 +51,7 @@ Foam::phaseTransferModels::deposition::deposition
phaseTransferModel(dict, pair),
dropletName_(dict.lookup("droplet")),
surfaceName_(dict.lookup("surface")),
efficiency_(readScalar(dict.lookup("efficiency")))
efficiency_(dict.lookup<scalar>("efficiency"))
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -55,7 +55,7 @@ Foam::wallLubricationModels::Frank::Frank
wallLubricationModel(dict, pair),
Cwd_("Cwd", dimless, dict),
Cwc_("Cwc", dimless, dict),
p_(readScalar(dict.lookup("p")))
p_(dict.lookup<scalar>("p"))
{}

View File

@ -136,7 +136,7 @@ Foam::diameterModels::shapeModels::fractal::fractal
kappa_.boundaryFieldRef()[patchi]
);
kappa.refValue() = readScalar(sizeGroup_.dict().lookup("kappa"));
kappa.refValue() = sizeGroup_.dict().lookup<scalar>("kappa");
}
}

View File

@ -56,10 +56,10 @@ KochFriedlander
:
sinteringModel(dict, fractalShape),
dict_(dict.subDict(type() + "Coeffs")),
Cs_(readScalar(dict_.lookup("Cs"))),
n_(readScalar(dict_.lookup("n"))),
m_(readScalar(dict_.lookup("m"))),
Ta_(readScalar(dict_.lookup("Ta")))
Cs_(dict_.lookup<scalar>("Cs")),
n_(dict_.lookup<scalar>("n")),
m_(dict_.lookup<scalar>("m")),
Ta_(dict_.lookup<scalar>("Ta"))
{}

View File

@ -64,7 +64,7 @@ Foam::diameterModels::sizeGroup::sizeGroup
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar(name, dimless, readScalar(dict.lookup("value"))),
dimensionedScalar(name, dimless, dict.lookup<scalar>("value")),
velocityGroup.f().boundaryField().types()
),
dict_(dict),
@ -72,7 +72,7 @@ Foam::diameterModels::sizeGroup::sizeGroup
velocityGroup_(velocityGroup),
dSph_("dSph", dimLength, dict),
x_("x", pi/6.0*pow3(dSph_)),
value_(readScalar(dict.lookup("value")))
value_(dict.lookup<scalar>("value"))
{
// Adjust refValue at mixedFvPatchField boundaries
forAll(this->boundaryField(), patchi)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,7 +56,7 @@ powerLawUniformBinary
)
:
binaryBreakupModel(popBal, dict),
power_(readScalar(dict.lookup("power")))
power_(dict.lookup<scalar>("power"))
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,8 +50,8 @@ Foam::diameterModels::breakupModels::exponential::exponential
)
:
breakupModel(popBal, dict),
exponent_(readScalar(dict.lookup("exponent"))),
C_(readScalar(dict.lookup("C")))
exponent_(dict.lookup<scalar>("exponent")),
C_(dict.lookup<scalar>("C"))
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,7 +50,7 @@ Foam::diameterModels::breakupModels::powerLaw::powerLaw
)
:
breakupModel(popBal, dict),
power_(readScalar(dict.lookup("power")))
power_(dict.lookup<scalar>("power"))
{}

View File

@ -1265,7 +1265,7 @@ void Foam::diameterModels::populationBalanceModel::solve()
{
const label nCorr = this->nCorr();
const scalar tolerance =
readScalar(solutionControls.lookup("tolerance"));
solutionControls.lookup<scalar>("tolerance");
if (nCorr > 0)
{

View File

@ -55,9 +55,9 @@ Foam::RASModels::phasePressureModel::phasePressureModel
propertiesName
),
alphaMax_(readScalar(coeffDict_.lookup("alphaMax"))),
preAlphaExp_(readScalar(coeffDict_.lookup("preAlphaExp"))),
expMax_(readScalar(coeffDict_.lookup("expMax"))),
alphaMax_(coeffDict_.lookup<scalar>("alphaMax")),
preAlphaExp_(coeffDict_.lookup<scalar>("preAlphaExp")),
expMax_(coeffDict_.lookup<scalar>("expMax")),
g0_
(
"g0",

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,7 +31,7 @@ Description
scalar maxAlphaCo
(
readScalar(runTime.controlDict().lookup("maxAlphaCo"))
runTime.controlDict().lookup<scalar>("maxAlphaCo")
);
scalar alphaCoNum = 0.0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -55,7 +55,7 @@ Foam::wallLubricationModels::Frank::Frank
wallLubricationModel(dict, pair),
Cwd_("Cwd", dimless, dict),
Cwc_("Cwc", dimless, dict),
p_(readScalar(dict.lookup("p")))
p_(dict.lookup<scalar>("p"))
{}

View File

@ -58,9 +58,9 @@ Foam::RASModels::phasePressureModel::phasePressureModel
propertiesName
),
alphaMax_(readScalar(coeffDict_.lookup("alphaMax"))),
preAlphaExp_(readScalar(coeffDict_.lookup("preAlphaExp"))),
expMax_(readScalar(coeffDict_.lookup("expMax"))),
alphaMax_(coeffDict_.lookup<scalar>("alphaMax")),
preAlphaExp_(coeffDict_.lookup<scalar>("preAlphaExp")),
expMax_(coeffDict_.lookup<scalar>("expMax")),
g0_
(
"g0",

View File

@ -2,4 +2,4 @@
int nCorr = stressControl.lookupOrDefault<int>("nCorrectors", 1);
scalar convergenceTolerance(readScalar(stressControl.lookup("D")));
scalar convergenceTolerance(stressControl.lookup<scalar>("D"));

View File

@ -52,8 +52,8 @@ hydrostaticDisplacementFvPatchVectorField
)
:
tractionDisplacementFvPatchVectorField(p, iF),
rhoLiquid_(readScalar(dict.lookup("rhoLiquid"))),
liquidSurfacePressure_(readScalar(dict.lookup("liquidSurfacePressure"))),
rhoLiquid_(dict.lookup<scalar>("rhoLiquid")),
liquidSurfacePressure_(dict.lookup<scalar>("liquidSurfacePressure")),
liquidSurfacePoint_(dict.lookup("liquidSurfacePoint"))
{}

View File

@ -1,3 +1,3 @@
nCorr = stressControl.lookupOrDefault<int>("nCorrectors", 1);
convergenceTolerance = readScalar(stressControl.lookup("D"));
convergenceTolerance = stressControl.lookup<scalar>("D");
stressControl.lookup("compactNormalStress") >> compactNormalStress;

View File

@ -45,7 +45,7 @@ void Foam::solidDisplacementThermo::readProperty(volScalarField& prop) const
(
prop.name(),
prop.dimensions(),
readScalar(propDict.lookup("value"))
propDict.lookup<scalar>("value")
);
}
else if (propType == "field")

View File

@ -1 +1 @@
scalar accFac(readScalar(stressControl.lookup("accelerationFactor")));
scalar accFac(stressControl.lookup<scalar>("accelerationFactor"));

View File

@ -52,8 +52,8 @@ int main(int argc, char *argv[])
Function1<scalar>::New("function", dict);
const Function1<scalar>& function = functionPtr();
const scalar x0 = readScalar(dict.lookup("x0"));
const scalar x1 = readScalar(dict.lookup("x1"));
const scalar x0 = dict.lookup<scalar>("x0");
const scalar x1 = dict.lookup<scalar>("x1");
const label nX = dict.lookup<label>("nX");
const scalar dx = (x1 - x0)/(nX - 1);
const scalarField xs

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,7 +30,6 @@ Description
#include "HashTable.H"
#include "HashPtrTable.H"
#include "Map.H"
#include "StaticHashTable.H"
#include "cpuTime.H"
using namespace Foam;
@ -49,7 +48,6 @@ int main(int argc, char *argv[])
// ie, a
// Map<label> map(2 * nSize);
// HashTable<label, label, Hash<label>> map(2 * nSize);
// StaticHashTable<label, label, Hash<label>> map(2 * nSize);
HashTable<label, label, Hash<label>> map(2 * nSize);
Info<< "Constructed map of size: " << nSize

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -53,6 +53,7 @@ public:
(
const scalar x,
const scalarField& y,
const label li,
scalarField& dydx
) const
{
@ -66,6 +67,7 @@ public:
(
const scalar x,
const scalarField& y,
const label li,
scalarField& dfdx,
scalarSquareMatrix& dfdy
) const
@ -125,7 +127,7 @@ int main(int argc, char *argv[])
// Print the evolution of the solution and the time-step
scalarField dyStart(ode.nEqns());
ode.derivatives(xStart, yStart, dyStart);
ode.derivatives(xStart, yStart, 0, dyStart);
Info<< setw(10) << "relTol" << setw(12) << "dxEst";
Info<< setw(13) << "dxDid" << setw(14) << "dxNext" << endl;
@ -142,7 +144,7 @@ int main(int argc, char *argv[])
scalar dxNext = dxEst;
odeSolver->relTol() = relTol;
odeSolver->solve(x, y, dxNext);
odeSolver->solve(x, y, 0, dxNext);
Info<< scientific << setw(13) << relTol;
Info<< fixed << setw(11) << dxEst;
@ -165,7 +167,7 @@ int main(int argc, char *argv[])
scalar dxEst = 0.5;
odeSolver->relTol() = 1e-4;
odeSolver->solve(x, xEnd, y, dxEst);
odeSolver->solve(x, xEnd, y, 0, dxEst);
Info<< nl << "Analytical: y(2.0) = " << yEnd << endl;
Info << "Numerical: y(2.0) = " << y << ", dxEst = " << dxEst << endl;

View File

@ -1,3 +0,0 @@
Test-PackedList2.C
EXE = $(FOAM_USER_APPBIN)/Test-PackedList2

View File

@ -1,379 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "boolList.H"
#include "PackedBoolList.H"
#include "HashSet.H"
#include "StaticHashTable.H"
#include "cpuTime.H"
#include <vector>
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
const label n = 1000000;
const label nIters = 1000;
unsigned int sum = 0;
PackedBoolList packed(n, 1);
boolList unpacked(n, true);
std::vector<bool> stlVector(n, true);
labelHashSet emptyHash;
labelHashSet fullHash(1000);
for (label i = 0; i < n; i++)
{
fullHash.insert(i);
}
// fullStaticHash is really slow
// give it lots of slots to help
StaticHashTable<nil, label, Hash<label>> emptyStaticHash;
StaticHashTable<nil, label, Hash<label>> fullStaticHash(100000);
for (label i = 0; i < n; i++)
{
fullStaticHash.insert(i, nil());
}
emptyHash.printInfo(Info);
fullHash.printInfo(Info);
emptyStaticHash.printInfo(Info);
fullStaticHash.printInfo(Info);
cpuTime timer;
for (label iter = 0; iter < nIters; ++iter)
{
packed.resize(40);
packed.shrink();
packed.resize(n, 1);
}
Info<< "resize/shrink/resize:" << timer.cpuTimeIncrement() << " s\n\n";
// set every other bit on:
Info<< "set every other bit on and count\n";
packed.storage() = 0xAAAAAAAAu;
// Count packed
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
forAll(packed, i)
{
sum += packed[i];
}
}
Info<< "Counting brute-force:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
// Count packed
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
sum += packed.count();
}
Info<< "Counting via count():" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
// Dummy addition
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
forAll(unpacked, i)
{
sum += i + 1;
}
}
Info<< "Dummy loop:" << timer.cpuTimeIncrement() << " s" << endl;
Info<< " sum " << sum << endl;
//
// Read
//
// Read stl
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
for (unsigned int i = 0; i < stlVector.size(); i++)
{
sum += stlVector[i];
}
}
Info<< "Reading stl:" << timer.cpuTimeIncrement() << " s" << endl;
Info<< " sum " << sum << endl;
// Read unpacked
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
forAll(unpacked, i)
{
sum += unpacked[i];
}
}
Info<< "Reading unpacked:" << timer.cpuTimeIncrement() << " s" << endl;
Info<< " sum " << sum << endl;
// Read packed
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
forAll(packed, i)
{
sum += packed.get(i);
}
}
Info<< "Reading packed using get:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
// Read packed
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
forAll(packed, i)
{
sum += packed[i];
}
}
Info<< "Reading packed using reference:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
// Read via iterator
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
forAllIter(PackedBoolList, packed, it)
{
sum += it;
}
}
Info<< "Reading packed using iterator:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
// Read via iterator
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
forAllConstIter(PackedBoolList, packed, cit)
{
sum += cit();
}
}
Info<< "Reading packed using const_iterator():" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
// Read empty hash
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
forAll(unpacked, i)
{
sum += emptyHash.found(i);
}
}
Info<< "Reading empty labelHashSet:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
// Read full hash
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
forAll(unpacked, i)
{
sum += fullHash.found(i);
}
}
Info<< "Reading full labelHashSet:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
// Read empty static hash
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
forAll(unpacked, i)
{
sum += emptyStaticHash.found(i);
}
}
Info<< "Reading empty StaticHash:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
#if 0
// we can skip this test - it is usually quite slow
// Read full static hash
sum = 0;
for (label iter = 0; iter < nIters; ++iter)
{
forAll(unpacked, i)
{
sum += fullStaticHash.found(i);
}
}
Info<< "Reading full StaticHash:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< " sum " << sum << endl;
#endif
Info<< "Starting write tests" << endl;
//
// Write
//
// Write stl
for (label iter = 0; iter < nIters; ++iter)
{
for (unsigned int i = 0; i < stlVector.size(); i++)
{
stlVector[i] = true;
}
}
Info<< "Writing stl:" << timer.cpuTimeIncrement() << " s" << endl;
// Write unpacked
for (label iter = 0; iter < nIters; ++iter)
{
forAll(unpacked, i)
{
unpacked[i] = true;
}
}
Info<< "Writing unpacked:" << timer.cpuTimeIncrement() << " s" << endl;
// Write packed
for (label iter = 0; iter < nIters; ++iter)
{
forAll(packed, i)
{
packed[i] = 1;
}
}
Info<< "Writing packed using reference:" << timer.cpuTimeIncrement()
<< " s" << endl;
// Write packed
for (label iter = 0; iter < nIters; ++iter)
{
forAll(packed, i)
{
packed.set(i, 1);
}
}
Info<< "Writing packed using set:" << timer.cpuTimeIncrement()
<< " s" << endl;
// Write packed
for (label iter = 0; iter < nIters; ++iter)
{
forAllIter(PackedBoolList, packed, it)
{
it() = 1;
}
}
Info<< "Writing packed using iterator:" << timer.cpuTimeIncrement()
<< " s" << endl;
// Write packed
for (label iter = 0; iter < nIters; ++iter)
{
packed = 0;
}
Info<< "Writing packed uniform 0:" << timer.cpuTimeIncrement()
<< " s" << endl;
// Write packed
for (label iter = 0; iter < nIters; ++iter)
{
packed = 1;
}
Info<< "Writing packed uniform 1:" << timer.cpuTimeIncrement()
<< " s" << endl;
PackedList<3> oddPacked(n, 3);
// Write packed
for (label iter = 0; iter < nIters; ++iter)
{
packed = 0;
}
Info<< "Writing packed<3> uniform 0:" << timer.cpuTimeIncrement()
<< " s" << endl;
// Write packed
for (label iter = 0; iter < nIters; ++iter)
{
packed = 1;
}
Info<< "Writing packed<3> uniform 1:" << timer.cpuTimeIncrement()
<< " s" << endl;
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,7 +30,6 @@ Description
#include "argList.H"
#include "boolList.H"
#include "HashSet.H"
#include "StaticHashTable.H"
#include "cpuTime.H"
#include <vector>
#include "PackedBoolList.H"

View File

@ -144,7 +144,7 @@ int main(int argc, char *argv[])
Info<< "\ntest Istream constructor\n";
list4.printInfo(Info, true);
Info<< list4 << " indices: " << list4.used()() <<endl;
Info<< list4 << " indices: " << list4.used() <<endl;
Info<< "\nassign from labelList\n";
list4 = labelList
@ -156,7 +156,7 @@ int main(int argc, char *argv[])
);
list4.printInfo(Info, true);
Info<< list4 << " indices: " << list4.used()() <<endl;
Info<< list4 << " indices: " << list4.used() <<endl;
Info<< "\nassign from indices\n";
list4.read
@ -169,7 +169,7 @@ int main(int argc, char *argv[])
list4.printInfo(Info, true);
Info<< list4 << " indices: " << list4.used()() <<endl;
Info<< list4 << " indices: " << list4.used() <<endl;
List<bool> boolLst(list4.size());
forAll(list4, i)

View File

@ -94,7 +94,7 @@ int main(int argc, char *argv[])
{
dictionary dict(IFstream("testDictRegex")());
dict.add(keyType("fooba[rz]", true), "anything");
dict.add(keyType("fooba[rz]"), "anything");
Info<< "dict:" << dict << nl
<< "toc: " << dict.toc() << nl

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -186,7 +186,7 @@ int main(int argc, char *argv[])
if (names[nameI] != oldNames[nameI])
{
// make "(abc|def)" pattern
keyType renamed( "(" + names[nameI] + ")", true);
keyType renamed(string("(" + names[nameI] + ")"));
solverDict.changeKeyword(oldNames[nameI], renamed);

View File

@ -51,9 +51,9 @@ int main(int argc, char *argv[])
// Read the model, time controls and plot outlines from the dictionary
rigidBodyMotion motion(dict);
const scalar deltaT(readScalar(dict.lookup("deltaT")));
const scalar deltaT(dict.lookup<scalar>("deltaT"));
const label nIter(dict.lookupOrDefault<label>("nIter", 1));
const scalar endTime(readScalar(dict.lookup("endTime")));
const scalar endTime(dict.lookup<scalar>("endTime"));
const dictionary& bodiesDict = dict.subDict("bodies");
List<vectorField> outlines;
labelList outlineBodyIDs;

View File

@ -688,10 +688,10 @@ int main(int argc, char *argv[])
bool selectOutside(readBool(refineDict.lookup("selectOutside")));
bool selectHanging(readBool(refineDict.lookup("selectHanging")));
scalar minEdgeLen(readScalar(refineDict.lookup("minEdgeLen")));
scalar maxEdgeLen(readScalar(refineDict.lookup("maxEdgeLen")));
scalar curvature(readScalar(refineDict.lookup("curvature")));
scalar curvDist(readScalar(refineDict.lookup("curvatureDistance")));
scalar minEdgeLen(refineDict.lookup<scalar>("minEdgeLen"));
scalar maxEdgeLen(refineDict.lookup<scalar>("maxEdgeLen"));
scalar curvature(refineDict.lookup<scalar>("curvature"));
scalar curvDist(refineDict.lookup<scalar>("curvatureDistance"));
pointField outsidePts(refineDict.lookup("outsidePoints"));
label refinementLimit(refineDict.lookup<label>("splitLevel"));
bool writeMesh(readBool(refineDict.lookup("writeMesh")));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -360,7 +360,7 @@ int main(int argc, char *argv[])
bool selectCut(readBool(refineDict.lookup("selectCut")));
bool selectInside(readBool(refineDict.lookup("selectInside")));
bool selectOutside(readBool(refineDict.lookup("selectOutside")));
scalar nearDist(readScalar(refineDict.lookup("nearDistance")));
scalar nearDist(refineDict.lookup<scalar>("nearDistance"));
if (useSurface)

View File

@ -37,14 +37,14 @@ Foam::cv2DControls::cv2DControls
motionControl_(controlDict.subDict("motionControl")),
conformationControl_(controlDict.subDict("surfaceConformation")),
minCellSize_(readScalar(motionControl_.lookup("minCellSize"))),
minCellSize_(motionControl_.lookup<scalar>("minCellSize")),
minCellSize2_(Foam::sqr(minCellSize_)),
maxQuadAngle_(readScalar(conformationControl_.lookup("maxQuadAngle"))),
maxQuadAngle_(conformationControl_.lookup<scalar>("maxQuadAngle")),
nearWallAlignedDist_
(
readScalar(motionControl_.lookup("nearWallAlignedDist"))*minCellSize_
motionControl_.lookup<scalar>("nearWallAlignedDist")*minCellSize_
),
nearWallAlignedDist2_(Foam::sqr(nearWallAlignedDist_)),
@ -68,7 +68,7 @@ Foam::cv2DControls::cv2DControls
randomiseInitialGrid_(conformationControl_.lookup("randomiseInitialGrid")),
randomPerturbation_
(
readScalar(conformationControl_.lookup("randomPerturbation"))
conformationControl_.lookup<scalar>("randomPerturbation")
),
maxBoundaryConformingIter_
@ -85,28 +85,28 @@ Foam::cv2DControls::cv2DControls
minEdgeLen_
(
readScalar(conformationControl_.lookup("minEdgeLenCoeff"))
conformationControl_.lookup<scalar>("minEdgeLenCoeff")
*minCellSize_
),
minEdgeLen2_(Foam::sqr(minEdgeLen_)),
maxNotchLen_
(
readScalar(conformationControl_.lookup("maxNotchLenCoeff"))
conformationControl_.lookup<scalar>("maxNotchLenCoeff")
*minCellSize_
),
maxNotchLen2_(Foam::sqr(maxNotchLen_)),
minNearPointDist_
(
readScalar(conformationControl_.lookup("minNearPointDistCoeff"))
conformationControl_.lookup<scalar>("minNearPointDistCoeff")
*minCellSize_
),
minNearPointDist2_(Foam::sqr(minNearPointDist_)),
ppDist_
(
readScalar(conformationControl_.lookup("pointPairDistanceCoeff"))
conformationControl_.lookup<scalar>("pointPairDistanceCoeff")
*minCellSize_
)
{}

View File

@ -814,14 +814,14 @@ Foam::backgroundMeshDecomposition::backgroundMeshDecomposition
),
decomposerPtr_(decompositionMethod::New(decomposeDict_)),
mergeDist_(1e-6*mesh_.bounds().mag()),
spanScale_(readScalar(coeffsDict.lookup("spanScale"))),
spanScale_(coeffsDict.lookup<scalar>("spanScale")),
minCellSizeLimit_
(
coeffsDict.lookupOrDefault<scalar>("minCellSizeLimit", 0.0)
),
minLevels_(coeffsDict.lookup<label>("minLevels")),
volRes_(coeffsDict.lookup<label>("sampleResolution")),
maxCellWeightCoeff_(readScalar(coeffsDict.lookup("maxCellWeightCoeff")))
maxCellWeightCoeff_(coeffsDict.lookup<scalar>("maxCellWeightCoeff"))
{
if (!Pstream::parRun())
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,12 +60,12 @@ linearDistance::linearDistance
),
distanceCellSize_
(
readScalar(coeffsDict().lookup("distanceCellSizeCoeff"))
coeffsDict().lookup<scalar>("distanceCellSizeCoeff")
*defaultCellSize
),
distance_
(
readScalar(coeffsDict().lookup("distanceCoeff"))*defaultCellSize
coeffsDict().lookup<scalar>("distanceCoeff")*defaultCellSize
),
distanceSqr_(sqr(distance_))
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -59,11 +59,11 @@ linearSpatial::linearSpatial
referencePoint_(coeffsDict().lookup("referencePoint")),
referenceCellSize_
(
readScalar(coeffsDict().lookup("referenceCellSizeCoeff"))
coeffsDict().lookup<scalar>("referenceCellSizeCoeff")
*defaultCellSize
),
direction_(coeffsDict().lookup("direction")),
cellSizeGradient_(readScalar(coeffsDict().lookup("cellSizeGradient")))
cellSizeGradient_(coeffsDict().lookup<scalar>("cellSizeGradient"))
{
direction_ /= mag(direction_);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -62,12 +62,12 @@ surfaceOffsetLinearDistance::surfaceOffsetLinearDistance
),
distanceCellSize_
(
readScalar(coeffsDict().lookup("distanceCellSizeCoeff"))
coeffsDict().lookup<scalar>("distanceCellSizeCoeff")
*defaultCellSize
),
surfaceOffset_
(
readScalar(coeffsDict().lookup("surfaceOffsetCoeff"))*defaultCellSize
coeffsDict().lookup<scalar>("surfaceOffsetCoeff")*defaultCellSize
),
totalDistance_(),
totalDistanceSqr_()
@ -93,13 +93,13 @@ surfaceOffsetLinearDistance::surfaceOffsetLinearDistance
if (coeffsDict().found("totalDistanceCoeff"))
{
totalDistance_ =
readScalar(coeffsDict().lookup("totalDistanceCoeff"))
coeffsDict().lookup<scalar>("totalDistanceCoeff")
*defaultCellSize;
}
else
{
totalDistance_ =
readScalar(coeffsDict().lookup("linearDistanceCoeff"))
coeffsDict().lookup<scalar>("linearDistanceCoeff")
*defaultCellSize
+ surfaceOffset_;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,7 +57,7 @@ uniformDistance::uniformDistance
),
distance_
(
readScalar(coeffsDict().lookup("distanceCoeff"))*defaultCellSize
coeffsDict().lookup<scalar>("distanceCoeff")*defaultCellSize
),
distanceSqr_(sqr(distance_))
{}

View File

@ -117,15 +117,15 @@ Foam::automatic::automatic
internalClosenessFile_(coeffsDict_.lookup("internalClosenessFile")),
internalClosenessCellSizeCoeff_
(
readScalar(coeffsDict_.lookup("internalClosenessCellSizeCoeff"))
coeffsDict_.lookup<scalar>("internalClosenessCellSizeCoeff")
),
curvatureCellSizeCoeff_
(
readScalar(coeffsDict_.lookup("curvatureCellSizeCoeff"))
coeffsDict_.lookup<scalar>("curvatureCellSizeCoeff")
),
maximumCellSize_
(
readScalar(coeffsDict_.lookup("maximumCellSizeCoeff"))*defaultCellSize
coeffsDict_.lookup<scalar>("maximumCellSizeCoeff")*defaultCellSize
)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,7 +58,7 @@ Foam::uniformValue::uniformValue
),
surfaceCellSize_
(
readScalar(coeffsDict().lookup("surfaceCellSizeCoeff"))*defaultCellSize
coeffsDict().lookup<scalar>("surfaceCellSizeCoeff")*defaultCellSize
)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -520,10 +520,8 @@ void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
const dictionary& motionControlDict
= foamyHexMeshControls().foamyHexMeshDict().subDict("motionControl");
label nMaxIter = readLabel
(
motionControlDict.lookup("maxRefinementIterations")
);
const label nMaxIter =
motionControlDict.lookup<label>("maxRefinementIterations");
Info<< "Maximum number of refinement iterations : " << nMaxIter << endl;
@ -557,10 +555,9 @@ void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
}
}
label maxSmoothingIterations = readLabel
(
motionControlDict.lookup("maxSmoothingIterations")
);
const label maxSmoothingIterations =
motionControlDict.lookup<label>("maxSmoothingIterations");
meshAlignmentSmoother.smoothAlignments(maxSmoothingIterations);
Info<< "Background cell size and alignment mesh:" << endl;

View File

@ -840,7 +840,7 @@ void Foam::conformalVoronoiMesh::checkCellSizing()
= dict.subDict("meshQualityControls");
const scalar maxNonOrtho =
readScalar(meshQualityDict.lookup("maxNonOrtho", true));
meshQualityDict.lookup<scalar>("maxNonOrtho", true);
label nWrongFaces = 0;

View File

@ -42,38 +42,25 @@ Foam::cvControls::cvControls
foamyHexMeshDict_.subDict("surfaceConformation")
);
pointPairDistanceCoeff_ = readScalar
(
surfDict.lookup("pointPairDistanceCoeff")
);
pointPairDistanceCoeff_ =
surfDict.lookup<scalar>("pointPairDistanceCoeff");
mixedFeaturePointPPDistanceCoeff_ = readScalar
(
surfDict.lookup("mixedFeaturePointPPDistanceCoeff")
);
mixedFeaturePointPPDistanceCoeff_ =
surfDict.lookup<scalar>("mixedFeaturePointPPDistanceCoeff");
featurePointExclusionDistanceCoeff_ = readScalar
(
surfDict.lookup("featurePointExclusionDistanceCoeff")
);
featurePointExclusionDistanceCoeff_ =
surfDict.lookup<scalar>("featurePointExclusionDistanceCoeff");
featureEdgeExclusionDistanceCoeff_ = readScalar
(
surfDict.lookup("featureEdgeExclusionDistanceCoeff")
);
featureEdgeExclusionDistanceCoeff_ =
surfDict.lookup<scalar>("featureEdgeExclusionDistanceCoeff");
surfaceSearchDistanceCoeff_ =
surfDict.lookup<scalar>("surfaceSearchDistanceCoeff");
surfaceSearchDistanceCoeff_ = readScalar
(
surfDict.lookup("surfaceSearchDistanceCoeff")
);
maxSurfaceProtrusionCoeff_ =
surfDict.lookup<scalar>("maxSurfaceProtrusionCoeff");
maxSurfaceProtrusionCoeff_ = readScalar
(
surfDict.lookup("maxSurfaceProtrusionCoeff")
);
maxQuadAngle_ = readScalar(surfDict.lookup("maxQuadAngle"));
maxQuadAngle_ = surfDict.lookup<scalar>("maxQuadAngle");
surfaceConformationRebuildFrequency_ = max
(
@ -122,35 +109,29 @@ Foam::cvControls::cvControls
surfDict.subDict("conformationControls")
);
surfacePtExclusionDistanceCoeff_ = readScalar
surfacePtExclusionDistanceCoeff_ =
conformationControlsDict.lookup<scalar>
(
conformationControlsDict.lookup("surfacePtExclusionDistanceCoeff")
"surfacePtExclusionDistanceCoeff"
);
edgeSearchDistCoeffSqr_ = sqr
(
readScalar
(
conformationControlsDict.lookup("edgeSearchDistCoeff")
)
conformationControlsDict.lookup<scalar>("edgeSearchDistCoeff")
);
surfacePtReplaceDistCoeffSqr_ = sqr
(
readScalar
(
conformationControlsDict.lookup("surfacePtReplaceDistCoeff")
)
conformationControlsDict.lookup<scalar>("surfacePtReplaceDistCoeff")
);
maxConformationIterations_ = readLabel
(
conformationControlsDict.lookup("maxIterations")
);
maxConformationIterations_ =
conformationControlsDict.lookup<label>("maxIterations");
iterationToInitialHitRatioLimit_ = readScalar
iterationToInitialHitRatioLimit_ =
conformationControlsDict.lookup<scalar>
(
conformationControlsDict.lookup("iterationToInitialHitRatioLimit")
"iterationToInitialHitRatioLimit"
);
@ -158,10 +139,10 @@ Foam::cvControls::cvControls
const dictionary& motionDict(foamyHexMeshDict_.subDict("motionControl"));
defaultCellSize_ = readScalar(motionDict.lookup("defaultCellSize"));
defaultCellSize_ = motionDict.lookup<scalar>("defaultCellSize");
minimumCellSize_ =
readScalar(motionDict.lookup("minimumCellSizeCoeff"))*defaultCellSize_;
motionDict.lookup<scalar>("minimumCellSizeCoeff")*defaultCellSize_;
objOutput_ = Switch(motionDict.lookupOrDefault<Switch>("objOutput", false));
@ -177,7 +158,7 @@ Foam::cvControls::cvControls
if (Pstream::parRun())
{
maxLoadUnbalance_ = readScalar(motionDict.lookup("maxLoadUnbalance"));
maxLoadUnbalance_ = motionDict.lookup<scalar>("maxLoadUnbalance");
}
else
{
@ -186,7 +167,7 @@ Foam::cvControls::cvControls
cosAlignmentAcceptanceAngle_ = cos
(
degToRad(readScalar(motionDict.lookup("alignmentAcceptanceAngle")))
degToRad(motionDict.lookup<scalar>("alignmentAcceptanceAngle"))
);
@ -197,19 +178,15 @@ Foam::cvControls::cvControls
motionDict.subDict("pointInsertionCriteria")
);
insertionDistCoeff_ = readScalar
(
insertionDict.lookup("cellCentreDistCoeff")
);
insertionDistCoeff_ =
insertionDict.lookup<scalar>("cellCentreDistCoeff");
faceAreaRatioCoeff_ = readScalar
(
insertionDict.lookup("faceAreaRatioCoeff")
);
faceAreaRatioCoeff_ =
insertionDict.lookup<scalar>("faceAreaRatioCoeff");
cosInsertionAcceptanceAngle_ = cos
(
degToRad(readScalar(insertionDict.lookup("acceptanceAngle")))
degToRad(insertionDict.lookup<scalar>("acceptanceAngle"))
);
// Point removal criteria
@ -219,10 +196,8 @@ Foam::cvControls::cvControls
motionDict.subDict("pointRemovalCriteria")
);
removalDistCoeff_ = readScalar
(
removalDict.lookup("cellCentreDistCoeff")
);
removalDistCoeff_ =
removalDict.lookup<scalar>("cellCentreDistCoeff");
// polyMesh filtering controls
@ -260,7 +235,6 @@ Foam::cvControls::cvControls
{
writeBackgroundMeshDecomposition_ = Switch(false);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,8 +49,8 @@ piecewiseLinearRamp::piecewiseLinearRamp
)
:
faceAreaWeightModel(typeName, faceAreaWeightDict),
lAF_(readScalar(coeffDict().lookup("lowerAreaFraction"))),
uAF_(readScalar(coeffDict().lookup("upperAreaFraction")))
lAF_(coeffDict().lookup<scalar>("lowerAreaFraction")),
uAF_(coeffDict().lookup<scalar>("upperAreaFraction"))
{}

View File

@ -885,7 +885,7 @@ autoDensity::autoDensity
detailsDict().lookupOrDefault<scalar>("minCellSizeLimit", 0.0)
),
minLevels_(detailsDict().lookup<label>("minLevels")),
maxSizeRatio_(readScalar(detailsDict().lookup("maxSizeRatio"))),
maxSizeRatio_(detailsDict().lookup<scalar>("maxSizeRatio")),
volRes_(detailsDict().lookup<label>("sampleResolution")),
surfRes_
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,11 +58,11 @@ bodyCentredCubic::bodyCentredCubic
cellShapeControls,
decomposition
),
initialCellSize_(readScalar(detailsDict().lookup("initialCellSize"))),
initialCellSize_(detailsDict().lookup<scalar>("initialCellSize")),
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
randomPerturbationCoeff_
(
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
detailsDict().lookup<scalar>("randomPerturbationCoeff")
)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,11 +58,11 @@ faceCentredCubic::faceCentredCubic
cellShapeControls,
decomposition
),
initialCellSize_(readScalar(detailsDict().lookup("initialCellSize"))),
initialCellSize_(detailsDict().lookup<scalar>("initialCellSize")),
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
randomPerturbationCoeff_
(
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
detailsDict().lookup<scalar>("randomPerturbationCoeff")
)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -59,13 +59,7 @@ initialPointsMethod::initialPointsMethod
detailsDict_(optionalSubDict(type + "Coeffs")),
minimumSurfaceDistanceCoeffSqr_
(
sqr
(
readScalar
(
initialPointsDict.lookup("minimumSurfaceDistanceCoeff")
)
)
sqr( initialPointsDict.lookup<scalar>("minimumSurfaceDistanceCoeff"))
),
fixInitialPoints_(Switch(initialPointsDict.lookup("fixInitialPoints")))
{}

View File

@ -63,7 +63,7 @@ pointFile::pointFile
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
randomPerturbationCoeff_
(
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
detailsDict().lookup<scalar>("randomPerturbationCoeff")
)
{
Info<< " Inside/Outside check is " << insideOutsideCheck_.asText()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -140,7 +140,7 @@ rayShooting::rayShooting
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
randomPerturbationCoeff_
(
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
detailsDict().lookup<scalar>("randomPerturbationCoeff")
)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,11 +58,11 @@ uniformGrid::uniformGrid
cellShapeControls,
decomposition
),
initialCellSize_(readScalar(detailsDict().lookup("initialCellSize"))),
initialCellSize_(detailsDict().lookup<scalar>("initialCellSize")),
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
randomPerturbationCoeff_
(
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
detailsDict().lookup<scalar>("randomPerturbationCoeff")
)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,8 +45,8 @@ adaptiveLinear::adaptiveLinear
)
:
relaxationModel(typeName, relaxationDict, runTime),
relaxationStart_(readScalar(coeffDict().lookup("relaxationStart"))),
relaxationEnd_(readScalar(coeffDict().lookup("relaxationEnd"))),
relaxationStart_(coeffDict().lookup<scalar>("relaxationStart")),
relaxationEnd_(coeffDict().lookup<scalar>("relaxationEnd")),
lastTimeValue_(runTime_.time().timeOutputValue()),
relaxation_(relaxationStart_)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,11 +45,11 @@ rampHoldFall::rampHoldFall
)
:
relaxationModel(typeName, relaxationDict, runTime),
rampStartRelaxation_(readScalar(coeffDict().lookup("rampStartRelaxation"))),
holdRelaxation_(readScalar(coeffDict().lookup("holdRelaxation"))),
fallEndRelaxation_(readScalar(coeffDict().lookup("fallEndRelaxation"))),
rampEndFraction_(readScalar(coeffDict().lookup("rampEndFraction"))),
fallStartFraction_(readScalar(coeffDict().lookup("fallStartFraction"))),
rampStartRelaxation_(coeffDict().lookup<scalar>("rampStartRelaxation")),
holdRelaxation_(coeffDict().lookup<scalar>("holdRelaxation")),
fallEndRelaxation_(coeffDict().lookup<scalar>("fallEndRelaxation")),
rampEndFraction_(coeffDict().lookup<scalar>("rampEndFraction")),
fallStartFraction_(coeffDict().lookup<scalar>("fallStartFraction")),
rampGradient_((holdRelaxation_ - rampStartRelaxation_)/(rampEndFraction_)),
fallGradient_
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,7 +57,7 @@ Foam::triSurfaceMeshFeatures::triSurfaceMeshFeatures
)
:
searchableSurfaceFeatures(surface, dict),
includedAngle_(readScalar(dict.lookup("includedAngle"))),
includedAngle_(dict.lookup<scalar>("includedAngle")),
mode_
(
extendedFeatureEdgeMesh::sideVolumeTypeNames_

View File

@ -151,7 +151,7 @@ Foam::shortEdgeFilter2D::shortEdgeFilter2D
const dictionary& dict
)
:
shortEdgeFilterFactor_(readScalar(dict.lookup("shortEdgeFilterFactor"))),
shortEdgeFilterFactor_(dict.lookup<scalar>("shortEdgeFilterFactor")),
edgeAttachedToBoundaryFactor_
(
dict.lookupOrDefault<scalar>("edgeAttachedToBoundaryFactor", 2.0)

View File

@ -141,7 +141,7 @@ autoPtr<refinementSurfaces> createRefinementSurfaces
shapeDict.optionalSubDict(scsFuncName + "Coeffs");
const scalar surfaceCellSize =
readScalar(scsDict.lookup("surfaceCellSizeCoeff"));
scsDict.lookup<scalar>("surfaceCellSizeCoeff");
const label refLevel = sizeCoeffToRefinement
(
@ -228,10 +228,7 @@ autoPtr<refinementSurfaces> createRefinementSurfaces
);
const scalar surfaceCellSize =
readScalar
(
scsDict.lookup("surfaceCellSizeCoeff")
);
scsDict.lookup<scalar>("surfaceCellSizeCoeff");
const label refLevel = sizeCoeffToRefinement
(
@ -758,7 +755,7 @@ int main(int argc, char *argv[])
const scalar mergeDist = getMergeDistance
(
mesh,
readScalar(meshDict.lookup("mergeTolerance"))
meshDict.lookup<scalar>("mergeTolerance")
);
const Switch keepPatches(meshDict.lookupOrDefault("keepPatches", false));
@ -918,7 +915,7 @@ int main(int argc, char *argv[])
// Calculate current ratio of hex cells v.s. wanted cell size
const scalar defaultCellSize =
readScalar(motionDict.lookup("defaultCellSize"));
motionDict.lookup<scalar>("defaultCellSize");
const scalar initialCellSize = ::pow(meshPtr().V()[0], 1.0/3.0);

View File

@ -48,7 +48,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io, const word& dictName)
scalar planeTolerance
(
readScalar(mirrorMeshDict_.lookup("planeTolerance"))
mirrorMeshDict_.lookup<scalar>("planeTolerance")
);
const pointField& oldPoints = points();

View File

@ -16,5 +16,5 @@
scalar planeTolerance
(
readScalar(mirrorMeshDict.lookup("planeTolerance"))
mirrorMeshDict.lookup<scalar>("planeTolerance")
);

View File

@ -95,15 +95,12 @@ Foam::domainDecomposition::domainDecomposition
: nullptr
),
nProcs_
(
readInt
(
decompositionModel::New
(
*this,
dictFile
).lookup("numberOfSubdomains")
)
).lookup<int>("numberOfSubdomains")
),
distributed_(false),
cellToProc_(nCells()),

View File

@ -13,7 +13,7 @@ IOdictionary conversionProperties
scalar startTime
(
readScalar(conversionProperties.lookup("startTime"))
conversionProperties.lookup<scalar>("startTime")
);
word vComp

View File

@ -12,6 +12,6 @@
)
);
scalar Ea(readScalar(boxTurbDict.lookup("Ea")));
scalar Ea(boxTurbDict.lookup<scalar>("Ea"));
scalar k0(readScalar(boxTurbDict.lookup("k0")));
scalar k0(boxTurbDict.lookup<scalar>("k0"));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -124,8 +124,8 @@ Foam::tabulatedWallFunctions::SpaldingsLaw::SpaldingsLaw
)
:
tabulatedWallFunction(dict, mesh, typeName),
kappa_(readScalar(coeffDict_.lookup("kappa"))),
E_(readScalar(coeffDict_.lookup("E")))
kappa_(coeffDict_.lookup<scalar>("kappa")),
E_(coeffDict_.lookup<scalar>("E"))
{
invertFunction();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -190,7 +190,7 @@ int main(int argc, char *argv[])
surfaceDict.subDict("extractFromSurfaceCoeffs");
includedAngle =
readScalar(extractFromSurfaceDict.lookup("includedAngle"));
extractFromSurfaceDict.lookup<scalar>("includedAngle");
const Switch geometricTestOnly =
extractFromSurfaceDict.lookupOrDefault<Switch>
@ -592,7 +592,7 @@ int main(int argc, char *argv[])
<< "edges to the surface" << endl;
const scalar searchDistance =
readScalar(surfaceDict.lookup("maxFeatureProximity"));
surfaceDict.lookup<scalar>("maxFeatureProximity");
scalarField featureProximity(surf.size(), searchDistance);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -193,7 +193,7 @@ namespace Foam
// Either construct features from surface & featureAngle or read set.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const scalar includedAngle = readScalar(dict.lookup("includedAngle"));
const scalar includedAngle = dict.lookup<scalar>("includedAngle");
autoPtr<surfaceFeatures> set
(
@ -585,7 +585,7 @@ namespace Foam
<< "edges to the surface" << endl;
const scalar searchDistance =
readScalar(dict.lookup("maxFeatureProximity"));
dict.lookup<scalar>("maxFeatureProximity");
scalarField featureProximity(surf.size(), searchDistance);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -284,8 +284,8 @@ int main(int argc, char *argv[])
const dictionary& planeDict = meshSubsetDict.subDict("plane");
const plane pl(planeDict);
const scalar distance(readScalar(planeDict.lookup("distance")));
const scalar cosAngle(readScalar(planeDict.lookup("cosAngle")));
const scalar distance(planeDict.lookup<scalar>("distance"));
const scalar cosAngle(planeDict.lookup<scalar>("cosAngle"));
// Select all triangles that are close to the plane and
// whose normal aligns with the plane as well.

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,11 +71,11 @@ int main(int argc, char *argv[])
dictionary control(propertiesDict);
scalar P(readScalar(control.lookup("P")));
scalar T0(readScalar(control.lookup("T0")));
scalar P(control.lookup<scalar>("P"));
scalar T0(control.lookup<scalar>("T0"));
const word fuelName(control.lookup("fuel"));
scalar n(readScalar(control.lookup("n")));
scalar m(readScalar(control.lookup("m")));
scalar n(control.lookup<scalar>("n"));
scalar m(control.lookup<scalar>("m"));
Info<< nl << "Reading thermodynamic data dictionary" << endl;

View File

@ -74,10 +74,10 @@ int main(int argc, char *argv[])
dictionary control(propertiesDict);
scalar P(readScalar(control.lookup("P")));
scalar P(control.lookup<scalar>("P"));
const word fuelName(control.lookup("fuel"));
scalar n(readScalar(control.lookup("n")));
scalar m(readScalar(control.lookup("m")));
scalar n(control.lookup<scalar>("n"));
scalar m(control.lookup<scalar>("m"));
Info<< nl << "Reading thermodynamic data dictionary" << endl;

View File

@ -73,8 +73,8 @@ int main(int argc, char *argv[])
dictionary properties(propertiesFile);
scalar p(readScalar(properties.lookup("P")));
scalar T0(readScalar(properties.lookup("T0")));
scalar p(properties.lookup<scalar>("P"));
scalar T0(properties.lookup<scalar>("T0"));
mixture rMix(properties.lookup("reactants"));
mixture pMix(properties.lookup("products"));

View File

@ -73,7 +73,7 @@ CONSTRUCT
)
:
PARENT(p, iF),
scalarData_(readScalar(dict.lookup("scalarData"))),
scalarData_(dict.lookup<scalar>("scalarData")),
data_(pTraits<TYPE>(dict.lookup("data"))),
fieldData_("fieldData", dict, p.size()),
timeVsData_(Function1<TYPE>::New("timeVsData", dict)),

View File

@ -51,7 +51,7 @@ Foam::functionObjects::FUNCTIONOBJECT::FUNCTIONOBJECT
:
fvMeshFunctionObject(name, runTime, dict),
wordData_(dict.lookupOrDefault<word>("wordData", "defaultWord")),
scalarData_(readScalar(dict.lookup("scalarData"))),
scalarData_(dict.lookup<scalar>("scalarData")),
labelData_(dict.lookup<label>("labelData"))
{
read(dict);

View File

@ -287,7 +287,6 @@ DebugSwitches
SpalartAllmarasIDDES 0;
SphereDrag 0;
StandardWallInteraction 0;
StaticHashTable 0;
StochasticDispersionRAS 0;
SuperBee 0;
SuperBeeV 0;

View File

@ -242,7 +242,7 @@ void Foam::Time::readDict()
if (!deltaTchanged_)
{
deltaT_ = readScalar(controlDict_.lookup("deltaT"));
deltaT_ = controlDict_.lookup<scalar>("deltaT");
}
if (controlDict_.found("writeControl"))
@ -376,7 +376,7 @@ void Foam::Time::readDict()
{
IOstream::defaultPrecision
(
readUint(controlDict_.lookup("writePrecision"))
controlDict_.lookup<uint>("writePrecision")
);
Sout.precision(IOstream::defaultPrecision());

Some files were not shown because too many files have changed in this diff Show More