Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conserved quantities are transferred by default during phagocytosis #308

Merged
merged 8 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BioFVM/BioFVM_basic_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Basic_Agent::Basic_Agent()

internalized_substrates = new std::vector<double>(0); //
fraction_released_at_death = new std::vector<double>(0);
fraction_transferred_when_ingested = new std::vector<double>(0);
fraction_transferred_when_ingested = new std::vector<double>(1.0);
register_microenvironment( get_default_microenvironment() );

// these are done in register_microenvironment
Expand Down Expand Up @@ -196,7 +196,7 @@ void Basic_Agent::register_microenvironment( Microenvironment* microenvironment_
total_extracellular_substrate_change.resize( microenvironment->density_vector(0).size() , 1.0 );

fraction_released_at_death->resize( microenvironment->density_vector(0).size() , 0.0 );
fraction_transferred_when_ingested->resize( microenvironment->density_vector(0).size() , 0.0 );
fraction_transferred_when_ingested->resize( microenvironment->density_vector(0).size() , 1.0 );

return;
}
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.14.0
1.14.1-development
22 changes: 21 additions & 1 deletion core/PhysiCell_cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1399,12 +1399,32 @@ void Cell::ingest_cell( Cell* pCell_to_eat )
// absorb the internalized substrates

// multiply by the fraction that is supposed to be ingested (for each substrate)

*(pCell_to_eat->internalized_substrates) *=
*(pCell_to_eat->fraction_transferred_when_ingested); //

*internalized_substrates += *(pCell_to_eat->internalized_substrates);
static int n_substrates = internalized_substrates->size();
pCell_to_eat->internalized_substrates->assign( n_substrates , 0.0 );

// conserved quantitites in custom data during phagocytosis
// so that phagocyte cell absorbs the full amount from the engulfed cell;
for( int nn = 0 ; nn < custom_data.variables.size() ; nn++ )
{
if( custom_data.variables[nn].conserved_quantity == true )
{
custom_data.variables[nn].value +=
pCell_to_eat->custom_data.variables[nn].value;
}
}
for( int nn = 0 ; nn < custom_data.vector_variables.size() ; nn++ )
{
if( custom_data.vector_variables[nn].conserved_quantity == true )
{
custom_data.vector_variables[nn].value +=
pCell_to_eat->custom_data.vector_variables[nn].value;
}
}

// trigger removal from the simulation
// pCell_to_eat->die(); // I don't think this is safe if it's in an OpenMP loop
Expand Down
4 changes: 2 additions & 2 deletions core/PhysiCell_phenotype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ void Molecular::sync_to_current_microenvironment( void )
{
internalized_total_substrates.resize( 0 , 0.0 );
fraction_released_at_death.resize( 0 , 0.0 );
fraction_transferred_when_ingested.resize( 0, 0.0 );
fraction_transferred_when_ingested.resize( 0, 1.0 );
}
return;
}
Expand All @@ -1062,7 +1062,7 @@ void Molecular::sync_to_microenvironment( Microenvironment* pNew_Microenvironmen

internalized_total_substrates.resize( number_of_densities , 0.0 );
fraction_released_at_death.resize( number_of_densities , 0.0 );
fraction_transferred_when_ingested.resize( number_of_densities , 0.0 );
fraction_transferred_when_ingested.resize( number_of_densities , 1.0 );

return;
}
Expand Down
Loading