|
19 | 19 | * for the compiler-research.org organization. |
20 | 20 | */ |
21 | 21 |
|
22 | | -#ifndef HOME_USUARIO_DESKTOP_VASSIL_CARTOPIAX_SRC_DIFFUSION_THOMAS_ALGORITHM_H_ |
23 | | -#define HOME_USUARIO_DESKTOP_VASSIL_CARTOPIAX_SRC_DIFFUSION_THOMAS_ALGORITHM_H_ |
| 22 | +#ifndef DIFFUSION_THOMAS_ALGORITHM_H_ |
| 23 | +#define DIFFUSION_THOMAS_ALGORITHM_H_ |
24 | 24 |
|
25 | 25 | #include <string> |
26 | 26 | #include <vector> |
27 | | - |
| 27 | +#include "biodynamo.h" |
28 | 28 | #include "core/diffusion/diffusion_grid.h" |
29 | 29 |
|
30 | 30 | namespace bdm { |
31 | 31 |
|
32 | | -// Forward declarations |
33 | | -using real_t = double; |
34 | | - |
35 | 32 | /// Continuum model for the 3D heat equation with exponential decay |
36 | 33 | /// |
37 | 34 | /// Implements the diffusion equation, solved implicitly: ∂t u = ∇D∇u - μu |
38 | 35 | /// Uses the Thomas algorithm for solving tridiagonal systems efficiently. |
39 | 36 | class DiffusionThomasAlgorithm : public DiffusionGrid { |
40 | 37 | public: |
41 | | - DiffusionThomasAlgorithm() |
42 | | - : resolution_(0), |
43 | | - d_space_(0.0), |
44 | | - thomas_denom_x_(), |
45 | | - thomas_c_x_(), |
46 | | - thomas_denom_y_(), |
47 | | - thomas_c_y_(), |
48 | | - thomas_denom_z_(), |
49 | | - thomas_c_z_(), |
50 | | - jump_i_(0), |
51 | | - jump_j_(0), |
52 | | - jump_k_(0), |
53 | | - constant1_(0.0), |
54 | | - constant1a_(0.0), |
55 | | - constant2_(0.0), |
56 | | - constant3_(0.0), |
57 | | - constant3a_(0.0), |
58 | | - dirichlet_border_(false) {} |
| 38 | + DiffusionThomasAlgorithm() = default; |
59 | 39 |
|
60 | 40 | DiffusionThomasAlgorithm(int substance_id, std::string substance_name, |
61 | 41 | real_t dc, real_t mu, int resolution, real_t dt, |
62 | 42 | bool dirichlet_border); |
63 | 43 |
|
64 | 44 | /// Concentration setters |
65 | 45 | void SetConcentration(real_t x, real_t y, real_t z, real_t amount) { |
66 | | - SetConcentration(GetBoxIndex(static_cast<size_t>(x), static_cast<size_t>(y), static_cast<size_t>(z)), amount); |
| 46 | + SetConcentration(GetBoxIndex(x, y, z), amount); |
67 | 47 | }; |
68 | 48 |
|
69 | 49 | void SetConcentration(size_t idx, real_t amount); |
@@ -204,11 +184,11 @@ class DiffusionThomasAlgorithm : public DiffusionGrid { |
204 | 184 | /// @param y Y-coordinate in voxel space |
205 | 185 | /// @param z Z-coordinate in voxel space |
206 | 186 | /// @return Linear index in the flattened 3D array |
207 | | - [[nodiscard]] size_t GetBoxIndex(size_t x, size_t y, size_t z) const; |
| 187 | + size_t GetBoxIndex(size_t x, size_t y, size_t z) const; |
208 | 188 |
|
209 | 189 | BDM_CLASS_DEF_OVERRIDE(DiffusionThomasAlgorithm, 1); |
210 | 190 | }; |
211 | 191 |
|
212 | 192 | } // namespace bdm |
213 | 193 |
|
214 | | -#endif // HOME_USUARIO_DESKTOP_VASSIL_CARTOPIAX_SRC_DIFFUSION_THOMAS_ALGORITHM_H_ |
| 194 | +#endif // DIFFUSION_THOMAS_ALGORITHM_H_ |
0 commit comments