This commit is contained in:
Satoshi Misumi 2026-07-20 23:21:30 +09:00 committed by GitHub
commit ebd83c2fbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 10 deletions

View file

@ -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>

View file

@ -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>
@ -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);

View file

@ -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>
@ -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]);