Skip to content

Commit

Permalink
Merge pull request #149 from rheiland/development
Browse files Browse the repository at this point in the history
exec is cancer_biorobots
  • Loading branch information
MathCancer authored Jul 26, 2023
2 parents 5b071a8 + 2d711c3 commit 889bd72
Show file tree
Hide file tree
Showing 19 changed files with 1,628 additions and 22 deletions.
42 changes: 25 additions & 17 deletions BioFVM/BioFVM_microenvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Microenvironment::Microenvironment()
one_third /= 3.0;

dirichlet_value_vectors.assign( mesh.voxels.size(), one );
dirichlet_activation_vector.assign( 1 , true );
dirichlet_activation_vector.assign( 1 , false );

dirichlet_activation_vectors.assign( 1 , dirichlet_activation_vector );

Expand Down Expand Up @@ -212,7 +212,7 @@ void Microenvironment::update_dirichlet_node( int voxel_index , int substrate_in
dirichlet_value_vectors[voxel_index][substrate_index] = new_value;

dirichlet_activation_vectors[voxel_index][substrate_index] = true;

return;
}

Expand Down Expand Up @@ -250,6 +250,12 @@ bool Microenvironment::get_substrate_dirichlet_activation( int substrate_index )
return dirichlet_activation_vector[substrate_index];
}

// TODO? fix confusing swapped usage of args
double Microenvironment::get_substrate_dirichlet_value( int substrate_index, int index )
{
return dirichlet_value_vectors[index][substrate_index];
}

// new functions for finer-grained control of Dirichlet conditions -- 1.7.0

