Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/custom_source/source_ring.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _USE_MATH_DEFINES
#include <cmath> // for M_PI
#include <memory> // for unique_ptr

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define _USE_MATH_DEFINES
#include <cmath>
#include <memory>
#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion src/external/quartic_solver.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <algorithm>
#define _USE_MATH_DEFINES // to make M_PI declared in Intel and MSVC compilers
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdlib>
Expand Down
13 changes: 6 additions & 7 deletions src/mesh.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#include "openmc/mesh.h"
#include <algorithm> // for copy, equal, min, min_element
#include <cassert>
#include <cstdint> // for uint64_t
#include <cstring> // for memcpy
#define _USE_MATH_DEFINES // to make M_PI declared in Intel and MSVC compilers
#include <cmath> // for ceil
#include <cstddef> // for size_t
#include <cmath> // for ceil
#include <cstddef> // for size_t
#include <cstdint> // for uint64_t
#include <cstring> // for memcpy
#include <limits>
#include <numeric> // for accumulate
#include <string>
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/plot.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "openmc/plot.h"

#include <algorithm>
#define _USE_MATH_DEFINES // to make M_PI declared in Intel and MSVC compilers
#include <cmath>
#include <cstdio>
#include <fstream>
Expand Down Expand Up @@ -1328,7 +1327,7 @@ std::pair<Position, Direction> 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<double>(pixels()[0]);
double p1 = static_cast<double>(pixels()[1]);
Expand Down
Loading