Skip to content

Commit

Permalink
Merge pull request #191 from MathCancer/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
MathCancer authored Jul 30, 2023
2 parents 093c4ed + d6bd8a4 commit 9f1d56a
Show file tree
Hide file tree
Showing 103 changed files with 9,593 additions and 20,824 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/test-macosx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,27 @@ jobs:
- name: Run PhysiBoSS cell lines project
run: |
./PhysiBoSS_Cell_Lines
./PhysiBoSS_Cell_Lines
build_physimess:

runs-on: macos-11

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run : brew install gcc@11

- name: Build PhysiMeSS project
run: |
make physimess-sample
make clean
make PHYSICELL_CPP=g++-11
- name: Run PhysiMeSS project
run: |
./project config/mymodel.xml
./project config/Fibre_Initialisation/mymodel_initialisation.xml
./project config/Cell_Fibre_Mechanics/mymodel_rotating.xml
16 changes: 15 additions & 1 deletion .github/workflows/test-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,18 @@ jobs:
- name: Run PhysiBoSS cell lines project
run: |
./PhysiBoSS_Cell_Lines
./PhysiBoSS_Cell_Lines
- name: Build PhysiMeSS project
run: |
make reset
make physimess-sample
make clean
make
- name: Run PhysiMeSS project
run: |
./project config/mymodel.xml
./project config/Fibre_Initialisation/mymodel_initialisation.xml
./project config/Cell_Fibre_Mechanics/mymodel_rotating.xml
16 changes: 15 additions & 1 deletion .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,18 @@ jobs:
- name: Run PhysiBoSS cell lines project
run: |
.\\PhysiBoSS_Cell_Lines.exe
.\\PhysiBoSS_Cell_Lines.exe
- name: Build PhysiMeSS project
run: |
make reset
make physimess-sample
make clean
make
- name: Run PhysiMeSS project
run: |
.\\project config\\mymodel.xml
.\\project config\\Fibre_Initialisation\\mymodel_initialisation.xml
.\\project config\\Cell_Fibre_Mechanics\\mymodel_rotating.xml
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ project
initial.svg
initial.svg
interaction_demo
addons/libRoadrunner/roadrunner/
addons/libRoadrunner/roadrunner-win64-vs14-cp35m.zip
addons/PhysiBoSS/MaBoSS-env-2.0/
addons/PhysiBoSS/libMaBoSS-*.tar.gz
user_projects/*
!user_projects/empty.txt
4 changes: 4 additions & 0 deletions BioFVM/BioFVM_basic_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ double Basic_Agent::get_total_volume()
return volume;
}

const std::vector<double>& Basic_Agent::get_previous_velocity( void ) {
return previous_velocity;
}

void Basic_Agent::simulate_secretion_and_uptake( Microenvironment* pS, double dt )
{
if(!is_active)
Expand Down
4 changes: 3 additions & 1 deletion BioFVM/BioFVM_basic_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Basic_Agent
void update_position( double dt );

Basic_Agent();

virtual ~Basic_Agent(){};
// simulate secretion and uptake at the nearest voxel at the indicated microenvironment.
// if no microenvironment indicated, use the currently selected microenvironment.
void simulate_secretion_and_uptake( Microenvironment* M, double dt );
Expand All @@ -125,6 +125,8 @@ class Basic_Agent
std::vector<double>& nearest_gradient( int substrate_index );
// directly access a vector of gradients, one gradient per substrate
std::vector<gradient>& nearest_gradient_vector( void );

const std::vector<double>& get_previous_velocity( void );
};

extern std::vector<Basic_Agent*> all_basic_agents;
Expand Down
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
12 changes: 6 additions & 6 deletions BioFVM/BioFVM_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void randomize( std::vector<double>* v )

/* axpy and related BLAS-type operations */