void Microenvironment::set_substrate_dirichlet_activation( int substrate_index , int index, bool new_value )
Expand All @@ -261,6 +267,7 @@ void Microenvironment::set_substrate_dirichlet_activation( int substrate_index ,
bool Microenvironment::get_substrate_dirichlet_activation( int substrate_index, int index )
{ return dirichlet_activation_vectors[index][substrate_index]; }


void Microenvironment::apply_dirichlet_conditions( void )
{
/*
Expand Down Expand Up @@ -436,12 +443,12 @@ void Microenvironment::resize_densities( int new_size )
one_third /= 3.0;

dirichlet_value_vectors.assign( mesh.voxels.size(), one );
dirichlet_activation_vector.assign( new_size, true );
dirichlet_activation_vector.assign( new_size, false );

dirichlet_activation_vectors.assign( mesh.voxels.size(), dirichlet_activation_vector );

default_microenvironment_options.Dirichlet_condition_vector.assign( new_size , 1.0 );
default_microenvironment_options.Dirichlet_activation_vector.assign( new_size, true );
default_microenvironment_options.Dirichlet_activation_vector.assign( new_size, false );

default_microenvironment_options.initial_condition_vector.assign( new_size , 1.0 );

Expand Down Expand Up @@ -512,7 +519,7 @@ void Microenvironment::add_density( void )

// Fixes in PhysiCell preview November 2017
default_microenvironment_options.Dirichlet_condition_vector.push_back( 1.0 ); // = one;
default_microenvironment_options.Dirichlet_activation_vector.push_back( true ); // assign( number_of_densities(), true );
default_microenvironment_options.Dirichlet_activation_vector.push_back( false );

default_microenvironment_options.initial_condition_vector.push_back( 1.0 );

Expand Down Expand Up @@ -577,15 +584,14 @@ void Microenvironment::add_density( std::string name , std::string units )
one_third /= 3.0;

dirichlet_value_vectors.assign( mesh.voxels.size(), one );
dirichlet_activation_vector.push_back( true );
dirichlet_activation_vector.push_back( false );
dirichlet_activation_vectors.assign( mesh.voxels.size(), dirichlet_activation_vector );

// fix in PhysiCell preview November 2017
default_microenvironment_options.Dirichlet_condition_vector.push_back( 1.0 ); // = one;
default_microenvironment_options.Dirichlet_activation_vector.push_back( true ); // assign( number_of_densities(), true );
default_microenvironment_options.Dirichlet_activation_vector.push_back( false ); // assign( number_of_densities(), false );

default_microenvironment_options.Dirichlet_all.push_back( true );
// default_microenvironment_options.Dirichlet_interior.push_back( true );
default_microenvironment_options.Dirichlet_all.push_back( false );
default_microenvironment_options.Dirichlet_xmin.push_back( false );
default_microenvironment_options.Dirichlet_xmax.push_back( false );
default_microenvironment_options.Dirichlet_ymin.push_back( false );
Expand Down Expand Up @@ -647,12 +653,12 @@ void Microenvironment::add_density( std::string name , std::string units, double
one_third /= 3.0;

dirichlet_value_vectors.assign( mesh.voxels.size(), one );
dirichlet_activation_vector.push_back( true );
dirichlet_activation_vector.push_back( false );
dirichlet_activation_vectors.assign( mesh.voxels.size(), dirichlet_activation_vector );

// fix in PhysiCell preview November 2017
default_microenvironment_options.Dirichlet_condition_vector.push_back( 1.0 ); // = one;
default_microenvironment_options.Dirichlet_activation_vector.push_back( true ); // assign( number_of_densities(), true );
default_microenvironment_options.Dirichlet_activation_vector.push_back( false ); // assign( number_of_densities(), false );

default_microenvironment_options.initial_condition_vector.push_back( 1.0 );

Expand Down Expand Up @@ -1219,7 +1225,7 @@ Microenvironment_Options::Microenvironment_Options()

outer_Dirichlet_conditions = false;
Dirichlet_condition_vector.assign( pMicroenvironment->number_of_densities() , 1.0 );
Dirichlet_activation_vector.assign( pMicroenvironment->number_of_densities() , true );
Dirichlet_activation_vector.assign( pMicroenvironment->number_of_densities() , false );

initial_condition_vector.resize(0); // = Dirichlet_condition_vector;

Expand Down Expand Up @@ -1523,11 +1529,13 @@ void initialize_microenvironment( void )
}
*/

// set the Dirichlet condition activation vector to match the microenvironment options
for( int i=0 ; i < default_microenvironment_options.Dirichlet_activation_vector.size(); i++ )
{
microenvironment.set_substrate_dirichlet_activation( i , default_microenvironment_options.Dirichlet_activation_vector[i] );
}
// April 2023: no longer necessary after flipping our approach and doing an "additive" instead of "subtractive" DCs handling. I.e., we assume DC activation is false by default; make true on-demand.

// // set the Dirichlet condition activation vector to match the microenvironment options
// for( int i=0 ; i < default_microenvironment_options.Dirichlet_activation_vector.size(); i++ )
// {
// microenvironment.set_substrate_dirichlet_activation( i , default_microenvironment_options.Dirichlet_activation_vector[i] );
// }

microenvironment.display_information( std::cout );
return;
Expand Down
2 changes: 2 additions & 0 deletions BioFVM/BioFVM_microenvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ class Microenvironment
void set_substrate_dirichlet_activation( int substrate_index , int index, bool new_value );
void set_substrate_dirichlet_activation( int index, std::vector<bool>& new_value );
bool get_substrate_dirichlet_activation( int substrate_index, int index );

double get_substrate_dirichlet_value( int substrate_index, int index );

bool& is_dirichlet_node( int voxel_index );

Expand Down
1 change: 0 additions & 1 deletion core/PhysiCell_standard_models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,6 @@ void standard_cell_cell_interactions( Cell* pCell, Phenotype& phenotype, double

probability = attack_ij * immunogenicity_ji * dt;

dt; // s[type] * dt;
if( UniformRandom() < probability && attacked == false )
{
pCell->attack_cell(pTarget,dt);
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/Makefile-default
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ BioFVM_utilities.o BioFVM_basic_agent.o BioFVM_MultiCellDS.o BioFVM_agent_contai

PhysiCell_core_OBJECTS := PhysiCell_phenotype.o PhysiCell_cell_container.o PhysiCell_standard_models.o \
PhysiCell_cell.o PhysiCell_custom.o PhysiCell_utilities.o PhysiCell_constants.o PhysiCell_basic_signaling.o \
PhysiCell_signal_behavior.o PhyisiCell_rules.o
PhysiCell_signal_behavior.o PhysiCell_rules.o

PhysiCell_module_OBJECTS := PhysiCell_SVG.o PhysiCell_pathology.o PhysiCell_MultiCellDS.o PhysiCell_various_outputs.o \
PhysiCell_pugixml.o PhysiCell_settings.o PhysiCell_geometry.o
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/cancer_biorobots/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION := $(shell grep . VERSION.txt | cut -f1 -d:)
PROGRAM_NAME := project
PROGRAM_NAME := cancer_biorobots

CC := g++
# CC := g++-mp-7 # typical macports compiler name
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/rules_sample/config/cell_rules.csv
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ M2 macrophage,necrotic debris,decreases,migration speed,0.1,0.005,4,0
M2 macrophage,volume,decreases,phagocytose dead cell,0.0,6000,4,0
// effector cells
effector T cell,pro-inflammatory factor,increases,attack malignant epithelial cell,0.01,1,4,0
effector T cell,contact with malignant epithelial cell,decreases migration speed,0.01,0.1,10,0
effector T cell,contact with malignant epithelial cell,decreases,migration speed,0.01,0.1,10,0
effector T cell,pro-inflammatory factor,increases,migration speed,1,0.01,4,0
effector T cell,anti-inflammatory factor,increases,transform to exhausted T cell,0.001,0.5,4,0
// exhausted cells
exhausted T cell,anti-inflammatory factor,decreases,migration speed,0.001,0.5,4,0
exhausted T cell,contact with malignant epithelial cell,decreases migration speed,0.01,0.1,10,0
exhausted T cell,contact with malignant epithelial cell,decreases,migration speed,0.01,0.1,10,0
Loading

0 comments on commit 889bd72

Please sign in to comment.