Skip to content

Commit 3c88b85

Browse files
committed
solved all left magic numbers
1 parent 3c7d252 commit 3c88b85

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/cart_tumor.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ int Simulate(int argc, const char** argv) {
4848
// Periodic boundary conditions
4949
param->bound_space = Param::BoundSpaceMode::kTorus;
5050
// Cube of kBoundedSpaceLength³ centered at origin
51-
param->min_bound = -kBoundedSpaceLength / 2.0;
52-
param->max_bound = kBoundedSpaceLength / 2.0;
51+
param->min_bound = -kBoundedSpaceLength / kHalf;
52+
param->max_bound = kBoundedSpaceLength / kHalf;
5353
param->simulation_time_step = kDt;
5454
};
5555

src/diffusion_thomas_algorithm.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ DiffusionThomasAlgorithm::DiffusionThomasAlgorithm(int substance_id,
5050
jump_k_(resolution_ * resolution_),
5151
spatial_diffusion_coeff_(dc * dt / (d_space_ * d_space_)),
5252
neg_diffusion_factor_(-spatial_diffusion_coeff_),
53-
temporal_decay_coeff_(mu * dt / 3.0),
53+
temporal_decay_coeff_(mu * dt / kThird),
5454
central_coeff_(1.0 + 2 * spatial_diffusion_coeff_ +
5555
temporal_decay_coeff_),
5656
edge_coeff_(1.0 + spatial_diffusion_coeff_ + temporal_decay_coeff_),

src/hyperparams.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ constexpr real_t kReductionConsumptionDeadCells = 0.1;
141141

142142
/// Constant for division by 2.0
143143
constexpr real_t kHalf = 2.0;
144+
/// Constant for division by 3.0
145+
constexpr real_t kThird = 3.0;
144146

145147
/// Chemicals
146148
/// Number of voxels per axis for the substances grid

0 commit comments

Comments
 (0)