|
5 | 5 | #include <iostream> |
6 | 6 | #include <limits> |
7 | 7 | #include <memory> |
| 8 | +#include <openpfc/constants.hpp> |
8 | 9 | #include <openpfc/core/decomposition.hpp> |
9 | 10 | #include <openpfc/core/world.hpp> |
10 | 11 | #include <openpfc/factory/decomposition_factory.hpp> |
|
40 | 41 |
|
41 | 42 | using namespace pfc; |
42 | 43 |
|
43 | | -const double PI = 3.141592653589793238463; |
44 | | - |
45 | 44 | class GaussianIC : public FieldModifier { |
46 | 45 | private: |
47 | 46 | double D = 1.0; |
@@ -107,9 +106,9 @@ class Diffusion : public Model { |
107 | 106 | size_t idx = 0; |
108 | 107 | auto spacing = get_spacing(w); |
109 | 108 | auto size = get_size(w); |
110 | | - double fx = 2.0 * PI / (spacing[0] * size[0]); |
111 | | - double fy = 2.0 * PI / (spacing[1] * size[1]); |
112 | | - double fz = 2.0 * PI / (spacing[2] * size[2]); |
| 109 | + double fx = 2.0 * constants::pi / (spacing[0] * size[0]); |
| 110 | + double fy = 2.0 * constants::pi / (spacing[1] * size[1]); |
| 111 | + double fz = 2.0 * constants::pi / (spacing[2] * size[2]); |
113 | 112 | for (int k = low[2]; k <= high[2]; k++) { |
114 | 113 | for (int j = low[1]; j <= high[1]; j++) { |
115 | 114 | for (int i = low[0]; i <= high[0]; i++) { |
@@ -177,7 +176,7 @@ void run_simulator(Simulator &s) { |
177 | 176 | void run() { |
178 | 177 | // Construct world, decomposition, fft and model |
179 | 178 | int L = 64; |
180 | | - double h = 2.0 * PI / 8.0; |
| 179 | + double h = 2.0 * constants::pi / 8.0; |
181 | 180 | double o = -0.5 * L * h; |
182 | 181 | std::array<int, 3> dimensions = {L, L, L}; |
183 | 182 | std::array<double, 3> discretization = {h, h, h}; |
|
0 commit comments