diff --git a/examples/custom_source/source_ring.cpp b/examples/custom_source/source_ring.cpp index 5ab531a4a7d..bce6c27eb9e 100644 --- a/examples/custom_source/source_ring.cpp +++ b/examples/custom_source/source_ring.cpp @@ -1,3 +1,4 @@ +#define _USE_MATH_DEFINES #include // for M_PI #include // for unique_ptr diff --git a/examples/parameterized_custom_source/parameterized_source_ring.cpp b/examples/parameterized_custom_source/parameterized_source_ring.cpp index 9756e1b9774..3aabf358180 100644 --- a/examples/parameterized_custom_source/parameterized_source_ring.cpp +++ b/examples/parameterized_custom_source/parameterized_source_ring.cpp @@ -1,3 +1,4 @@ +#define _USE_MATH_DEFINES #include #include #include diff --git a/src/external/quartic_solver.cpp b/src/external/quartic_solver.cpp index 915020ffaa3..71bdb25c3e3 100644 --- a/src/external/quartic_solver.cpp +++ b/src/external/quartic_solver.cpp @@ -1,5 +1,5 @@ -#include #define _USE_MATH_DEFINES // to make M_PI declared in Intel and MSVC compilers +#include #include #include #include diff --git a/src/mesh.cpp b/src/mesh.cpp index 89d1ff24b82..b05560d2a70 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1,11 +1,10 @@ #include "openmc/mesh.h" #include // for copy, equal, min, min_element #include -#include // for uint64_t -#include // for memcpy -#define _USE_MATH_DEFINES // to make M_PI declared in Intel and MSVC compilers -#include // for ceil -#include // for size_t +#include // for ceil +#include // for size_t +#include // for uint64_t +#include // for memcpy #include #include // for accumulate #include @@ -1829,7 +1828,7 @@ StructuredMesh::MeshIndex CylindricalMesh::get_indices( } else { mapped_r[1] = std::atan2(r.y, r.x); if (mapped_r[1] < 0) - mapped_r[1] += 2 * M_PI; + mapped_r[1] += 2 * PI; } MeshIndex idx = StructuredMesh::get_indices(mapped_r, in_mesh); @@ -2123,7 +2122,7 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices( mapped_r[1] = std::acos(r.z / mapped_r.x); mapped_r[2] = std::atan2(r.y, r.x); if (mapped_r[2] < 0) - mapped_r[2] += 2 * M_PI; + mapped_r[2] += 2 * PI; } MeshIndex idx = StructuredMesh::get_indices(mapped_r, in_mesh); diff --git a/src/plot.cpp b/src/plot.cpp index 96df1c5beb8..5c4eb946063 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -1,7 +1,6 @@ #include "openmc/plot.h" #include -#define _USE_MATH_DEFINES // to make M_PI declared in Intel and MSVC compilers #include #include #include @@ -1328,7 +1327,7 @@ std::pair RayTracePlot::get_pixel_ray( int horiz, int vert) const { // Compute field of view in radians - constexpr double DEGREE_TO_RADIAN = M_PI / 180.0; + constexpr double DEGREE_TO_RADIAN = PI / 180.0; double horiz_fov_radians = horizontal_field_of_view_ * DEGREE_TO_RADIAN; double p0 = static_cast(pixels()[0]); double p1 = static_cast(pixels()[1]);