mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use constexpr for static const char strings
This commit is contained in:
@ -38,9 +38,6 @@ namespace Foam
|
||||
namespace constant
|
||||
{
|
||||
|
||||
const char* const atomic::group = "atomic";
|
||||
|
||||
|
||||
// Note: cannot use dimless etc. since not guaranteed to be constructed
|
||||
defineDimensionedConstantWithDefault
|
||||
(
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,7 +49,7 @@ namespace atomic
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Group name for atomic constants
|
||||
extern const char* const group;
|
||||
constexpr const char* const group = "atomic";
|
||||
|
||||
//- Fine-structure constant: default SI units: []
|
||||
extern const dimensionedScalar alpha;
|
||||
|
||||
@ -38,9 +38,6 @@ namespace Foam
|
||||
namespace constant
|
||||
{
|
||||
|
||||
const char* const electromagnetic::group = "electromagnetic";
|
||||
|
||||
|
||||
defineDimensionedConstantWithDefault
|
||||
(
|
||||
electromagnetic::group,
|
||||
|
||||
@ -48,7 +48,7 @@ namespace electromagnetic
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Group name for electromagnetic constants
|
||||
extern const char* const group;
|
||||
constexpr const char* const group = "electromagnetic";
|
||||
|
||||
//- Magnetic constant/permeability of free space: default SI units: [H/m]
|
||||
extern const dimensionedScalar mu0;
|
||||
|
||||
@ -48,6 +48,7 @@ namespace mathematical
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Group name for mathematical constants
|
||||
constexpr const char* const group = "mathematical";
|
||||
|
||||
constexpr scalar e(M_E);
|
||||
|
||||
@ -39,8 +39,6 @@ namespace Foam
|
||||
namespace constant
|
||||
{
|
||||
|
||||
const char* const physicoChemical::group = "physicoChemical";
|
||||
|
||||
defineDimensionedConstantWithDefault
|
||||
(
|
||||
physicoChemical::group,
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,7 +49,7 @@ namespace physicoChemical
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Group name for physico-chemical constants
|
||||
extern const char* const group;
|
||||
constexpr const char* const group = "physicoChemical";
|
||||
|
||||
//- Universal gas constant: default SI units: [J/mol/K]
|
||||
extern const dimensionedScalar R;
|
||||
|
||||
@ -36,9 +36,6 @@ namespace Foam
|
||||
namespace constant
|
||||
{
|
||||
|
||||
const char* const universal::group = "universal";
|
||||
|
||||
|
||||
// Note: cannot use dimless etc. since not guaranteed to be constructed
|
||||
defineDimensionedConstantWithDefault
|
||||
(
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,7 +49,7 @@ namespace universal
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Group name for universal constants
|
||||
extern const char* const group;
|
||||
constexpr const char* const group = "universal";
|
||||
|
||||
//- Reduced Planck constant: default SI units: [J/s]
|
||||
extern const dimensionedScalar hr;
|
||||
|
||||
Reference in New Issue
Block a user