STYLE: use 'operator>>' instead of readLabel and readScalar

This commit is contained in:
Mark Olesen
2019-07-30 14:52:46 +02:00
committed by Andrew Heather
parent 743311df7d
commit b0d32ce1b4
15 changed files with 51 additions and 64 deletions

View File

@ -831,7 +831,7 @@ void Foam::multiphaseSystem::solve()
const Time& runTime = mesh_.time(); const Time& runTime = mesh_.time();
const dictionary& alphaControls = mesh_.solverDict("alpha"); const dictionary& alphaControls = mesh_.solverDict("alpha");
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles"))); label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles"));
if (nAlphaSubCycles > 1) if (nAlphaSubCycles > 1)
{ {

View File

@ -363,8 +363,8 @@ void Foam::twoPhaseSystem::solve()
alpha1.name() alpha1.name()
); );
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles"))); label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles"));
label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr"))); label nAlphaCorr(alphaControls.get<label>("nAlphaCorr"));
word alphaScheme("div(phi," + alpha1.name() + ')'); word alphaScheme("div(phi," + alpha1.name() + ')');
word alpharScheme("div(phir," + alpha1.name() + ')'); word alpharScheme("div(phir," + alpha1.name() + ')');

View File

@ -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 | \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2013-2017 OpenFOAM Foundation | Copyright (C) 2013-2017 OpenFOAM Foundation
@ -222,7 +222,7 @@ void Foam::MULES::limiterCorr
const label nLimiterIter const label nLimiterIter
( (
readLabel(MULEScontrols.lookup("nLimiterIter")) MULEScontrols.get<label>("nLimiterIter")
); );
const scalar smoothLimiter const scalar smoothLimiter

View File

@ -77,8 +77,7 @@ Foam::findCellParticle::findCellParticle
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstream::ASCII)
{ {
is >> start_ >> end_; is >> start_ >> end_ >> data_;
data_ = readLabel(is);
} }
else else
{ {

View File

@ -59,9 +59,7 @@ Foam::DSMCParcel<ParcelType>::DSMCParcel
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstream::ASCII)
{ {
is >> U_; is >> U_ >> Ei_ >> typeId_;
Ei_ = readScalar(is);
typeId_ = readLabel(is);
} }
else else
{ {

View File

@ -67,10 +67,7 @@ Foam::injectedParticle::injectedParticle
if (is.format() == IOstream::ASCII) if (is.format() == IOstream::ASCII)
{ {
tag_ = readLabel(is); is >> tag_ >> soi_ >> d_ >> U_;
soi_ = readScalar(is);
d_ = readScalar(is);
is >> U_;
} }
else else
{ {

View File

@ -72,16 +72,16 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstream::ASCII)
{ {
active_ = readBool(is); is >> active_
typeId_ = readLabel(is); >> typeId_
nParticle_ = readScalar(is); >> nParticle_
d_ = readScalar(is); >> d_
dTarget_ = readScalar(is); >> dTarget_
is >> U_; >> U_
rho_ = readScalar(is); >> rho_
age_ = readScalar(is); >> age_
tTurb_ = readScalar(is); >> tTurb_
is >> UTurb_; >> UTurb_;
} }
else else
{ {

View File

@ -62,8 +62,7 @@ Foam::ThermoParcel<ParcelType>::ThermoParcel
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstream::ASCII)
{ {
T_ = readScalar(is); is >> T_ >> Cp_;
Cp_ = readScalar(is);
} }
else else
{ {

View File

@ -65,18 +65,18 @@ Foam::molecule::molecule
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstream::ASCII)
{ {
is >> Q_; is >> Q_
is >> v_; >> v_
is >> a_; >> a_
is >> pi_; >> pi_
is >> tau_; >> tau_
is >> specialPosition_; >> specialPosition_
potentialEnergy_ = readScalar(is); >> potentialEnergy_
is >> rf_; >> rf_
special_ = readLabel(is); >> special_
id_ = readLabel(is); >> id_
is >> siteForces_; >> siteForces_
is >> sitePositions_; >> sitePositions_;
} }
else else
{ {

View File

@ -52,8 +52,7 @@ Foam::solidParticle::solidParticle
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstream::ASCII)
{ {
d_ = readScalar(is); is >> d_ >> U_;
is >> U_;
} }
else else
{ {

View File

@ -72,19 +72,19 @@ Foam::SprayParcel<ParcelType>::SprayParcel
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstream::ASCII)
{ {
d0_ = readScalar(is); is >> d0_
is >> position0_; >> position0_
sigma_ = readScalar(is); >> sigma_
mu_ = readScalar(is); >> mu_
liquidCore_ = readScalar(is); >> liquidCore_
KHindex_ = readScalar(is); >> KHindex_
y_ = readScalar(is); >> y_
yDot_ = readScalar(is); >> yDot_
tc_ = readScalar(is); >> tc_
ms_ = readScalar(is); >> ms_
injector_ = readScalar(is); >> injector_
tMom_ = readScalar(is); >> tMom_
user_ = readScalar(is); >> user_;
} }
else else
{ {

View File

@ -98,11 +98,7 @@ Foam::trackedParticle::trackedParticle
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstream::ASCII)
{ {
is >> start_ >> end_; is >> start_ >> end_ >> level_ >> i_ >> j_ >> k_;
level_ = readLabel(is);
i_ = readLabel(is);
j_ = readLabel(is);
k_ = readLabel(is);
} }
else else
{ {

View File

@ -624,7 +624,7 @@ void Foam::multiphaseSystem::solve()
const Time& runTime = mesh_.time(); const Time& runTime = mesh_.time();
const dictionary& alphaControls = mesh_.solverDict("alpha"); const dictionary& alphaControls = mesh_.solverDict("alpha");
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles"))); label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles"));
bool LTS = fv::localEulerDdt::enabled(mesh_); bool LTS = fv::localEulerDdt::enabled(mesh_);

View File

@ -127,8 +127,8 @@ void Foam::twoPhaseSystem::solve()
const dictionary& alphaControls = mesh_.solverDict(alpha1.name()); const dictionary& alphaControls = mesh_.solverDict(alpha1.name());
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles"))); label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles"));
label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr"))); label nAlphaCorr(alphaControls.get<label>("nAlphaCorr"));
bool LTS = fv::localEulerDdt::enabled(mesh_); bool LTS = fv::localEulerDdt::enabled(mesh_);

View File

@ -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 OpenCFD Ltd. \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation | Copyright (C) 2011-2016 OpenFOAM Foundation
@ -76,8 +76,7 @@ Foam::surfacePatch::surfacePatch(Istream& is, const label index)
size_(0), size_(0),
start_(0) start_(0)
{ {
size_ = readLabel(is); is >> size_ >> start_;
start_ = readLabel(is);
} }