Skip to content

Commit 108fe7d

Browse files
authored
Merge branch 'ci-salva' into midterm_code_push
2 parents 136f1a8 + 07ed3cd commit 108fe7d

File tree

7 files changed

+31
-34
lines changed

7 files changed

+31
-34
lines changed

CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1+
# -----------------------------------------------------------------------------
2+
#
3+
# Copyright (C) 2021 CERN & University of Surrey for the benefit of the
4+
# BioDynaMo collaboration. All Rights Reserved.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
#
9+
# See the LICENSE file distributed with this work for details.
10+
# See the NOTICE file distributed with this work for additional information
11+
# regarding copyright ownership.
12+
#
13+
# -----------------------------------------------------------------------------
114
cmake_minimum_required(VERSION 3.19.3)
2-
project(CARTopiaX)
15+
project(cart_tumor)
16+
317

418
# BioDynaMo curretly uses the C++17 standard.
519
set(CMAKE_CXX_STANDARD 17)

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The simulation integrates computational modeling and biological insights to expl
1818
7. [Acknowledgments](#acknowledgments)
1919
8. [License](#license)
2020

21+
2122
---
2223

2324
## Project Overview
@@ -51,6 +52,7 @@ Clone the repository:
5152
```bash
5253
git clone https://github.com/compiler-research/CARTopiaX.git
5354
cd CARTopiaX
55+
5456
```
5557

5658
---
@@ -86,6 +88,7 @@ biodynamo run
8688
**Option 2:**
8789
Directly from the build directory:
8890
```bash
91+
8992
./build/CARTopiaX
9093
```
9194

@@ -98,6 +101,7 @@ Data about tumor growth and diffrent types of cell populations is output in ./ou
98101
To visualize the results in paraview use:
99102
```bash
100103
paraview ./output/CARTopiaX/CARTopiaX.pvsm
104+
101105
```
102106

103107
---

src/cart_cell.cc

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ CartCell::CartCell(const Real3& position) {
3838
SetNuclearVolume(kDefaultVolumeNucleusCartCell);
3939

4040

41+
42+
ResourceManager &rm = *Simulation::GetActive()->GetResourceManager();
4143
// Pointer to oxygen diffusion grid
42-
auto &rm = *Simulation::GetActive()->GetResourceManager();
4344
oxygen_dgrid_ = rm.GetDiffusionGrid("oxygen");
4445
// Pointer to immunostimulatory_factor diffusion grid
45-
immunostimulatory_factor_dgrid_ = rm.GetDiffusionGrid("immunostimulatory_factor");
46+
immunostimulatory_factor_dgrid_ = rm.GetDiffusionGrid("immunostimulatory_factor");
4647
// Initially not attached to a tumor cell
4748
attached_to_tumor_cell_ = false;
4849
// Initialize attached cell pointer to null
@@ -64,7 +65,9 @@ CartCell::CartCell(const Real3& position) {
6465

6566
// Cart cells can move if they are alive and not attached to a tumor cell
6667
bool CartCell::DoesCellMove() {
67-
return state_ == CartCellState::kAlive && !attached_to_tumor_cell_;
68+
69+
return (state_ == CartCellState::kAlive && !attached_to_tumor_cell_);
70+
6871
}
6972

7073

@@ -138,11 +141,10 @@ Real3 CartCell::CalculateDisplacement(const InteractionForce* force,
138141

139142
Real3 translation_velocity_on_point_mass{0, 0, 0};
140143

141-
//--------------------------------------------
142-
//Adhesion and repulsion forces
143-
//--------------------------------------------
144144
// We check for every neighbor object if they touch us, i.e. push us
145145
// away and agreagate the velocities
146+
147+
146148
uint64_t non_zero_neighbor_forces = 0;
147149
if (!IsStatic()) {
148150
auto* ctxt = Simulation::GetActive()->GetExecutionContext();
@@ -164,31 +166,11 @@ Real3 CartCell::CalculateDisplacement(const InteractionForce* force,
164166
}
165167
}
166168

167-
//--------------------------------------------
168-
169-
//Still in progress
170-
Real3 motility{0, 0, 0};
171-
172-
if (DoesCellMove()){
173-
//compute motility
174-
}
175-
176-
177169

178-
179-
180-
181-
182-
183-
184-
185-
//--------------------------------------------
186170
// Two step Adams-Bashforth approximation of the time derivative for position
187171
// position(t + dt) ≈ position(t) + dt * [ 1.5 * velocity(t) - 0.5 * velocity(t - dt) ]
188-
//--------------------------------------------
189172
movement_at_next_step += translation_velocity_on_point_mass * kDnew + older_velocity_ * kDold;
190173

191-
192174
older_velocity_ = translation_velocity_on_point_mass;
193175

194176
// Displacement
@@ -204,7 +186,6 @@ real_t CartCell::ConsumeSecreteSubstance(int substance_id, real_t old_concentrat
204186
} else if (substance_id == immunostimulatory_factor_dgrid_->GetContinuumId()) {
205187
// This point should never be reached
206188
res= old_concentration;
207-
208189
} else {
209190
throw std::invalid_argument("Unknown substance id: " + std::to_string(substance_id));
210191
}
@@ -291,4 +272,4 @@ void StateControlCart::Run(Agent* agent) {
291272
}
292273
}
293274

294-
} // namespace bdm
275+
} // namespace bdm

src/cart_cell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,4 @@ struct StateControlCart : public Behavior {
221221

222222
} // namespace bdm
223223

224-
#endif
224+
#endif // CART_CELL_H_

src/cart_tumor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ enum Substances { kImmunostimulatoryFactor, kOxygen };
3030
/// Function declaration for the main simulation
3131
int Simulate(int argc, const char** argv);
3232

33-
3433
} // namespace bdm
3534

3635
#endif // CART_TUMOR_H_

src/hyperparams.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ constexpr real_t kVolumeRelaxarionRateFluidNecroticLysed = 0.050/60.0;
8181
///
8282
/// General Hyperparameters
8383
///
84-
8584
/// Seed for random number generation
8685
constexpr int kSeed =3;
8786

@@ -193,4 +192,4 @@ constexpr real_t kDefaultFractionFluidCartCell = 0.75;
193192

194193
} // namespace bdm
195194

196-
#endif // TUMOR_HYPERPARAMS_H_
195+
#endif // TUMOR_HYPERPARAMS_H_

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)