Skip to content

Commit a8471bb

Browse files
committed
changed all comments to /// in the .h and changed some of them
1 parent bcd0b26 commit a8471bb

File tree

7 files changed

+254
-338
lines changed

7 files changed

+254
-338
lines changed

src/cart_cell.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ namespace bdm {
3636
/// during its lifecycle in the simulation.
3737
enum class CartCellState : int {
3838
kAlive=0,///< Living cell state - the cell is alive and functioning normally
39+
3940
kApoptotic=1///< Apoptotic phase - the cell is undergoing programmed cell death characterized by cell shrinkage and controlled death
4041
};
4142

@@ -204,7 +205,7 @@ class CartCell : public Cell {
204205
/// Behavior class for controlling CAR-T cell state transitions
205206
///
206207
/// This behavior handles the state control logic for CAR-T cells, managing
207-
/// transitions between different cell states such as alive and apoptotic phases.
208+
/// transitions between different cell states: alive and apoptotic phases.
208209
/// It inherits from the base Behavior class and implements the Run method to
209210
/// execute the state control logic during simulation steps.
210211
struct StateControlCart : public Behavior {

src/diffusion_thomas_algorithm.h

Lines changed: 83 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@
2727

2828
namespace bdm {
2929

30-
/**
31-
* @brief Continuum model for the 3D heat equation with exponential decay
32-
*
33-
* Implements the diffusion equation: ∂t u = ∇D∇u - μu
34-
* Uses the Thomas algorithm for solving tridiagonal systems efficiently.
35-
*/
30+
/// Continuum model for the 3D heat equation with exponential decay
31+
///
32+
/// Implements the diffusion equation, solved implicitly: ∂t u = ∇D∇u - μu
33+
/// Uses the Thomas algorithm for solving tridiagonal systems efficiently.
3634
class DiffusionThomasAlgorithm : public DiffusionGrid {
3735
public:
3836
DiffusionThomasAlgorithm() = default;
@@ -53,172 +51,137 @@ class DiffusionThomasAlgorithm : public DiffusionGrid {
5351
void SetConcentration(size_t idx, real_t amount);
5452

5553

56-
/*
57-
* These methods are overridden but empty because they are not used.
58-
* This should be fixed in future versions of BioDynaMo.
59-
*/
54+
/// These methods are overridden but empty because they are not used.
55+
/// This should be fixed in future versions of BioDynaMo.
6056
void DiffuseWithClosedEdge(real_t dt) override{};
6157
void DiffuseWithOpenEdge(real_t dt) override{};
6258
void DiffuseWithNeumann(real_t dt) override{};
6359
void DiffuseWithPeriodic(real_t dt) override{};
6460
void DiffuseWithDirichlet(real_t dt) override{};
6561

6662

67-
/** @brief Perform chemical diffusion using Thomas algorithm
68-
*
69-
* Computes the diffusion of the substance using the Thomas algorithm
70-
* for solving tridiagonal systems efficiently.
71-
*
72-
* @param dt Time step for the diffusion computation
73-
*/
63+
/// Perform chemical diffusion using Thomas algorithm
64+
///
65+
/// Computes the diffusion of the substance using the Thomas algorithm
66+
/// for solving tridiagonal systems efficiently.
67+
///
68+
/// @param dt Time step for the diffusion computation
7469
void DiffuseChemical(real_t dt);
7570

76-
/** @brief Execute one simulation step
77-
*
78-
* Main stepping function that performs one time step of the simulation,
79-
* including diffusion and cellular consumption/secretion.
80-
*
81-
* @param dt Time step for the simulation
82-
*/
71+
/// Execute one simulation step
72+
///
73+
/// Main stepping function that performs one time step of the simulation,
74+
/// including diffusion and cellular consumption/secretion.
75+
///
76+
/// @param dt Time step for the simulation
8377
void Step(real_t dt) override;
84-
/** @brief Compute cellular consumption and secretion effects
85-
*
86-
* Handles secretion or consumption of substances following the differential equation:
87-
*
88-
* ∂ρ/∂t = ∇·(D ∇ρ) − λ · ρ + sum_{cells in voxel}((V_k / V_voxel) · [ S_k · ( ρ*_k − ρ ) − (S_k + U_k) · ρ ])
89-
*
90-
* Where:
91-
* - ρ = concentration of the substance in the microenvironment
92-
* - S_k = secretion rate of cell k
93-
* - U_k = uptake (consumption) rate of cell k
94-
* - ρ*_k = saturation (target) density for secretion
95-
* - V_k = volume of cell k (approximated to default volume of new tumor cell)
96-
* - V_voxel = volume of the voxel containing the cell
97-
* - dt = simulation time step
98-
*
99-
* In this class, we only model the secretion and consumption of the substance,
100-
* not its diffusion, which follows:
101-
* (ρ − σ)/dt = sum_{cells in voxel}((V_k / V_voxel) · [ S_k · ( ρ*_k − ρ ) − (S_k + U_k) · ρ ])
102-
*
103-
* Where σ is the concentration at the previous time step (may include diffusion term).
104-
* The solution is:
105-
* ρⁿ⁺¹ = (ρⁿ + dt · (V_k / V_voxel) · S_k · ρ*_k) / [1 + dt · (V_k / V_voxel) · (S_k + U_k)]
106-
*
107-
* Where:
108-
* - ρⁿ = current concentration
109-
* - ρⁿ⁺¹ = updated concentration after secretion/uptake
110-
*
111-
* This assumes secretion is toward a saturation level, and uptake is proportional to ρ.
112-
*
113-
* In a future version, consider using a Behavior associated to each agent but controlling the time in which it is applied so that it is executed always after the diffusion module
114-
*
115-
*/
78+
79+
/// Compute cellular consumption and secretion effects
80+
///
81+
/// Handles secretion or consumption of substances following the differential equation:
82+
///
83+
/// ∂ρ/∂t = ∇·(D ∇ρ) − λ · ρ + sum_{cells in voxel}((V_k / V_voxel) · [ S_k · ( ρ*_k − ρ ) − (S_k + U_k) · ρ ])
84+
///
85+
/// Where:
86+
/// - ρ = concentration of the substance in the microenvironment
87+
/// - S_k = secretion rate of cell k
88+
/// - U_k = uptake (consumption) rate of cell k
89+
/// - ρ*_k = saturation (target) density for secretion
90+
/// - V_k = volume of cell k (approximated to default volume of new tumor cell)
91+
/// - V_voxel = volume of the voxel containing the cell
92+
/// - dt = simulation time step
93+
///
94+
/// In this class, we only model the secretion and consumption of the substance,
95+
/// not its diffusion, which follows:
96+
/// (ρ − σ)/dt = sum_{cells in voxel}((V_k / V_voxel) · [ S_k · ( ρ*_k − ρ ) − (S_k + U_k) · ρ ])
97+
///
98+
/// Where σ is the concentration at the previous time step (may include diffusion term).
99+
/// The solution is:
100+
/// ρⁿ⁺¹ = (ρⁿ + dt · (V_k / V_voxel) · S_k · ρ*_k) / [1 + dt · (V_k / V_voxel) · (S_k + U_k)]
101+
///
102+
/// Where:
103+
/// - ρⁿ = current concentration
104+
/// - ρⁿ⁺¹ = updated concentration after secretion/uptake
105+
///
106+
/// This assumes secretion is toward a saturation level, and uptake is proportional to ρ.
107+
///
108+
/// In a future version, consider using a Behavior associated to each agent but controlling the time in which it is applied so that it is executed always after the diffusion module
116109
void ComputeConsumptionsSecretions();
117110

118-
/** @name Private Member Variables
119-
* @brief Internal data structures and parameters
120-
* @{
121-
*/
122111
private:
123-
/** @brief Number of voxels in each spatial direction */
112+
/// Number of voxels in each spatial direction
124113
size_t resolution_;
125114

126-
/** @brief Voxel side length in micrometers */
115+
/// Voxel side length in micrometers
127116
real_t d_space_;
128117

129-
/** @name Thomas Algorithm Coefficients
130-
* @brief Precomputed coefficients for Thomas algorithm in each direction
131-
* @{
132-
*/
133-
134-
/** @brief Denominators for x-direction Thomas algorithm */
118+
/// Denominators for x-direction Thomas algorithm
135119
std::vector<real_t> thomas_denom_x_;
136120

137-
/** @brief Coefficients for x-direction Thomas algorithm */
121+
/// Coefficients for x-direction Thomas algorithm
138122
std::vector<real_t> thomas_c_x_;
139123

140-
/** @brief Denominators for y-direction Thomas algorithm */
124+
/// Denominators for y-direction Thomas algorithm
141125
std::vector<real_t> thomas_denom_y_;
142126

143-
/** @brief Coefficients for y-direction Thomas algorithm */
127+
/// Coefficients for y-direction Thomas algorithm
144128
std::vector<real_t> thomas_c_y_;
145129

146-
/** @brief Denominators for z-direction Thomas algorithm */
130+
/// Denominators for z-direction Thomas algorithm
147131
std::vector<real_t> thomas_denom_z_;
148132

149-
/** @brief Coefficients for z-direction Thomas algorithm */
133+
/// Coefficients for z-direction Thomas algorithm
150134
std::vector<real_t> thomas_c_z_;
151135

152-
/** @} */ // end of Thomas Algorithm Coefficients group
153-
154-
/** @name Index Jump Values
155-
* @brief Precomputed index jumps for 3D array traversal
156-
* @{
157-
*/
158-
159-
/** @brief Index jump for i-direction (x-axis) */
136+
/// Index jump for i-direction (x-axis)
160137
int jump_i_;
161138

162-
/** @brief Index jump for j-direction (y-axis) */
139+
/// Index jump for j-direction (y-axis)
163140
int jump_j_;
164141

165-
/** @brief Index jump for k-direction (z-axis) */
142+
/// Index jump for k-direction (z-axis)
166143
int jump_k_;
167144

168-
/** @} */ // end of Index Jump Values group
169-
170-
/** @name Precomputed Constants
171-
* @brief Constants used in diffusion calculations
172-
* @{
173-
*/
174-
175-
/** @brief First diffusion constant */
145+
/// First diffusion constant
176146
real_t constant1_;
177147

178-
/** @brief Alternative first diffusion constant */
148+
/// Alternative first diffusion constant
179149
real_t constant1a_;
180150

181-
/** @brief Second diffusion constant */
151+
/// Second diffusion constant
182152
real_t constant2_;
183153

184-
/** @brief Third diffusion constant */
154+
/// Third diffusion constant
185155
real_t constant3_;
186156

187-
/** @brief Alternative third diffusion constant */
157+
/// Alternative third diffusion constant
188158
real_t constant3a_;
189159

190-
/** @} */ // end of Precomputed Constants group
191-
192-
/** @brief Flag indicating Dirichlet boundary conditions */
160+
/// Flag indicating Dirichlet boundary conditions
193161
bool dirichlet_border_;
194162

195-
/** @} */ // end of Private Member Variables group
196-
197-
/** @brief Initialize Thomas algorithm coefficient vectors
198-
*
199-
* Sets up the precomputed coefficients for efficient Thomas algorithm
200-
* execution in the specified direction.
201-
*
202-
* @param thomas_denom Reference to denominator vector to initialize
203-
* @param thomas_c Reference to coefficient vector to initialize
204-
*/
163+
/// Initialize Thomas algorithm coefficient vectors
164+
///
165+
/// Sets up the precomputed coefficients for efficient Thomas algorithm
166+
/// execution in the specified direction.
167+
///
168+
/// @param thomas_denom Reference to denominator vector to initialize
169+
/// @param thomas_c Reference to coefficient vector to initialize
205170
void InitializeThomasAlgorithmVectors(std::vector<real_t>& thomas_denom,
206171
std::vector<real_t>& thomas_c);
207172

208-
/** @brief Apply Dirichlet boundary conditions to the diffusion grid
209-
*
210-
* Sets the boundary values according to Dirichlet boundary conditions,
211-
* maintaining constant values at the grid boundaries.
212-
*/
173+
/// Apply Dirichlet boundary conditions to the diffusion grid
174+
///
175+
/// Sets the boundary values according to Dirichlet boundary conditions,
176+
/// maintaining constant values at the grid boundaries.
213177
void ApplyDirichletBoundaryConditions();
214178

215-
/** @brief Convert 3D coordinates to linear index
216-
*
217-
* @param x X-coordinate in voxel space
218-
* @param y Y-coordinate in voxel space
219-
* @param z Z-coordinate in voxel space
220-
* @return Linear index in the flattened 3D array
221-
*/
179+
/// Convert 3D coordinates to linear index
180+
///
181+
/// @param x X-coordinate in voxel space
182+
/// @param y Y-coordinate in voxel space
183+
/// @param z Z-coordinate in voxel space
184+
/// @return Linear index in the flattened 3D array
222185
size_t GetBoxIndex(size_t x, size_t y, size_t z) const;
223186

224187

src/forces_tumor_cart.h

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,27 @@
3131

3232
namespace bdm {
3333

34-
/**
35-
* @brief Custom interaction force implementation for velocity-based cell interactions
36-
*
37-
* This class implements a specialized interaction force that takes into account
38-
* the velocity of cells when calculating forces between agents (tumor cells and CAR-T cells).
39-
* It extends the base InteractionForce class to provide custom force calculations
40-
* specific to the tumor-CAR-T cell interaction simulation.
41-
*/
34+
/// Custom interaction force implementation for velocity-based cell interactions
35+
///
36+
/// This class implements a specialized interaction force that takes into account
37+
/// the velocity of cells when calculating forces between agents (tumor cells and CAR-T cells).
38+
/// It extends the base InteractionForce class to provide custom force calculations
39+
/// specific to the tumor-CAR-T cell interaction simulation.
4240
class InteractionVelocity : public InteractionForce {
4341
public:
4442
InteractionVelocity() = default;
4543

4644
~InteractionVelocity() override = default;
4745

48-
/** @brief Calculate interaction force between two agents
49-
*
50-
* Computes the force vector between two agents (cells) based on their
51-
* positions, properties, and velocities. This method is called by the
52-
* mechanical forces operation during each simulation step.
53-
*
54-
* @param lhs Pointer to the first agent (left-hand side)
55-
* @param rhs Pointer to the second agent (right-hand side)
56-
* @return Real4 vector containing the force components (fx, fy, fz, magnitude)
57-
*/
46+
/// Calculate interaction force between two agents
47+
///
48+
/// Computes the force vector between two agents (cells) based on their
49+
/// positions, properties, and velocities. This method is called by the
50+
/// mechanical forces operation during each simulation step.
51+
///
52+
/// @param lhs Pointer to the first agent (left-hand side)
53+
/// @param rhs Pointer to the second agent (right-hand side)
54+
/// @return Real4 vector containing the force components (fx, fy, fz, magnitude)
5855
Real4 Calculate(const Agent* lhs, const Agent* rhs) const override;
5956

6057
InteractionForce* NewCopy() const override;

src/hyperparams.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626

2727
namespace bdm {
2828

29+
///This file contains hyperparameters used in the simulation. Change: In a future version it needs to be changed into a params file with no need to be recompiled
2930

30-
31-
31+
///
3232
/// TumorCell Hyperparameters
33+
///
3334

3435
/// Rate of secretion of immunostimulatory factor of tumor cells per minute
3536
constexpr real_t kRateSecretionImmunostimulatoryFactor= 10.0;
@@ -80,6 +81,7 @@ constexpr real_t kVolumeRelaxarionRateFluidNecroticLysed = 0.050/60.0;
8081
///
8182
/// General Hyperparameters
8283
///
84+
8385
/// Seed for random number generation
8486
constexpr int kSeed =3;
8587

src/tumor_cell.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ void StateControlGrowProliferate::Run(Agent* agent) {
435435
break;
436436
}
437437
case TumorCellState::kApoptotic:{
438-
//CHANGE write this in the function that causes apoptosis
438+
//CHANGE write this in the function that causes apoptosis
439439
// //Stop Secretion and reduce consumption
440440
// for (auto* beh : cell->GetAllBehaviors()) {
441441
// if (auto* c = dynamic_cast<Consumption*>(beh)) {c->SetQuantity(c->GetQuantity()*kReductionConsumptionDeadCells);}// Reduce consumption rate

0 commit comments

Comments
 (0)