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
50baac3c
Commit
50baac3c
authored
Nov 03, 2018
by
Mark OLESEN
Browse files
ENH: construct string types from Istream now explicit (
#1033
)
- this helps for trapping unguarded dictionary lookups.
parent
552682ec
Changes
65
Hide whitespace changes
Inline
Side-by-side
applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C
View file @
50baac3c
...
...
@@ -53,13 +53,7 @@ Foam::surfaceTensionModels::liquidProperties::liquidProperties
)
:
surfaceTensionModel
(
mesh
),
phaseName_
(
dict
.
lookup
(
"phase"
))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
surfaceTensionModels
::
liquidProperties
::~
liquidProperties
()
phaseName_
(
dict
.
get
<
word
>
(
"phase"
))
{}
...
...
applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H
View file @
50baac3c
...
...
@@ -95,7 +95,7 @@ public:
//- Destructor
virtual
~
liquidProperties
();
virtual
~
liquidProperties
()
=
default
;
// Member Functions
...
...
applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H
View file @
50baac3c
...
...
@@ -98,7 +98,7 @@ public:
autoPtr
<
phaseModel
>
operator
()(
Istream
&
is
)
const
{
return
autoPtr
<
phaseModel
>::
New
(
is
,
p_
,
T_
);
return
autoPtr
<
phaseModel
>::
New
(
word
(
is
)
,
p_
,
T_
);
}
};
...
...
applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C
View file @
50baac3c
...
...
@@ -72,7 +72,7 @@ MultiComponentPhaseModel
species_
=
thermoPtr_
->
composition
().
species
();
inertIndex_
=
species_
[
thermoPtr_
().
lookup
(
"inertSpecie"
)];
inertIndex_
=
species_
[
thermoPtr_
->
getWord
(
"inertSpecie"
)];
X_
.
setSize
(
thermoPtr_
->
composition
().
species
().
size
());
...
...
@@ -104,7 +104,6 @@ MultiComponentPhaseModel
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
BasePhaseModel
,
class
phaseThermo
>
void
Foam
::
MultiComponentPhaseModel
<
BasePhaseModel
,
phaseThermo
>
::
calculateVolumeFractions
()
...
...
applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/phaseModel/phaseModel/phaseModel.C
View file @
50baac3c
...
...
@@ -53,7 +53,7 @@ Foam::phaseModel::phaseModel
IOobject
::
AUTO_WRITE
),
fluid
.
mesh
(),
dimensionedScalar
(
"alpha"
,
dimless
,
0
)
dimensionedScalar
(
dimless
,
Zero
)
),
fluid_
(
fluid
),
name_
(
phaseName
)
...
...
applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C
View file @
50baac3c
...
...
@@ -122,46 +122,29 @@ int main(int argc, char *argv[])
{
if
(
nameMap
.
found
(
starFieldNames
[
i
]))
{
IOobject
io
(
nameMap
.
get
<
word
>
(
starFieldNames
[
i
]),
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
);
if
(
starFieldNames
[
i
]
==
"SU"
)
{
vFields
[
i
]
=
new
volVectorField
(
IOobject
(
nameMap
.
lookup
(
starFieldNames
[
i
]),
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
vFields
[
i
]
=
new
volVectorField
(
io
,
mesh
);
i
+=
3
;
}
else
{
sFields
[
i
]
=
new
volScalarField
(
IOobject
(
nameMap
.
lookup
(
starFieldNames
[
i
]),
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
i
++
;
sFields
[
i
]
=
new
volScalarField
(
io
,
mesh
);
++
i
;
}
}
else
{
i
++
;
++
i
;
}
}
...
...
src/OpenFOAM/db/dictionary/dictionary.H
View file @
50baac3c
...
...
@@ -1297,6 +1297,7 @@ public:
defineDictionaryGetter
(
getBool
,
bool
);
defineDictionaryGetter
(
getLabel
,
label
);
defineDictionaryGetter
(
getScalar
,
scalar
);
defineDictionaryGetter
(
getString
,
string
);
defineDictionaryGetter
(
getWord
,
word
);
defineDictionaryGetter
(
getFileName
,
fileName
);
...
...
src/OpenFOAM/fields/pointPatchFields/derived/fixedNormalSlip/fixedNormalSlipPointPatchField.C
View file @
50baac3c
...
...
@@ -48,7 +48,7 @@ Foam::fixedNormalSlipPointPatchField<Type>::fixedNormalSlipPointPatchField
)
:
slipPointPatchField
<
Type
>
(
p
,
iF
,
dict
),
n_
(
dict
.
lookup
(
"n"
))
n_
(
dict
.
get
<
vector
>
(
"n"
))
{}
...
...
src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCCCG/PBiCCCG.C
View file @
50baac3c
...
...
@@ -53,7 +53,7 @@ Foam::PBiCCCG<Type, DType, LUType>::solve
Field
<
Type
>&
psi
)
const
{
word
preconditionerName
(
this
->
controlDict_
.
lookup
(
"preconditioner"
));
const
word
preconditionerName
(
this
->
controlDict_
.
getWord
(
"preconditioner"
));
// --- Setup class containing solver performance data
SolverPerformance
<
Type
>
solverPerf
...
...
src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCICG/PBiCICG.C
View file @
50baac3c
...
...
@@ -50,7 +50,7 @@ template<class Type, class DType, class LUType>
Foam
::
SolverPerformance
<
Type
>
Foam
::
PBiCICG
<
Type
,
DType
,
LUType
>::
solve
(
Field
<
Type
>&
psi
)
const
{
word
preconditionerName
(
this
->
controlDict_
.
lookup
(
"preconditioner"
));
const
word
preconditionerName
(
this
->
controlDict_
.
getWord
(
"preconditioner"
));
// --- Setup class containing solver performance data
SolverPerformance
<
Type
>
solverPerf
...
...
src/OpenFOAM/matrices/LduMatrix/Solvers/PCICG/PCICG.C
View file @
50baac3c
...
...
@@ -50,7 +50,7 @@ template<class Type, class DType, class LUType>
typename
Foam
::
SolverPerformance
<
Type
>
Foam
::
PCICG
<
Type
,
DType
,
LUType
>::
solve
(
Field
<
Type
>&
psi
)
const
{
word
preconditionerName
(
this
->
controlDict_
.
lookup
(
"preconditioner"
));
const
word
preconditionerName
(
this
->
controlDict_
.
getWord
(
"preconditioner"
));
// --- Setup class containing solver performance data
SolverPerformance
<
Type
>
solverPerf
...
...
src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C
View file @
50baac3c
...
...
@@ -248,7 +248,7 @@ Foam::GAMGAgglomeration::GAMGAgglomeration
)
?
GAMGProcAgglomeration
::
New
(
controlDict
.
lookup
(
"processorAgglomerator"
),
controlDict
.
get
<
word
>
(
"processorAgglomerator"
),
*
this
,
controlDict
)
...
...
src/OpenFOAM/primitives/Pair/Pair.H
View file @
50baac3c
...
...
@@ -77,7 +77,7 @@ public:
inline
Pair
(
const
FixedList
<
T
,
2
>&
lst
,
const
bool
doSort
);
//- Construct from Istream
inline
Pair
(
Istream
&
is
);
inline
explicit
Pair
(
Istream
&
is
);
// Member Functions
...
...
src/OpenFOAM/primitives/Tuple2/Tuple2.H
View file @
50baac3c
...
...
@@ -44,7 +44,7 @@ See also
namespace
Foam
{
// Forward declaration
of friend functions and operator
s
// Forward declarations
template
<
class
Type1
,
class
Type2
>
class
Tuple2
;
...
...
@@ -93,7 +93,7 @@ public:
{}
//- Construct from Istream
inline
Tuple2
(
Istream
&
is
)
inline
explicit
Tuple2
(
Istream
&
is
)
{
is
>>
*
this
;
}
...
...
src/OpenFOAM/primitives/bools/Switch/Switch.H
View file @
50baac3c
...
...
@@ -153,7 +153,7 @@ public:
{}
//- Construct from Istream
Switch
(
Istream
&
is
);
explicit
Switch
(
Istream
&
is
);
// Helpers
...
...
src/OpenFOAM/primitives/strings/fileName/fileName.H
View file @
50baac3c
...
...
@@ -137,9 +137,8 @@ public:
//- Construct by concatenating words separated by '/'
explicit
fileName
(
std
::
initializer_list
<
word
>
list
);
//- Construct from Istream
fileName
(
Istream
&
is
);
explicit
fileName
(
Istream
&
is
);
// Member Functions
...
...
src/OpenFOAM/primitives/strings/keyType/keyType.H
View file @
50baac3c
...
...
@@ -130,7 +130,7 @@ public:
//- Construct from Istream
// Treat as regular expression if surrounded by quotation marks.
keyType
(
Istream
&
is
);
explicit
keyType
(
Istream
&
is
);
// Member Functions
...
...
src/OpenFOAM/primitives/strings/parsing/parsing.H
View file @
50baac3c
...
...
@@ -49,8 +49,6 @@ namespace Foam
namespace
parsing
{
// Enumerations
//- Enumeration for possible parsing error
enum
class
errorType
{
...
...
src/OpenFOAM/primitives/strings/string/string.H
View file @
50baac3c
...
...
@@ -182,7 +182,7 @@ public:
inline
string
(
const
size_type
len
,
const
char
c
);
//- Construct from Istream
string
(
Istream
&
is
);
explicit
string
(
Istream
&
is
);
// Member Functions
...
...
src/OpenFOAM/primitives/strings/word/word.H
View file @
50baac3c
...
...
@@ -109,7 +109,7 @@ public:
inline
word
(
const
char
*
s
,
size_type
len
,
bool
doStrip
);
//- Construct from Istream
word
(
Istream
&
is
);
explicit
word
(
Istream
&
is
);
// Member Functions
...
...
Prev
1
2
3
4
Next
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