Skip to content

Commit

Permalink
Merge pull request #343 from MathCancer/development
Browse files Browse the repository at this point in the history
PhysiCell 1.14.1 release
  • Loading branch information
MathCancer authored Dec 13, 2024
2 parents 5055595 + b7d8f15 commit 37b970c
Show file tree
Hide file tree
Showing 99 changed files with 6,044 additions and 4,450 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/build_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
pull_request:
release:
types: [created]
types: [published]

jobs:

Expand Down Expand Up @@ -124,29 +124,34 @@ jobs:
{short_name: "interaction", project: "interaction-sample", name: "PhysiCell Interaction", binary: "interaction_demo", extra_run: ""},
]

runs-on: macos-12
runs-on: macos-13

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run : brew install gcc@13
run : |
if ! brew list gcc@13 &>/dev/null; then
brew install gcc@13
else
echo "gcc@13 is already installed."
fi
- name: Build ${{ matrix.projects.name }} project
run: |
export MACOSX_DEPLOYMENT_TARGET=12
export MACOSX_DEPLOYMENT_TARGET=13
make ${{ matrix.projects.project }}
make clean
${{ matrix.projects.extra_run }}
make PHYSICELL_CPP=g++-13 static
cp ${{ matrix.projects.binary }} ${{ matrix.projects.binary }}_macos12
cp ${{ matrix.projects.binary }} ${{ matrix.projects.binary }}_macos13
- name: Caching produced project binary
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/${{ matrix.projects.binary }}_macos12
key: ${{ runner.os }}-macos12-${{ github.run_id }}
${{ github.workspace }}/${{ matrix.projects.binary }}_macos13
key: ${{ runner.os }}-macos13-${{ github.run_id }}

- name: Look at the generated binary
run: |
Expand Down Expand Up @@ -174,11 +179,16 @@ jobs:
- uses: actions/checkout@v4

- name: Install dependencies
run : brew install gcc@13
run : |
if ! brew list gcc@13 &>/dev/null; then
brew install gcc@13
else
echo "gcc@13 is already installed."
fi
- name: Build ${{ matrix.projects.name }} project
run: |
export MACOSX_DEPLOYMENT_TARGET=12
export MACOSX_DEPLOYMENT_TARGET=13
make ${{ matrix.projects.project }}
make clean
${{ matrix.projects.extra_run }}
Expand Down Expand Up @@ -212,7 +222,7 @@ jobs:
{short_name: "interaction", project: "interaction-sample", name: "PhysiCell Interaction", binary: "interaction_demo", extra_run: ""},
]

runs-on: macos-12
runs-on: macos-13
needs: [macos_step0a, macos_step0b]

steps:
Expand All @@ -229,12 +239,12 @@ jobs:
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/${{ matrix.projects.binary }}_macos12
key: ${{ runner.os }}-macos12-${{ github.run_id }}
${{ github.workspace }}/${{ matrix.projects.binary }}_macos13
key: ${{ runner.os }}-macos13-${{ github.run_id }}

- name: Creating universal binary
run: |
lipo -create -output ${{ matrix.projects.binary }} ${{ matrix.projects.binary }}_macos12 ${{ matrix.projects.binary }}_macosm1
lipo -create -output ${{ matrix.projects.binary }} ${{ matrix.projects.binary }}_macos13 ${{ matrix.projects.binary }}_macosm1
- name: Checking universal binary
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
os: [
{name: "Ubuntu", os: "ubuntu-latest", shell: "bash", compiler: "g++"},
{name: "MacOS 12", os: "macos-12", shell: "bash", compiler: "g++-12"},
{name: "MacOS 13", os: "macos-13", shell: "bash", compiler: "g++-12"},
{name: "MacOS 14 (M1)", os: "macos-14", shell: "bash", compiler: "g++-13"},
{name: "Windows", os: "windows-latest", shell: "msys2", compiler: "g++"},
]
Expand All @@ -32,6 +32,8 @@ jobs:
{project: "custom-division-sample", name: "PhysiCell custom division", binary: "project", config: "config/PhysiCell_settings.xml", max_time: 120, output_folder: ""},
{project: "interaction-sample", name: "PhysiCell interactions", binary: "interaction_demo", config: "config/PhysiCell_settings.xml", max_time: 120, output_folder: ""},
{project: "pred-prey-farmer", name: "PhysiCell prey predator", binary: "pred_prey", config: "config/PhysiCell_settings.xml", max_time: 120, output_folder: ""},
{project: "rules-sample", name: "PhysiCell rules sample", binary: "rules_sample", config: "config/PhysiCell_settings.xml", max_time: 120, output_folder: ""},
{project: "asymmetric-division-sample", name: "PhysiCell asymmetric division", binary: "project", config: "config/PhysiCell_settings.xml", max_time: 120, output_folder: ""}
]

