Skip to content
Open
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
24 changes: 24 additions & 0 deletions modules/PhysiCell_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ PhysiCell_Settings::PhysiCell_Settings()

intracellular_save_interval = 60;
enable_intracellular_saves = false;

// <options>
mechanics_voxel_size = 30.0;

// parallel options

Expand Down Expand Up @@ -299,6 +302,27 @@ void PhysiCell_Settings::read_from_pugixml( void )
SeedRandom(seed);
}

double mechanics_voxel_size_val;
pugi::xml_node mechanics_voxel_size_node = xml_find_node(node_options, "mechanics_voxel_size");
if (mechanics_voxel_size_node)
{
mechanics_voxel_size_val = xml_get_my_double_value(mechanics_voxel_size_node );
if (mechanics_voxel_size_val > 0.0)
{
PhysiCell_settings.mechanics_voxel_size = mechanics_voxel_size_val; // Update global value
std::cout << "Setting PhysiCell_settings.mechanics_voxel_size = " << PhysiCell_settings.mechanics_voxel_size << std::endl;
}
else
{
std::cout << "XML Error: mechanics_voxel_size must be > 0. Leaving at default value= " << mechanics_voxel_size << std::endl;
}
}
else
{
std::cout << "mechanics_voxel_size not found in XML <options>, leaving at default value= " << mechanics_voxel_size << std::endl;
}


// other options can go here, eventually
}

Expand Down
3 changes: 3 additions & 0 deletions modules/PhysiCell_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class PhysiCell_Settings
double intracellular_save_interval = 60;
bool enable_intracellular_saves = false;

// <options>
double mechanics_voxel_size = 30.0;

// cell rules option
bool rules_enabled = false;
std::string rules_protocol = "Cell Behavior Hypothesis Grammar (CBHG)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/asymmetric_division/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
1 change: 1 addition & 0 deletions sample_projects/biorobots/config/PhysiCell_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>true</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/biorobots/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>true</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/cancer_biorobots/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
<legacy_random_points_on_sphere_in_divide>false</legacy_random_points_on_sphere_in_divide>
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>true</disable_automated_spring_adhesions>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/cancer_immune/main-cancer_immune_3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

create_cell_types();
setup_tissue();
Expand Down
1 change: 1 addition & 0 deletions sample_projects/celltypes3/config/PhysiCell_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
<options>
<legacy_random_points_on_sphere_in_divide>false</legacy_random_points_on_sphere_in_divide>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/celltypes3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/custom_division/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
1 change: 1 addition & 0 deletions sample_projects/episode/config/PhysiCell_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<random_seed>74</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
6 changes: 2 additions & 4 deletions sample_projects/episode/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ int main( int argc, char* argv[] )
// setup microenviroment and mechanics voxel size and match the data structure to BioFVM
std::cout << "set densities ..." << std::endl;
setup_microenvironment(); // modify this in the custom code
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

// load cell type definition and setup tisse
std::cout << "load cell type definition and setup tissue ..." << std::endl;
Expand Down Expand Up @@ -186,8 +185,7 @@ int main( int argc, char* argv[] )
std::cout << "reset densities ..." << std::endl;
set_microenvironment_initial_condition();
microenvironment.display_information( std::cout );
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

// reset tissue
std::cout << "reset tissue ..." << std::endl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/heterogeneity/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<legacy_random_points_on_sphere_in_divide>false</legacy_random_points_on_sphere_in_divide>
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/immune_function/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
1 change: 1 addition & 0 deletions sample_projects/interactions/config/PhysiCell_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<legacy_cell_defaults_copy>false</legacy_cell_defaults_copy>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/interactions/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
1 change: 1 addition & 0 deletions sample_projects/mechano/config/PhysiCell_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/mechano/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
1 change: 1 addition & 0 deletions sample_projects/physimess/config/PhysiCell_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>true</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/physimess/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
<legacy_random_points_on_sphere_in_divide>false</legacy_random_points_on_sphere_in_divide>
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/pred_prey_farmer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
1 change: 1 addition & 0 deletions sample_projects/rules_sample/config/PhysiCell_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/rules_sample/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
1 change: 1 addition & 0 deletions sample_projects/template/config/PhysiCell_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/template/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/virus_macrophage/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
1 change: 1 addition & 0 deletions sample_projects/worm/config/PhysiCell_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>true</disable_automated_spring_adhesions>
<random_seed>0</random_seed>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects/worm/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
<legacy_random_points_on_sphere_in_divide>false</legacy_random_points_on_sphere_in_divide>
<virtual_wall_at_domain_edge>true</virtual_wall_at_domain_edge>
<disable_automated_spring_adhesions>false</disable_automated_spring_adhesions>
<mechanics_voxel_size>30</mechanics_voxel_size>
</options>

<microenvironment_setup>
Expand Down
3 changes: 1 addition & 2 deletions sample_projects_intracellular/ode/ode_energy/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ int main( int argc, char* argv[] )
/* PhysiCell setup */

// set mechanics voxel size, and match the data structure to BioFVM
double mechanics_voxel_size = 30;
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size );
Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, PhysiCell_settings.mechanics_voxel_size );

/* Users typically start modifying here. START USERMODS */

Expand Down
Loading
Loading