Skip to content

Commit c8fa61b

Browse files
committed
Only saving cells data when there are cells
1 parent f03e5c9 commit c8fa61b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/PhysiCell_MultiCellDS.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void add_PhysiCell_cells_to_open_xml_pugi_v2( pugi::xml_document& xml_dom, std::
199199
// get number of cell types
200200
static int n = cell_definition_indices_by_name.size(); // number_of_cell_types
201201
// get number of death models
202-
static int nd = (*all_cells)[0]->phenotype.death.rates.size(); //
202+
static int nd = cell_defaults.phenotype.death.rates.size(); //
203203
// get number of custom data
204204
static int nc = 0; //
205205
static int nc_scalar = 0;
@@ -587,7 +587,7 @@ void add_PhysiCell_cells_to_open_xml_pugi_v2( pugi::xml_document& xml_dom, std::
587587
"damage_repair_rate" , "1/min" , 1 );
588588

589589
// custom
590-
for( int j=0 ; j < (*all_cells)[0]->custom_data.variables.size(); j++ )
590+
for( int j=0 ; j < cell_defaults.custom_data.variables.size(); j++ )
591591
{
592592
name = (*all_cells)[0]->custom_data.variables[j].name;
593593
units = (*all_cells)[0]->custom_data.variables[j].units;
@@ -596,7 +596,7 @@ void add_PhysiCell_cells_to_open_xml_pugi_v2( pugi::xml_document& xml_dom, std::
596596
}
597597

598598
// custom vector variables
599-
for( int j=0 ; j < (*all_cells)[0]->custom_data.vector_variables.size(); j++ )
599+
for( int j=0 ; j < cell_defaults.custom_data.vector_variables.size(); j++ )
600600
{
601601
name = (*all_cells)[0]->custom_data.vector_variables[j].name;
602602
units = (*all_cells)[0]->custom_data.vector_variables[j].units;
@@ -995,11 +995,11 @@ void add_PhysiCell_cells_to_open_xml_pugi_v2( pugi::xml_document& xml_dom, std::
995995

996996
// custom
997997
// custom scalar variables
998-
for( int j=0 ; j < (*all_cells)[0]->custom_data.variables.size(); j++ )
998+
for( int j=0 ; j < cell_defaults.custom_data.variables.size(); j++ )
999999
{ std::fwrite( &( pCell->custom_data.variables[j].value ) , sizeof(double) , 1 , fp ); }
10001000

10011001
// custom vector variables
1002-
for( int j=0 ; j < (*all_cells)[0]->custom_data.vector_variables.size(); j++ )
1002+
for( int j=0 ; j < cell_defaults.custom_data.vector_variables.size(); j++ )
10031003
{
10041004
int size_temp = pCell->custom_data.vector_variables[j].value.size();
10051005
std::fwrite( pCell->custom_data.vector_variables[j].value.data() , sizeof(double) , size_temp , fp );

0 commit comments

Comments
 (0)