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