Skip to content

Commit

Permalink
Replace all time checks with improved version
Browse files Browse the repository at this point in the history
Specifically, any time check I found (searching the codebase for uses of `fabs`),
I replaced with the form:
```
current_time > next_event_time - 0.5 * diffusion_dt
```
Assuming diffusion_dt really is the smallest time step, this will evaluate true at the time step closest to next_event_time.
Importantly, this will never accumulate floating point errors to the point where the check fails.
This has happened with the save checks:
```
abs( current_time - next_save_time ) < 0.01 * diffusion_dt
```
Finally, this is ever so slightly more robust than a user's suggestion to convert save times to integers as this does not rely on time steps being multiples of one another.
  • Loading branch information
drbergman committed Aug 29, 2024
1 parent 2e446b3 commit ce9ee8e
Show file tree
Hide file tree
Showing 33 changed files with 60 additions and 61 deletions.
3 changes: 1 addition & 2 deletions addons/PhysiMeSS/PhysiMeSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ void physimess_update_cell_velocity( Cell* pCell, Phenotype& phenotype, double d

void physimess_mechanics( double dt )
{
static double dt_tolerance = 0.001 * dt;
if(fabs(((PhysiCell_globals.current_time - last_update_time)) - dt) < dt_tolerance)
if ( PhysiCell_globals.current_time >= last_update_time + dt - 0.5 * diffusion_dt) // last_update_time + dt = next update time; - 0.5 * diffusion_dt will give the time step closest to the desired next time (assumign diffusion_dt is the smallest time step)
{
last_update_time = PhysiCell_globals.current_time;

Expand Down
4 changes: 2 additions & 2 deletions core/PhysiCell_cell_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void Cell_Container::update_all_cells(double t, double phenotype_dt_ , double me
}
}

if( fabs(time_since_last_cycle-phenotype_dt_ ) < phenotype_dt_tolerance || !initialzed)
if( time_since_last_cycle > phenotype_dt_ - 0.5 * diffusion_dt_ || !initialzed )
{
// Reset the max_radius in each voxel. It will be filled in set_total_volume
// It might be better if we calculate it before mechanics each time
Expand Down Expand Up @@ -201,7 +201,7 @@ void Cell_Container::update_all_cells(double t, double phenotype_dt_ , double me
double time_since_last_mechanics= t- last_mechanics_time;

// if( time_since_last_mechanics>= mechanics_dt || !initialzed)
if( fabs(time_since_last_mechanics - mechanics_dt_) < mechanics_dt_tolerance || !initialzed)
if( time_since_last_mechanics > mechanics_dt_ - 0.5 * diffusion_dt_ || !initialzed )
{
if(!initialzed)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/PhysiCell_test_DCIS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ int main( int argc, char* argv[] )
{
while( t < t_max )
{
if( fabs( t - t_next_output_time ) < 0.0001 )
if( t > t_next_output_time - 0.5 * dt )
{
log_output(t, output_index, microenvironment, report_file);
t_next_output_time += t_output_interval;
Expand Down
2 changes: 1 addition & 1 deletion examples/PhysiCell_test_HDS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ for(int i=0;i<cell_positions.size();i++)
{
while( t < t_max )
{
if( fabs( t - t_next_output_time ) < 0.0001 )
if( t > t_next_output_time - 0.5 * dt )
{
log_output(t, output_index, microenvironment, report_file);
t_next_output_time += t_output_interval;
Expand Down
2 changes: 1 addition & 1 deletion examples/PhysiCell_test_cell_cycle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ int main( int argc, char* argv[] )
{
while( t < t_max )
{
if( fabs( t - t_next_output_time ) < 0.0001 )
if( t > t_next_output_time - 0.5 * dt )
{
write_test_report(*all_cells,t);
t_next_output_time += t_output_interval;
Expand Down
2 changes: 1 addition & 1 deletion examples/PhysiCell_test_mechanics_1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ int main( int argc, char* argv[] )
while( t < t_max )
{

if( fabs( t - t_next_output_time ) < dt/10.0 )
if( t > t_next_output_time - 0.5 * dt )
{
report_file<<t<<"\t"<<dist(pCell1->position,pCell2->position)<<"\n";
t_next_output_time += t_output_interval;
Expand Down
3 changes: 1 addition & 2 deletions examples/PhysiCell_test_mechanics_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ int main( int argc, char* argv[] )
{
while( t < t_max )
{
// std::cout<<"time: "<<t<<" diff:"<<fabs( t - t_next_output_time )<<" next output time:"<<t_next_output_time<<std::endl;
if( fabs( t - t_next_output_time ) < 0.001 )
if( t > t_next_output_time - 0.5 * dt )
{
std::cout<<"time: "<<t<<std::endl;
writeCellReport(*all_cells, t);
Expand Down
2 changes: 1 addition & 1 deletion examples/PhysiCell_test_volume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ int main( int argc, char* argv[] )
{
while( t < t_max )
{
if( fabs( t - t_next_output_time ) < 0.001 )
if( t > t_next_output_time - 0.5 * dt )
{
vol_report<<t<<"\t"<<pCell1->get_total_volume()<<"\t"<<pCell1->phenotype.volume.fluid<<"\t"<<pCell1->phenotype.volume.nuclear_solid<<"\t"<<pCell1->phenotype.volume.cytoplasmic_solid<<"\n";
t_next_output_time += t_output_interval;
Expand Down
5 changes: 3 additions & 2 deletions sample_projects/biorobots/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -200,7 +200,8 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/cancer_biorobots/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ int main( int argc, char* argv[] )
}

// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -216,7 +216,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/cancer_immune/main-cancer_immune_3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ int main( int argc, char* argv[] )
}

// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -219,7 +219,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/celltypes3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -242,7 +242,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/custom_division/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -201,7 +201,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/heterogeneity/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -200,7 +200,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/immune_test_2024/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -200,7 +200,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/interactions/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -203,7 +203,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/mechano/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -206,7 +206,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/physimess/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -202,7 +202,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/pred_prey_farmer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -200,7 +200,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/rules_sample/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -200,7 +200,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/template/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -201,7 +201,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/virus_macrophage/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -200,7 +200,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
4 changes: 2 additions & 2 deletions sample_projects/worm/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -200,7 +200,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -211,7 +211,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ int main( int argc, char* argv[] )
while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt )
{
// save data if it's time.
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_full_save_time - 0.5 * diffusion_dt )
{
display_simulation_status( std::cout );
if( PhysiCell_settings.enable_legacy_saves == true )
Expand All @@ -209,7 +209,7 @@ int main( int argc, char* argv[] )
}

// save SVG plot if it's time
if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt )
if( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * diffusion_dt )
{
if( PhysiCell_settings.enable_SVG_saves == true )
{
Expand Down
Loading

0 comments on commit ce9ee8e

Please sign in to comment.