mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: unitConversion - using M_PI instead of pi to avoid compiltion error due to pi not evaluating to a constexpr
This commit is contained in:
@ -44,13 +44,15 @@ namespace Foam
|
|||||||
//- Conversion from degrees to radians
|
//- Conversion from degrees to radians
|
||||||
inline constexpr scalar degToRad(const scalar deg) noexcept
|
inline constexpr scalar degToRad(const scalar deg) noexcept
|
||||||
{
|
{
|
||||||
return (deg*Foam::constant::mathematical::pi/180.0);
|
//return (deg*Foam::constant::mathematical::pi/180.0);
|
||||||
|
return (deg*M_PI/180.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Conversion from radians to degrees
|
//- Conversion from radians to degrees
|
||||||
inline constexpr scalar radToDeg(const scalar rad) noexcept
|
inline constexpr scalar radToDeg(const scalar rad) noexcept
|
||||||
{
|
{
|
||||||
return (rad*180.0/Foam::constant::mathematical::pi);
|
//return (rad*180.0/Foam::constant::mathematical::pi);
|
||||||
|
return (rad*180.0/M_PI);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Conversion from atm to Pa
|
//- Conversion from atm to Pa
|
||||||
@ -69,13 +71,15 @@ inline constexpr scalar paToAtm(const scalar pa) noexcept
|
|||||||
//- User literal for degrees to radians conversion (integers)
|
//- User literal for degrees to radians conversion (integers)
|
||||||
inline constexpr scalar operator "" _deg(unsigned long long int deg) noexcept
|
inline constexpr scalar operator "" _deg(unsigned long long int deg) noexcept
|
||||||
{
|
{
|
||||||
return (deg*Foam::constant::mathematical::pi/180.0);
|
//return (deg*Foam::constant::mathematical::pi/180.0);
|
||||||
|
return (deg*M_PI/180.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- User literal for degrees to radians conversion (floats)
|
//- User literal for degrees to radians conversion (floats)
|
||||||
inline constexpr scalar operator "" _deg(long double deg) noexcept
|
inline constexpr scalar operator "" _deg(long double deg) noexcept
|
||||||
{
|
{
|
||||||
return (deg*Foam::constant::mathematical::pi/180.0);
|
//return (deg*Foam::constant::mathematical::pi/180.0);
|
||||||
|
return (deg*M_PI/180.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user