Skip to content

Commit e4e77d2

Browse files
committed
tidy more files: tumor_cell.h
1 parent d674533 commit e4e77d2

File tree

6 files changed

+106
-354
lines changed

6 files changed

+106
-354
lines changed

clang_output.txt

Lines changed: 0 additions & 323 deletions
Large diffs are not rendered by default.

src/cart_cell.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "core/behavior/behavior.h"
2929
#include "core/diffusion/diffusion_grid.h"
3030
#include "core/container/math_array.h"
31+
#include "core/agent/new_agent_event.h"
3132
#include "core/real_t.h"
3233
#include "core/interaction_force.h"
3334
#include "tumor_cell.h"

src/cart_tumor.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ int Simulate(int argc, const char** argv) {
115115
}
116116

117117
// OutputSummary operation
118-
auto* summary_op = new bdm::Operation("OutputSummary");
119-
// Set the interval for outputting CSV files
120-
summary_op->frequency_ = kOutputCsvInterval;
118+
auto* summary_op = new bdm::Operation("OutputSummary", kOutputCsvInterval);
121119
summary_op->AddOperationImpl(bdm::kCpu, new bdm::OutputSummary());
122120
scheduler->ScheduleOp(summary_op);
123121

src/diffusion_thomas_algorithm.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,15 @@ class DiffusionThomasAlgorithm : public DiffusionGrid {
164164
std::vector<real_t> thomas_c_z_;
165165

166166
/// Index jump for i-direction (x-axis)
167+
// NOLINTNEXTLINE(readability-identifier-naming)
167168
int jump_i_;
168169

169170
/// Index jump for j-direction (y-axis)
171+
// NOLINTNEXTLINE(readability-identifier-naming)
170172
int jump_j_;
171173

172174
/// Index jump for k-direction (z-axis)
175+
// NOLINTNEXTLINE(readability-identifier-naming)
173176
int jump_k_;
174177

175178

src/tumor_cell.h

Lines changed: 88 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@
2222
#ifndef TUMOR_CELL_H_
2323
#define TUMOR_CELL_H_
2424

25-
#include "biodynamo.h"
25+
#include "core/util/root.h"
26+
#include "core/agent/agent.h"
27+
#include "core/agent/agent.h" // Ensure bdm::Agent is directly included
28+
#include "core/agent/cell.h"
29+
#include "core/behavior/behavior.h"
30+
#include "core/diffusion/diffusion_grid.h"
31+
#include "core/agent/new_agent_event.h"
32+
#include "core/real_t.h"
33+
#include "core/interaction_force.h"
34+
#include "core/resource_manager.h"
35+
#include "core/scheduler.h"
2636
#include "core/container/math_array.h"
2737

2838
namespace bdm {
@@ -59,15 +69,40 @@ enum class TumorCellState : int {
5969
/// - Displacement computation applying pushing/adhesive forces between cells
6070
/// - Oncoprotein expression levels
6171
/// - Interactions with CAR-T cells
72+
6273
class TumorCell : public Cell {
6374
BDM_AGENT_HEADER(TumorCell, Cell, 1);
6475

6576
public:
66-
TumorCell() {}
77+
TumorCell()
78+
: state_(TumorCellState::kAlive),
79+
timer_state_(0),
80+
oxygen_dgrid_(nullptr),
81+
immunostimulatory_factor_dgrid_(nullptr),
82+
oncoproteine_level_(0.0),
83+
transformation_random_rate_(0.0),
84+
attached_to_cart_(false),
85+
fluid_fraction_(0.0),
86+
nuclear_volume_(0.0),
87+
target_cytoplasm_solid_(0.0),
88+
target_nucleus_solid_(0.0),
89+
target_fraction_fluid_(0.0),
90+
target_relation_cytoplasm_nucleus_(0.0),
91+
type_(0),
92+
oxygen_consumption_rate_(0.0),
93+
immunostimulatory_factor_secretion_rate_(0.0),
94+
constant1_oxygen_(0.0),
95+
constant2_oxygen_(0.0),
96+
constant1_immunostimulatory_factor_(0.0),
97+
constant2_immunostimulatory_factor_(0.0) {}
6798

6899
explicit TumorCell(const Real3& position);
69100

70-
virtual ~TumorCell() {}
101+
// Special member functions
102+
TumorCell(const TumorCell&) = default;
103+
TumorCell(TumorCell&&) = default;
104+
105+
~TumorCell() override = default;
71106

72107
/// Called when a new agent is created (after cell division)
73108
/// @param event The new agent event containing initialization data
@@ -198,76 +233,97 @@ class TumorCell : public Cell {
198233

199234
private:
200235
/// Current state of the tumor cell
201-
TumorCellState state_;
236+
// NOLINTNEXTLINE(readability-identifier-naming)
237+
TumorCellState state_ = TumorCellState::kAlive;
202238

203239
/// Timer to track time in the current state (in minutes)
204-
int timer_state_;
240+
// NOLINTNEXTLINE(readability-identifier-naming)
241+
int timer_state_ = 0;
205242

206243
/// Pointer to the oxygen diffusion grid
207-
DiffusionGrid* oxygen_dgrid_;
244+
// NOLINTNEXTLINE(readability-identifier-naming)
245+
DiffusionGrid* oxygen_dgrid_ = nullptr;
208246

209247
/// Pointer to the immunostimulatory factor diffusion grid
210-
DiffusionGrid* immunostimulatory_factor_dgrid_;
248+
// NOLINTNEXTLINE(readability-identifier-naming)
249+
DiffusionGrid* immunostimulatory_factor_dgrid_ = nullptr;
211250

212251
/// Level of oncoprotein expression
213-
real_t oncoproteine_level_;
252+
// NOLINTNEXTLINE(readability-identifier-naming)
253+
real_t oncoproteine_level_ = 0.0;
214254

215255
/// Transition random rate between states:
216256
/// Affects the probability of transitioning and depends on the individual
217257
/// cell. This rate is kept constant during the cell's lifetime.
218-
real_t transformation_random_rate_;
258+
// NOLINTNEXTLINE(readability-identifier-naming)
259+
real_t transformation_random_rate_ = 0.0;
219260

220261
/// Flag indicating if the cell is attached to a CAR-T cell
221-
bool attached_to_cart_;
262+
// NOLINTNEXTLINE(readability-identifier-naming)
263+
bool attached_to_cart_ = false;
222264

223265
/// Fluid fraction of the cell volume
224-
real_t fluid_fraction_;
266+
// NOLINTNEXTLINE(readability-identifier-naming)
267+
real_t fluid_fraction_ = 0.0;
225268

226269
/// Volume of the nucleus
227-
real_t nuclear_volume_;
270+
// NOLINTNEXTLINE(readability-identifier-naming)
271+
real_t nuclear_volume_ = 0.0;
228272

229273
/// Target cytoplasm solid volume for exponential relaxation
230274
///
231275
/// Used for growing or shrinking tumor cells. The volume change follows
232276
/// an exponential relaxation equation toward this target volume.
233-
real_t target_cytoplasm_solid_;
277+
// NOLINTNEXTLINE(readability-identifier-naming)
278+
real_t target_cytoplasm_solid_ = 0.0;
234279

235280
/// Target nucleus solid volume for exponential relaxation
236-
real_t target_nucleus_solid_;
281+
// NOLINTNEXTLINE(readability-identifier-naming)
282+
real_t target_nucleus_solid_ = 0.0;
237283

238284
/// Target fluid fraction for exponential relaxation
239-
real_t target_fraction_fluid_;
285+
// NOLINTNEXTLINE(readability-identifier-naming)
286+
real_t target_fraction_fluid_ = 0.0;
240287

241288
/// Target relation between cytoplasm and nucleus volumes
242-
real_t target_relation_cytoplasm_nucleus_;
289+
// NOLINTNEXTLINE(readability-identifier-naming)
290+
real_t target_relation_cytoplasm_nucleus_ = 0.0;
243291

244292
/// Cell type according to oncoprotein level:
245293
/// Types 1-4: 1 is the most mutated and proliferative type, 4 is the least
246294
/// aggressive. Type 5 means the cell is dead.
247-
int type_;
295+
// NOLINTNEXTLINE(readability-identifier-naming)
296+
int type_ = 0;
248297

249298
/// Velocity of the cell in the previous time step
250-
Real3 older_velocity_;
299+
// NOLINTNEXTLINE(readability-identifier-naming)
300+
Real3 older_velocity_ = {};
251301

252302
/// Rate of oxygen consumption by the cell
253-
real_t oxygen_consumption_rate_;
303+
// NOLINTNEXTLINE(readability-identifier-naming)
304+
real_t oxygen_consumption_rate_ = 0.0;
254305

255306
/// Rate of immunostimulatory factor secretion by the cell
256-
real_t immunostimulatory_factor_secretion_rate_;
307+
// NOLINTNEXTLINE(readability-identifier-naming)
308+
real_t immunostimulatory_factor_secretion_rate_ = 0.0;
257309

258310
/// Constant 1 for oxygen consumption/secretion differential equation solution
259-
real_t constant1_oxygen_;
311+
// NOLINTNEXTLINE(readability-identifier-naming)
312+
real_t constant1_oxygen_ = 0.0;
260313

261314
/// Constant 2 for oxygen consumption/secretion differential equation solution
262-
real_t constant2_oxygen_;
315+
// NOLINTNEXTLINE(readability-identifier-naming)
316+
real_t constant2_oxygen_ = 0.0;
263317

264318
/// Constant 1 for immunostimulatory factor consumption/secretion differential
265319
/// equation solution
266-
real_t constant1_immunostimulatory_factor_;
320+
// NOLINTNEXTLINE(readability-identifier-naming)
321+
real_t constant1_immunostimulatory_factor_ = 0.0;
267322

268323
/// Constant 2 for immunostimulatory factor consumption/secretion differential
269324
/// equation solution
270-
real_t constant2_immunostimulatory_factor_;
325+
// NOLINTNEXTLINE(readability-identifier-naming)
326+
real_t constant2_immunostimulatory_factor_ = 0.0;
271327
};
272328

273329
/// Behavior class for controlling tumor cell state transitions and growth
@@ -276,12 +332,19 @@ class TumorCell : public Cell {
276332
/// transitions between different cell states, growth, proliferation, and death
277333
/// processes. It includes logic for determining when cells should enter
278334
/// necrosis based on oxygen levels and other environmental factors.
335+
279336
struct StateControlGrowProliferate : public Behavior {
280337
BDM_BEHAVIOR_HEADER(StateControlGrowProliferate, Behavior, 1);
281338

282339
StateControlGrowProliferate() { AlwaysCopyToNew(); }
283340

284-
virtual ~StateControlGrowProliferate() {}
341+
// Special member functions
342+
StateControlGrowProliferate(const StateControlGrowProliferate&) = default;
343+
StateControlGrowProliferate& operator=(const StateControlGrowProliferate&) = default;
344+
StateControlGrowProliferate(StateControlGrowProliferate&&) = default;
345+
StateControlGrowProliferate& operator=(StateControlGrowProliferate&&) = default;
346+
347+
~StateControlGrowProliferate() override = default;
285348

286349
/// Execute the state control and growth behavior
287350
void Run(Agent* agent) override;

src/utils_aux.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@
2323
#define CORE_UTIL_UTILS_AUX_H_
2424

2525
#include <cstdint>
26+
#include <cstddef>
2627
#include <tuple>
2728
#include <vector>
28-
#include "biodynamo.h"
29+
#include "core/real_t.h"
2930
#include "core/container/math_array.h"
31+
#include "core/operation/operation.h"
32+
#include "core/operation/operation_registry.h"
3033

3134
namespace bdm {
3235
/// Forward declaration of TumorCell class
@@ -77,8 +80,15 @@ ComputeNumberTumorCellsAndRadius();
7780
struct OutputSummary : public StandaloneOperationImpl {
7881
BDM_OP_HEADER(OutputSummary);
7982

80-
/// Frequency of output (every N simulation steps)
81-
uint64_t frequency_ = 1;
83+
public:
84+
void SetFrequency(uint64_t frequency) { frequency_ = frequency; }
85+
uint64_t GetFrequency() const { return frequency_; }
86+
87+
private:
88+
/// Frequency of output (every N simulation steps)
89+
// NOLINTNEXTLINE(readability-identifier-naming)
90+
uint64_t frequency_ = 1;
91+
8292

8393
/// Collects current simulation data and writes it to CSV files
8494
///

0 commit comments

Comments
 (0)