Skip to content
GitLab
Menu
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
f5795afa
Commit
f5795afa
authored
Nov 03, 2017
by
Andrew Heather
Browse files
STYLE: More use of constexpr for namespace variables
parent
46e85436
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H
View file @
f5795afa
...
...
@@ -329,8 +329,8 @@ inline Ostream& endEntry(Ostream& os)
// Useful aliases for tab and newline characters
static
const
char
tab
=
'\t'
;
static
const
char
nl
=
'\n'
;
const
expr
char
tab
=
'\t'
;
const
expr
char
nl
=
'\n'
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H
View file @
f5795afa
...
...
@@ -45,7 +45,7 @@ namespace mathematical
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
static
const
char
*
const
group
=
"mathematical"
;
constexpr
const
char
*
const
group
=
"mathematical"
;
constexpr
scalar
e
(
M_E
);
constexpr
scalar
pi
(
M_PI
);
...
...
src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H
View file @
f5795afa
...
...
@@ -51,13 +51,13 @@ typedef double doubleScalar;
// Largest and smallest scalar values allowed in certain parts of the code.
// (15 is the number of significant figures in an
// IEEE double precision number. See limits.h or float.h)
static
const
doubleScalar
doubleScalarGREAT
=
1.0e+15
;
static
const
doubleScalar
doubleScalarVGREAT
=
1.0e+300
;
static
const
doubleScalar
doubleScalarROOTVGREAT
=
1.0e+150
;
static
const
doubleScalar
doubleScalarSMALL
=
1.0e-15
;
static
const
doubleScalar
doubleScalarROOTSMALL
=
3.0e-8
;
static
const
doubleScalar
doubleScalarVSMALL
=
1.0e-300
;
static
const
doubleScalar
doubleScalarROOTVSMALL
=
1.0e-150
;
const
expr
doubleScalar
doubleScalarGREAT
=
1.0e+15
;
const
expr
doubleScalar
doubleScalarVGREAT
=
1.0e+300
;
const
expr
doubleScalar
doubleScalarROOTVGREAT
=
1.0e+150
;
const
expr
doubleScalar
doubleScalarSMALL
=
1.0e-15
;
const
expr
doubleScalar
doubleScalarROOTSMALL
=
3.0e-8
;
const
expr
doubleScalar
doubleScalarVSMALL
=
1.0e-300
;
const
expr
doubleScalar
doubleScalarROOTVSMALL
=
1.0e-150
;
#define Scalar doubleScalar
...
...
src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H
View file @
f5795afa
...
...
@@ -51,13 +51,13 @@ typedef float floatScalar;
// Largest and smallest scalar values allowed in certain parts of the code.
// (6 is the number of significant figures in an
// IEEE single precision number. See limits.h or float.h)
static
const
floatScalar
floatScalarGREAT
=
1.0e+6
;
static
const
floatScalar
floatScalarVGREAT
=
1.0e+37
;
static
const
floatScalar
floatScalarROOTVGREAT
=
1.0e+18
;
static
const
floatScalar
floatScalarSMALL
=
1.0e-6
;
static
const
floatScalar
floatScalarROOTSMALL
=
1.0e-3
;
static
const
floatScalar
floatScalarVSMALL
=
1.0e-37
;
static
const
floatScalar
floatScalarROOTVSMALL
=
1.0e-18
;
const
expr
floatScalar
floatScalarGREAT
=
1.0e+6
;
const
expr
floatScalar
floatScalarVGREAT
=
1.0e+37
;
const
expr
floatScalar
floatScalarROOTVGREAT
=
1.0e+18
;
const
expr
floatScalar
floatScalarSMALL
=
1.0e-6
;
const
expr
floatScalar
floatScalarROOTSMALL
=
1.0e-3
;
const
expr
floatScalar
floatScalarVSMALL
=
1.0e-37
;
const
expr
floatScalar
floatScalarROOTVSMALL
=
1.0e-18
;
#define Scalar floatScalar
...
...
src/OpenFOAM/primitives/Scalar/scalar/scalar.H
View file @
f5795afa
...
...
@@ -49,13 +49,13 @@ namespace Foam
{
typedef
floatScalar
scalar
;
static
const
scalar
GREAT
=
floatScalarGREAT
;
static
const
scalar
VGREAT
=
floatScalarVGREAT
;
static
const
scalar
ROOTVGREAT
=
floatScalarROOTVGREAT
;
static
const
scalar
SMALL
=
floatScalarSMALL
;
static
const
scalar
ROOTSMALL
=
floatScalarROOTSMALL
;
static
const
scalar
VSMALL
=
floatScalarVSMALL
;
static
const
scalar
ROOTVSMALL
=
floatScalarROOTVSMALL
;
const
expr
scalar
GREAT
=
floatScalarGREAT
;
const
expr
scalar
VGREAT
=
floatScalarVGREAT
;
const
expr
scalar
ROOTVGREAT
=
floatScalarROOTVGREAT
;
const
expr
scalar
SMALL
=
floatScalarSMALL
;
const
expr
scalar
ROOTSMALL
=
floatScalarROOTSMALL
;
const
expr
scalar
VSMALL
=
floatScalarVSMALL
;
const
expr
scalar
ROOTVSMALL
=
floatScalarROOTVSMALL
;
scalar
readScalar
(
Istream
&
is
);
...
...
@@ -73,13 +73,13 @@ namespace Foam
{
typedef
doubleScalar
scalar
;
static
const
scalar
GREAT
=
doubleScalarGREAT
;
static
const
scalar
VGREAT
=
doubleScalarVGREAT
;
static
const
scalar
ROOTVGREAT
=
doubleScalarROOTVGREAT
;
static
const
scalar
SMALL
=
doubleScalarSMALL
;
static
const
scalar
ROOTSMALL
=
doubleScalarROOTSMALL
;
static
const
scalar
VSMALL
=
doubleScalarVSMALL
;
static
const
scalar
ROOTVSMALL
=
doubleScalarROOTVSMALL
;
const
expr
scalar
GREAT
=
doubleScalarGREAT
;
const
expr
scalar
VGREAT
=
doubleScalarVGREAT
;
const
expr
scalar
ROOTVGREAT
=
doubleScalarROOTVGREAT
;
const
expr
scalar
SMALL
=
doubleScalarSMALL
;
const
expr
scalar
ROOTSMALL
=
doubleScalarROOTSMALL
;
const
expr
scalar
VSMALL
=
doubleScalarVSMALL
;
const
expr
scalar
ROOTVSMALL
=
doubleScalarROOTVSMALL
;
scalar
readScalar
(
Istream
&
is
);
...
...
src/OpenFOAM/primitives/ints/label/label.H
View file @
f5795afa
...
...
@@ -58,8 +58,8 @@ namespace Foam
typedef
INT_SIZE
(
int
,
_t
)
label
;
static
const
label
labelMin
=
INT_SIZE
(
INT
,
_MIN
);
static
const
label
labelMax
=
INT_SIZE
(
INT
,
_MAX
);
const
expr
label
labelMin
=
INT_SIZE
(
INT
,
_MIN
);
const
expr
label
labelMax
=
INT_SIZE
(
INT
,
_MAX
);
//- Read label from stream.
// Uses readInt32 or readInt64 according to WM_LABEL_SIZE
...
...
src/OpenFOAM/primitives/ints/uLabel/uLabel.H
View file @
f5795afa
...
...
@@ -58,7 +58,7 @@ namespace Foam
typedef
UINT_SIZE
(
uint
,
_t
)
uLabel
;
static
const
uLabel
uLabelMax
=
UINT_SIZE
(
UINT
,
_MAX
);
const
expr
uLabel
uLabelMax
=
UINT_SIZE
(
UINT
,
_MAX
);
//- Read uLabel from stream.
// Uses readUint32 or readUint64 according to WM_LABEL_SIZE
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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