1919 * for the compiler-research.org organization.
2020 */
2121
22- #include " cart_cell.h"
2322#include < algorithm>
2423#include < cstdint>
2524#include < stdexcept>
2625#include < string>
27- #include " hyperparams.h"
28- #include " core/util/root.h"
26+
2927#include " core/agent/agent.h"
3028#include " core/agent/cell.h"
31- #include " core/resource_manager .h"
29+ #include " core/agent/new_agent_event .h"
3230#include " core/behavior/behavior.h"
33- #include " core/diffusion/diffusion_grid.h"
3431#include " core/container/math_array.h"
32+ #include " core/diffusion/diffusion_grid.h"
3533#include " core/functor.h"
36- #include " core/agent/new_agent_event .h"
34+ #include " core/interaction_force .h"
3735#include " core/real_t.h"
36+ #include " core/resource_manager.h"
3837#include " core/util/log.h"
39- #include " core/interaction_force.h"
38+ #include " core/util/root.h"
39+
40+ #include " cart_cell.h"
41+ #include " hyperparams.h"
4042#include " tumor_cell.h"
4143#include " utils_aux.h"
4244
4345namespace bdm {
4446
45-
4647CartCell::CartCell (const Real3& position)
4748 : state_(CartCellState::kAlive ),
4849 timer_state_ (0 ),
@@ -66,7 +67,8 @@ CartCell::CartCell(const Real3& position)
6667 SetVolume (kDefaultVolumeNewCartCell );
6768 const ResourceManager& rm = *Simulation::GetActive ()->GetResourceManager ();
6869 oxygen_dgrid_ = rm.GetDiffusionGrid (" oxygen" );
69- immunostimulatory_factor_dgrid_ = rm.GetDiffusionGrid (" immunostimulatory_factor" );
70+ immunostimulatory_factor_dgrid_ =
71+ rm.GetDiffusionGrid (" immunostimulatory_factor" );
7072 ComputeConstantsConsumptionSecretion ();
7173}
7274
@@ -87,8 +89,8 @@ real_t CartCell::GetTargetTotalVolume() const {
8789// convergence
8890// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
8991void CartCell::ChangeVolumeExponentialRelaxationEquation (
90- real_t relaxation_rate_cytoplasm, real_t relaxation_rate_nucleus,
91- real_t relaxation_rate_fluid) {
92+ real_t relaxation_rate_cytoplasm, real_t relaxation_rate_nucleus,
93+ real_t relaxation_rate_fluid) {
9294 // Exponential relaxation towards the target volume
9395 const real_t current_total_volume = GetVolume ();
9496 const real_t fluid_fraction = GetFluidFraction ();
@@ -110,7 +112,8 @@ void CartCell::ChangeVolumeExponentialRelaxationEquation(
110112 new_fluid = 0.0 ;
111113 }
112114
113- const real_t nuclear_fluid = new_fluid * (nuclear_volume / current_total_volume);
115+ const real_t nuclear_fluid =
116+ new_fluid * (nuclear_volume / current_total_volume);
114117 // real_t cytoplasm_fluid = new_fluid - nuclear_fluid;
115118
116119 real_t nuclear_solid = current_nuclear_solid +
@@ -122,11 +125,11 @@ void CartCell::ChangeVolumeExponentialRelaxationEquation(
122125 }
123126
124127 const real_t target_cytoplasm_solid =
125- GetTargetRelationCytoplasmNucleus () * GetTargetNucleusSolid ();
128+ GetTargetRelationCytoplasmNucleus () * GetTargetNucleusSolid ();
126129 real_t cytoplasm_solid =
127- current_cytoplasm_solid +
128- kDtCycle * relaxation_rate_cytoplasm *
129- (target_cytoplasm_solid - current_cytoplasm_solid);
130+ current_cytoplasm_solid +
131+ kDtCycle * relaxation_rate_cytoplasm *
132+ (target_cytoplasm_solid - current_cytoplasm_solid);
130133 // Clamp to zero to prevent negative volumes
131134 if (cytoplasm_solid < 0.0 ) {
132135 cytoplasm_solid = 0.0 ;
@@ -264,9 +267,10 @@ void StateControlCart::Run(Agent* agent) {
264267
265268 if (sim->GetRandom ()->Uniform (1.0 ) <
266269 kDtCycle /
267- std::max (cell->GetCurrentLiveTime (),
268- kEpsilon )) { // Probability of death= 1/CurrentLiveTime,
269- // avoiding division by 0
270+ std::max (
271+ cell->GetCurrentLiveTime (),
272+ kEpsilon )) { // Probability of death= 1/CurrentLiveTime,
273+ // avoiding division by 0
270274 // the cell Dies
271275 cell->SetState (CartCellState::kApoptotic );
272276 cell->SetTimerState (0 ); // Reset timer_state, it should be 0 anyway
@@ -295,7 +299,8 @@ void StateControlCart::Run(Agent* agent) {
295299 break ;
296300 }
297301 case CartCellState::kApoptotic : {
298- cell->SetTimerState (static_cast <int >(static_cast <real_t >(cell->GetTimerState ()) + kDtCycle ));
302+ cell->SetTimerState (static_cast <int >(
303+ static_cast <real_t >(cell->GetTimerState ()) + kDtCycle ));
299304
300305 cell->ChangeVolumeExponentialRelaxationEquation (
301306 kVolumeRelaxarionRateCytoplasmApoptotic ,
0 commit comments