void axpy( std::vector<double>* y, double& a , std::vector<double>& x )
void axpy( std::vector<double>* y, const double& a , const std::vector<double>& x )
{
for( unsigned int i=0; i < (*y).size() ; i++ )
{
Expand All @@ -328,7 +328,7 @@ void axpy( std::vector<double>* y, double& a , std::vector<double>& x )
return ;
}

void axpy( std::vector<double>* y, std::vector<double>& a , std::vector<double>& x )
void axpy( std::vector<double>* y, const std::vector<double>& a , const std::vector<double>& x )
{
for( unsigned int i=0; i < (*y).size() ; i++ )
{
Expand All @@ -337,7 +337,7 @@ void axpy( std::vector<double>* y, std::vector<double>& a , std::vector<double>&
return;
}

void naxpy( std::vector<double>* y, double& a , std::vector<double>& x )
void naxpy( std::vector<double>* y, const double& a , const std::vector<double>& x )
{
for( unsigned int i=0; i < (*y).size() ; i++ )
{
Expand All @@ -346,7 +346,7 @@ void naxpy( std::vector<double>* y, double& a , std::vector<double>& x )
return ;
}

void naxpy( std::vector<double>* y, std::vector<double>& a , std::vector<double>& x )
void naxpy( std::vector<double>* y, const std::vector<double>& a , const std::vector<double>& x )
{
for( unsigned int i=0; i < (*y).size() ; i++ )
{
Expand Down Expand Up @@ -498,15 +498,15 @@ void vector3_to_list( const std::vector<double>& vect , char*& buffer , char del
return;
}

double dot_product( std::vector<double>& a , std::vector<double>& b )
double dot_product( const std::vector<double>& a , const std::vector<double>& b )
{
double out = 0.0;
for( unsigned int i=0 ; i < a.size() ; i++ )
{ out += ( a[i] * b[i] ); }
return out;
}

std::vector<double> cross_product( std::vector<double>& a , std::vector<double>& b )
std::vector<double> cross_product( const std::vector<double>& a , const std::vector<double>& b )
{
std::vector<double> out( 3, 0.0 );
out[0] = a[1]*b[2] - a[2]*b[1];
Expand Down
14 changes: 7 additions & 7 deletions BioFVM/BioFVM_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ void randomize( std::vector<double>* v );
/* axpy and related BLAS-type operations */

// y = y + a*x
void axpy( std::vector<double>* y, double& a , std::vector<double>& x );
void axpy( std::vector<double>* y, const double& a , const std::vector<double>& x );
// y = y + a.*x
void axpy( std::vector<double>* y, std::vector<double>& a , std::vector<double>& x );
void axpy( std::vector<double>* y, const std::vector<double>& a , const std::vector<double>& x );

// y = y - a*x
void naxpy( std::vector<double>* y, double& a , std::vector<double>& x );
void naxpy( std::vector<double>* y, const double& a , const std::vector<double>& x );
// y = y - a.*x
void naxpy( std::vector<double>* y, std::vector<double>& a , std::vector<double>& x );
void naxpy( std::vector<double>* y, const std::vector<double>& a , const std::vector<double>& x );

/* I may cut these from the final version */
/* CLEANUP BEFORE RELEASE */
Expand Down Expand Up @@ -141,9 +141,9 @@ void vector_to_list( const std::vector<double>& vect , char*& buffer , char deli

void vector3_to_list( const std::vector<double>& vect , char*& buffer , char delim );

double dot_product( std::vector<double>& a , std::vector<double>& b );
std::vector<double> cross_product( std::vector<double>& a , std::vector<double>& b );

double dot_product( const std::vector<double>& a , const std::vector<double>& b );
std::vector<double> cross_product( const std::vector<double>& a , const std::vector<double>& b );
};

#endif
4 changes: 2 additions & 2 deletions CITATION.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
If you use PhysiCell in your project, please cite PhysiCell and the version
number, such as below:

We implemented and solved the model using PhysiCell (Version 1.12.0) [1].
We implemented and solved the model using PhysiCell (Version 1.13.0) [1].

[1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin,
PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu-
Expand All @@ -11,7 +11,7 @@ We implemented and solved the model using PhysiCell (Version 1.12.0) [1].
Because PhysiCell extensively uses BioFVM, we suggest you also cite BioFVM
as below:

We implemented and solved the model using PhysiCell (Version 1.12.0) [1],
We implemented and solved the model using PhysiCell (Version 1.13.0) [1],
with BioFVM [2] to solve the transport equations.

[1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin,
Expand Down
12 changes: 10 additions & 2 deletions Makefile
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 Expand Up @@ -73,7 +73,7 @@ name:
list-projects:
@echo "Sample projects: template biorobots-sample cancer-biorobots-sample cancer-immune-sample"
@echo " celltypes3-sample heterogeneity-sample pred-prey-farmer virus-macrophage-sample"
@echo " worm-sample interaction-sample mechano-sample rules-sample"
@echo " worm-sample interaction-sample mechano-sample rules-sample physimess-sample"
@echo ""
@echo "Sample intracellular projects: ode-energy-sample physiboss-cell-lines-sample cancer-metabolism-sample"
@echo ""
Expand Down Expand Up @@ -188,6 +188,14 @@ rules-sample:
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/rules_sample/config/* ./config/

physimess-sample:
cp ./sample_projects/physimess/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/physimess/main.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/physimess/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp -r ./sample_projects/physimess/config/* ./config/

# ---- intracellular projects
ode-energy-sample:
Expand Down
Loading

0 comments on commit 9f1d56a

Please sign in to comment.