There are optional config options to disable writing particle collision statistics CSV files (save_surface_intersection for particle_surface_collision_statistics.csv and save_receivers_intersection for particle_receivers_collision_statistics.csv), but setting those properties to 0 make the program crash with Segmentation Fault because it still tries to write the CSV header even if the file wasn't opened because the option was disabled.
This PR simply moves writing the CSV header to the conditional blocks where the files are opened.
Steps to reproduce:
In config.xml, add either save_surface_intersection="0" or save_surface_intersection="0"
There are optional config options to disable writing particle collision statistics CSV files (
save_surface_intersection
forparticle_surface_collision_statistics.csv
andsave_receivers_intersection
forparticle_receivers_collision_statistics.csv
), but setting those properties to0
make the program crash with Segmentation Fault because it still tries to write the CSV header even if the file wasn't opened because the option was disabled.This PR simply moves writing the CSV header to the conditional blocks where the files are opened.
Steps to reproduce:
config.xml
, add eithersave_surface_intersection="0"
orsave_surface_intersection="0"