name: Testing ${{ matrix.projects.name }} on ${{ matrix.os.name }}
Expand All @@ -53,7 +55,7 @@ jobs:

- name: Build ${{ matrix.projects.name }} project
run: |
make data-cleanup && make ${{ matrix.projects.project }} && make PHYSICELL_CPP=${{ matrix.os.compiler }}
make data-cleanup && make ${{ matrix.projects.project }} && make PHYSICELL_CPP=${{ matrix.os.compiler }} PROGRAM_NAME=${{ matrix.projects.binary }}
- name: Run ${{ matrix.projects.name }} project
run: |
Expand Down
60 changes: 27 additions & 33 deletions BioFVM/BioFVM_MultiCellDS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,15 +515,21 @@ void set_save_biofvm_cell_data_as_custom_matlab( bool newvalue )

/* writing parts of BioFVM to a MultiCellDS file */

static bool BioFVM_substrates_initialized_in_dom = false;

void reset_BioFVM_substrates_initialized_in_dom( void )
{
BioFVM_substrates_initialized_in_dom = false;
}


void add_BioFVM_substrates_to_open_xml_pugi( pugi::xml_document& xml_dom , std::string filename_base, Microenvironment& M )
{
add_MultiCellDS_main_structure_to_open_xml_pugi( xml_dom );

pugi::xml_node root = biofvm_doc.child( "MultiCellDS" );
pugi::xml_node node = root.child( "microenvironment" );

static bool BioFVM_substrates_initialized_in_dom = false;

// if the TME has not yet been initialized in the DOM, create all the
// right data elements, and populate the meshes.
if( !BioFVM_substrates_initialized_in_dom )
Expand Down Expand Up @@ -564,36 +570,9 @@ void add_BioFVM_substrates_to_open_xml_pugi( pugi::xml_document& xml_dom , std::
// if Cartesian, add the x, y, and z coordinates
if( M.mesh.Cartesian_mesh == true )
{
char temp [10240];
int position = 0;
for( unsigned int k=0 ; k < M.mesh.x_coordinates.size()-1 ; k++ )
{ position += sprintf( temp+position, "%f " , M.mesh.x_coordinates[k] ); }
sprintf( temp+position , "%f" , M.mesh.x_coordinates[ M.mesh.x_coordinates.size()-1] );
node = node.append_child( "x_coordinates" );
node.append_child( pugi::node_pcdata ).set_value( temp );
attrib = node.append_attribute("delimiter");
attrib.set_value( " " );

node = node.parent();
position = 0;
for( unsigned int k=0 ; k < M.mesh.y_coordinates.size()-1 ; k++ )
{ position += sprintf( temp+position, "%f " , M.mesh.y_coordinates[k] ); }
sprintf( temp+position , "%f" , M.mesh.y_coordinates[ M.mesh.y_coordinates.size()-1] );
node = node.append_child( "y_coordinates" );
node.append_child( pugi::node_pcdata ).set_value( temp );
attrib = node.append_attribute("delimiter");
attrib.set_value( " " );

node = node.parent();
position = 0;
for( unsigned int k=0 ; k < M.mesh.z_coordinates.size()-1 ; k++ )
{ position += sprintf( temp+position, "%f " , M.mesh.z_coordinates[k] ); }
sprintf( temp+position , "%f" , M.mesh.z_coordinates[ M.mesh.z_coordinates.size()-1] );
node = node.append_child( "z_coordinates" );
node.append_child( pugi::node_pcdata ).set_value( temp );
attrib = node.append_attribute("delimiter");
attrib.set_value( " " );
node = node.parent();
write_coordinates_node(node, M.mesh.x_coordinates, "x_coordinates");
write_coordinates_node(node, M.mesh.y_coordinates, "y_coordinates");
write_coordinates_node(node, M.mesh.z_coordinates, "z_coordinates");
}
// write out the voxels -- minimal data, even if redundant for cartesian
if( save_mesh_as_matlab == false )
Expand Down Expand Up @@ -744,7 +723,7 @@ void add_BioFVM_substrates_to_open_xml_pugi( pugi::xml_document& xml_dom , std::
{ filename_start++; }
strcpy( filename_without_pathing , filename_start );

node.append_child( pugi::node_pcdata ).set_value( filename_without_pathing ); // filename );
node.append_child( pugi::node_pcdata ).set_value( filename_without_pathing ); // filename );

node = node.parent();
}
Expand Down Expand Up @@ -812,6 +791,21 @@ void add_BioFVM_substrates_to_open_xml_pugi( pugi::xml_document& xml_dom , std::
return;
}

void write_coordinates_node(pugi::xml_node &node, const std::vector<double> &coordinates, std::string name)
{
std::ostringstream oss;
for (size_t i = 0; i < coordinates.size(); ++i)
{
if (i != 0)
{ oss << " "; }
oss << coordinates[i];
}
pugi::xml_node coord_node = node.append_child(name.c_str());
coord_node.append_child(pugi::node_pcdata).set_value(oss.str().c_str());
pugi::xml_attribute attrib = coord_node.append_attribute("delimiter");
attrib.set_value(" ");
}

// not yet implemented
void add_BioFVM_basic_agent_to_open_xml_pugi( pugi::xml_document& xml_dom, Basic_Agent& BA );

Expand Down
3 changes: 3 additions & 0 deletions BioFVM/BioFVM_MultiCellDS.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,14 @@ void set_save_biofvm_cell_data_as_custom_matlab( bool newvalue ); // default: tr

/* writing parts of BioFVM to a MultiCellDS file */

void reset_BioFVM_substrates_initialized_in_dom( void );
void add_BioFVM_substrates_to_open_xml_pugi( pugi::xml_document& xml_dom , std::string filename_base , Microenvironment& M );
void add_BioFVM_basic_agent_to_open_xml_pugi( pugi::xml_document& xml_dom, Basic_Agent& BA ); // not implemented -- future edition
void add_BioFVM_agents_to_open_xml_pugi( pugi::xml_document& xml_dom, std::string filename_base, Microenvironment& M );
void add_BioFVM_to_open_xml_pugi( pugi::xml_document& xml_dom , std::string filename_base, double current_simulation_time , Microenvironment& M );

void write_coordinates_node(pugi::xml_node &node, const std::vector<double> &coordinates, std::string name);

void save_BioFVM_to_MultiCellDS_xml_pugi( std::string filename_base , Microenvironment& M , double current_simulation_time);

/* beta in PhysiCell 1.11.0 */
Expand Down
14 changes: 10 additions & 4 deletions BioFVM/BioFVM_basic_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,16 @@ namespace BioFVM{

std::vector<Basic_Agent*> all_basic_agents(0);

static int max_basic_agent_ID = 0;

void reset_max_basic_agent_ID( void )
{
max_basic_agent_ID = 0;
}

Basic_Agent::Basic_Agent()
{
//give the agent a unique ID
static int max_basic_agent_ID = 0;
ID = max_basic_agent_ID; //
max_basic_agent_ID++;
// initialize position and velocity
Expand All @@ -78,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 @@ -190,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 Expand Up @@ -341,4 +347,4 @@ void Basic_Agent::simulate_secretion_and_uptake( Microenvironment* pS, double dt
return;
}

};
};
4 changes: 3 additions & 1 deletion BioFVM/BioFVM_basic_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
#include "BioFVM_vector.h"

namespace BioFVM{


void reset_max_basic_agent_ID( void );

class Basic_Agent
{
private:
Expand Down
6 changes: 3 additions & 3 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.14.0) [1].
We implemented and solved the model using PhysiCell (Version 1.14.1) [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.14.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.14.0) [1],
We implemented and solved the model using PhysiCell (Version 1.14.1) [1],
with BioFVM [2] to solve the transport equations.

[1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin,
Expand All @@ -25,7 +25,7 @@ with BioFVM [2] to solve the transport equations.

If you use PhysiBoSS, please cite as below:

We implemented and solved the model using PhysiCell (Version 1.14.0) [1],
We implemented and solved the model using PhysiCell (Version 1.14.1) [1],
with PhysiBoSS[2,3] to simulate the intracellular mechanisms.

[1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin,
Expand Down
24 changes: 21 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ 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 physimess-sample custom-division-sample"
@echo " asymmetric-division-sample immune-function-sample"
@echo ""
@echo "Sample intracellular projects: template_BM ode-energy-sample physiboss-cell-lines-sample"
@echo " cancer-metabolism-sample physiboss-tutorial physiboss-tutorial-invasion"
Expand Down Expand Up @@ -197,15 +198,32 @@ physimess-sample:
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp -r ./sample_projects/physimess/config/* ./config/


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

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

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

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

0 comments on commit 37b970c

Please sign in to comment.