Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
ae40bd9f
Commit
ae40bd9f
authored
Jan 27, 2020
by
Mark OLESEN
Browse files
STYLE: use guards for dictionary lookup()
parent
500a3b62
Changes
10
Hide whitespace changes
Inline
Side-by-side
applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C
View file @
ae40bd9f
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -28,6 +29,7 @@ License
#include
"general.H"
#include
"addToRunTimeSelectionTable.H"
#include
"Tuple2.H"
#include
"Switch.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -135,12 +137,15 @@ Foam::tabulatedWallFunctions::general::general
:
tabulatedWallFunction
(
dict
,
mesh
,
typeName
),
interpType_
(
interpolationTypeNames_
.
get
(
"interpType"
,
coeffDict_
)),
log10YPlus_
(
coeffDict_
.
get
<
bool
>
(
"log10YPlus"
)),
log10UPlus_
(
coeffDict_
.
get
<
bool
>
(
"log10UPlus"
)),
yPlus_
(),
uPlus_
(),
log10YPlus_
(
coeffDict_
.
lookup
(
"log10YPlus"
)),
log10UPlus_
(
coeffDict_
.
lookup
(
"log10UPlus"
))
uPlus_
()
{
List
<
Tuple2
<
scalar
,
scalar
>>
inputTable
=
coeffDict_
.
lookup
(
"inputTable"
);
List
<
Tuple2
<
scalar
,
scalar
>>
inputTable
;
coeffDict_
.
readEntry
(
"inputTable"
,
inputTable
);
if
(
inputTable
.
size
()
<
2
)
{
FatalErrorInFunction
...
...
applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.H
View file @
ae40bd9f
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -32,6 +33,7 @@ Description
Example dictionary specification:
\verbatim
tabulatedWallFunction general;
// Output table info
...
...
@@ -52,9 +54,8 @@ Description
...
(yPlusValueN uPlusValueN)
);
}
\endverbatim
SourceFiles
general.C
...
...
@@ -66,7 +67,6 @@ SourceFiles
#include
"tabulatedWallFunction.H"
#include
"Enum.H"
#include
"Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -103,18 +103,18 @@ protected:
//- Type of interpolation to apply when inverting the data set
interpolationType
interpType_
;
//- Are y+ values entered as log10(y+)?
bool
log10YPlus_
;
//- Are U+ values entered as log10(U+)?
bool
log10UPlus_
;
//- Input y+ values
List
<
scalar
>
yPlus_
;
//- Input U+ values
List
<
scalar
>
uPlus_
;
//- Are y+ values entered as log10(y+)?
Switch
log10YPlus_
;
//- Are U+ values entered as log10(U+)?
Switch
log10UPlus_
;
// Protected Member Functions
...
...
src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C
View file @
ae40bd9f
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-20
19
OpenCFD Ltd.
Copyright (C) 2015-20
20
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -69,7 +69,7 @@ void Foam::ConeNozzleInjection<CloudType>::setInjectionMethod()
case
injectionMethod
:
:
imPoint
:
case
injectionMethod
:
:
imDisc
:
{
position_
=
this
->
coeffDict
().
lookup
(
"position"
);
this
->
coeffDict
().
readEntry
(
"position"
,
position_
);
break
;
}
case
injectionMethod
:
:
imMovingPoint
:
...
...
src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C
View file @
ae40bd9f
...
...
@@ -67,7 +67,10 @@ void Foam::moleculeCloud::buildConstProps()
const
word
&
id
=
idList
[
i
];
const
dictionary
&
molDict
=
moleculePropertiesDict
.
subDict
(
id
);
List
<
word
>
siteIdNames
=
molDict
.
lookup
(
"siteIds"
);
List
<
word
>
siteIdNames
(
molDict
.
lookup
(
"siteIds"
)
);
List
<
label
>
siteIds
(
siteIdNames
.
size
());
...
...
src/lagrangian/molecularDynamics/potential/potential/potential.C
View file @
ae40bd9f
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -47,7 +48,10 @@ void Foam::potential::setSiteIdList(const dictionary& moleculePropertiesDict)
const
dictionary
&
molDict
(
moleculePropertiesDict
.
subDict
(
id
));
List
<
word
>
siteIdNames
=
molDict
.
lookup
(
"siteIds"
);
List
<
word
>
siteIdNames
(
molDict
.
lookup
(
"siteIds"
)
);
forAll
(
siteIdNames
,
sI
)
{
...
...
@@ -59,7 +63,10 @@ void Foam::potential::setSiteIdList(const dictionary& moleculePropertiesDict)
}
}
List
<
word
>
pairPotSiteIds
=
molDict
.
lookup
(
"pairPotentialSiteIds"
);
List
<
word
>
pairPotSiteIds
(
molDict
.
lookup
(
"pairPotentialSiteIds"
)
);
forAll
(
pairPotSiteIds
,
sI
)
{
...
...
@@ -111,7 +118,7 @@ void Foam::potential::potential::readPotentialDict()
)
);
idList
_
=
List
<
word
>
(
idListDict
.
lookup
(
"
idList
"
)
);
idList
Dict
.
readEntry
(
"idList"
,
idList
_
);
setSiteIdList
(
...
...
@@ -156,10 +163,10 @@ void Foam::potential::potential::readPotentialDict()
potentialDict
.
readEntry
(
"potentialEnergyLimit"
,
potentialEnergyLimit_
);
if
(
potentialDict
.
found
(
"removalOrder"
))
{
List
<
word
>
remOrd
=
potentialDict
.
lookup
(
"removalOrder"
);
List
<
word
>
remOrd
;
if
(
potentialDict
.
readIfPresent
(
"removalOrder"
,
remOrd
))
{
removalOrder_
.
setSize
(
remOrd
.
size
());
forAll
(
removalOrder_
,
rO
)
...
...
src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
View file @
ae40bd9f
...
...
@@ -1057,7 +1057,6 @@ Foam::mappedPatchBase::mappedPatchBase
case
NONUNIFORM
:
{
//offsets_ = pointField(dict.lookup("offsets"));
offsets_
=
readListOrField
(
"offsets"
,
dict
,
patch_
.
size
());
}
break
;
...
...
@@ -1076,7 +1075,6 @@ Foam::mappedPatchBase::mappedPatchBase
else
if
(
dict
.
found
(
"offsets"
))
{
offsetMode_
=
NONUNIFORM
;
//offsets_ = pointField(dict.lookup("offsets"));
offsets_
=
readListOrField
(
"offsets"
,
dict
,
patch_
.
size
());
}
else
if
(
mode_
!=
NEARESTPATCHFACE
&&
mode_
!=
NEARESTPATCHFACEAMI
)
...
...
src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C
View file @
ae40bd9f
...
...
@@ -731,10 +731,10 @@ Foam::surfaceFeatures::surfaceFeatures
dictionary
featInfoDict
(
str
);
feat
ureEdges_
=
labelList
(
featInfoDict
.
lookup
(
"featureEdges"
)
);
feat
urePoints_
=
labelList
(
featInfoDict
.
lookup
(
"
featurePoints
"
)
);
externalStart_
=
featInfoDict
.
get
<
label
>
(
"externalStart"
);
internalStart_
=
featInfoDict
.
get
<
label
>
(
"internalStart"
);
feat
InfoDict
.
readEntry
(
"featureEdges"
,
featureEdges_
);
feat
InfoDict
.
readEntry
(
"featurePoints"
,
featurePoints
_
);
featInfoDict
.
readEntry
(
"externalStart"
,
externalStart_
);
featInfoDict
.
readEntry
(
"internalStart"
,
internalStart_
);
}
...
...
src/rigidBodyDynamics/restraints/linearAxialAngularSpring/linearAxialAngularSpring.C
View file @
ae40bd9f
...
...
@@ -159,9 +159,9 @@ bool Foam::RBD::restraints::linearAxialAngularSpring::read
<<
exit
(
FatalError
);
}
axis_
=
coeffs_
.
lookup
(
"axis"
);
coeffs_
.
readEntry
(
"axis"
,
axis_
);
scalar
magAxis
(
mag
(
axis_
));
const
scalar
magAxis
(
mag
(
axis_
));
if
(
magAxis
>
VSMALL
)
{
...
...
src/rigidBodyDynamics/restraints/prescribedRotation/prescribedRotation.C
View file @
ae40bd9f
...
...
@@ -176,9 +176,9 @@ bool Foam::RBD::restraints::prescribedRotation::read
<<
exit
(
FatalError
);
}
axis_
=
coeffs_
.
lookup
(
"axis"
);
coeffs_
.
readEntry
(
"axis"
,
axis_
);
scalar
magAxis
(
mag
(
axis_
));
const
scalar
magAxis
(
mag
(
axis_
));
if
(
magAxis
>
VSMALL
)
{
...
...
src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearAxialAngularSpring/linearAxialAngularSpring.C
View file @
ae40bd9f
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018
-2020
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -162,9 +162,9 @@ bool Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::read
<<
exit
(
FatalError
);
}
axis_
=
sDoFRBMRCoeffs_
.
lookup
(
"axis"
);
sDoFRBMRCoeffs_
.
readEntry
(
"axis"
,
axis_
);
scalar
magAxis
(
mag
(
axis_
));
const
scalar
magAxis
(
mag
(
axis_
));
if
(
magAxis
>
VSMALL
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment