@@ -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
6667bool 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
0 commit comments