diff --git a/core/PhysiCell_rules.cpp b/core/PhysiCell_rules.cpp index 3b73a38a3..587062103 100644 --- a/core/PhysiCell_rules.cpp +++ b/core/PhysiCell_rules.cpp @@ -1934,8 +1934,10 @@ void parse_rules_from_pugixml( void ) if( done == false ) { std::cout << "\tWarning: Ruleset had unknown format (" << format << "). Skipping!" << std::endl; } else - { copy_file_to_output( input_filename ); } - + { + std::string default_basename = "cell_rules.csv"; + copy_file_to_output(input_filename, default_basename); + } } else { std::cout << "\tRuleset disabled ... " << std::endl; } diff --git a/core/PhysiCell_utilities.cpp b/core/PhysiCell_utilities.cpp index 91f0cd582..a8158d1f3 100644 --- a/core/PhysiCell_utilities.cpp +++ b/core/PhysiCell_utilities.cpp @@ -365,7 +365,7 @@ int choose_event( std::vector& probabilities ) return probabilities.size(); } -void copy_file_to_output(std::string filename) +void copy_file_to_output(const std::string &filename, const std::string &default_basename) { std::cout << "Copying " << filename << " to output folder." << std::endl; // copy the file to the output folder @@ -381,8 +381,17 @@ void copy_file_to_output(std::string filename) // copy filename to output_filename char copy_command[1024]; sprintf(copy_command, "cp %s %s", filename.c_str(), output_filename.c_str()); - std::cout << "Copy command: " << copy_command << std::endl; (void)system(copy_command); // make it explicit that we are ignoring the return value + + if (default_basename.empty() || default_basename == basename) { + return; + } + + // copy the file to the output folder with the default basename + std::string default_output_filename = PhysiCell_settings.folder + "/" + default_basename; + sprintf(copy_command, "cp %s %s", filename.c_str(), default_output_filename.c_str()); + (void)system(copy_command); // make it explicit that we are ignoring the return value + return; } }; diff --git a/core/PhysiCell_utilities.h b/core/PhysiCell_utilities.h index 7e4ec1548..0b80a23d5 100644 --- a/core/PhysiCell_utilities.h +++ b/core/PhysiCell_utilities.h @@ -111,7 +111,7 @@ void add_software_citation( std::string name , std::string version, std::string int choose_event( std::vector& probabilities ); -void copy_file_to_output( std::string filename ); +void copy_file_to_output(const std::string &filename, const std::string &default_basename = ""); }; #endif diff --git a/modules/PhysiCell_geometry.cpp b/modules/PhysiCell_geometry.cpp index a995422ea..73cdc2228 100644 --- a/modules/PhysiCell_geometry.cpp +++ b/modules/PhysiCell_geometry.cpp @@ -395,7 +395,8 @@ bool load_cells_from_pugixml( pugi::xml_node root ) exit(-1); } - copy_file_to_output(input_filename); + std::string default_basename = "cells.csv"; + copy_file_to_output(input_filename, default_basename); return true; } diff --git a/modules/PhysiCell_settings.cpp b/modules/PhysiCell_settings.cpp index 538f6a8ea..b33edf710 100644 --- a/modules/PhysiCell_settings.cpp +++ b/modules/PhysiCell_settings.cpp @@ -102,9 +102,9 @@ bool load_PhysiCell_config_file( std::string filename ) if (!read_PhysiCell_config_file( filename )) { return false; } - PhysiCell_settings.read_from_pugixml(); + PhysiCell_settings.read_from_pugixml(); - // now read the microenvironment (optional) + // now read the microenvironment (optional) if( !setup_microenvironment_from_XML( physicell_config_root ) ) { @@ -119,7 +119,10 @@ bool load_PhysiCell_config_file( std::string filename ) create_output_directory( PhysiCell_settings.folder ); - return true; + std::string default_basename = "PhysiCell_settings.xml"; + copy_file_to_output( filename, default_basename ); // copy the settings file to the output folder + + return true; } PhysiCell_Settings::PhysiCell_Settings() @@ -961,7 +964,8 @@ bool setup_microenvironment_from_XML( pugi::xml_node root_node ) default_microenvironment_options.initial_condition_file_type = node.attribute("type").as_string(); default_microenvironment_options.initial_condition_file = xml_get_string_value(node, "filename"); - copy_file_to_output(default_microenvironment_options.initial_condition_file); + std::string default_basename = default_microenvironment_options.initial_condition_file_type == "matlab" ? "substrates.mat" : "substrates.csv"; // when loading the file, we check that it is one of these two types + copy_file_to_output(default_microenvironment_options.initial_condition_file, default_basename); } } diff --git a/sample_projects/asymmetric_division/main.cpp b/sample_projects/asymmetric_division/main.cpp index bf6e65d15..8de54bd5d 100644 --- a/sample_projects/asymmetric_division/main.cpp +++ b/sample_projects/asymmetric_division/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/biorobots/main.cpp b/sample_projects/biorobots/main.cpp index 2e5a302f0..8a5dad215 100644 --- a/sample_projects/biorobots/main.cpp +++ b/sample_projects/biorobots/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/cancer_biorobots/main.cpp b/sample_projects/cancer_biorobots/main.cpp index 7b2131179..68c3b0d60 100644 --- a/sample_projects/cancer_biorobots/main.cpp +++ b/sample_projects/cancer_biorobots/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/cancer_immune/main-cancer_immune_3D.cpp b/sample_projects/cancer_immune/main-cancer_immune_3D.cpp index 10f9aca2f..3ab86150c 100644 --- a/sample_projects/cancer_immune/main-cancer_immune_3D.cpp +++ b/sample_projects/cancer_immune/main-cancer_immune_3D.cpp @@ -88,23 +88,17 @@ int main( int argc, char* argv[] ) // load and parse settings file(s) bool XML_status = false; - char copy_command [1024]; if( argc > 1 ) { XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/custom_division/main.cpp b/sample_projects/custom_division/main.cpp index bf6e65d15..8de54bd5d 100644 --- a/sample_projects/custom_division/main.cpp +++ b/sample_projects/custom_division/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/heterogeneity/main.cpp b/sample_projects/heterogeneity/main.cpp index 98b47d9e5..35db6c984 100644 --- a/sample_projects/heterogeneity/main.cpp +++ b/sample_projects/heterogeneity/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/immune_function/main.cpp b/sample_projects/immune_function/main.cpp index 8df1843ec..821b59c1b 100644 --- a/sample_projects/immune_function/main.cpp +++ b/sample_projects/immune_function/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/interactions/main.cpp b/sample_projects/interactions/main.cpp index ec4b5f408..fd952372a 100644 --- a/sample_projects/interactions/main.cpp +++ b/sample_projects/interactions/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/mechano/main.cpp b/sample_projects/mechano/main.cpp index 24c358803..51eb14747 100644 --- a/sample_projects/mechano/main.cpp +++ b/sample_projects/mechano/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/physimess/main.cpp b/sample_projects/physimess/main.cpp index 86601cdb4..85f2ed3ed 100644 --- a/sample_projects/physimess/main.cpp +++ b/sample_projects/physimess/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/pred_prey_farmer/main.cpp b/sample_projects/pred_prey_farmer/main.cpp index 9797710f0..a91dd43d4 100644 --- a/sample_projects/pred_prey_farmer/main.cpp +++ b/sample_projects/pred_prey_farmer/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/rules_sample/main.cpp b/sample_projects/rules_sample/main.cpp index 8df1843ec..821b59c1b 100644 --- a/sample_projects/rules_sample/main.cpp +++ b/sample_projects/rules_sample/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/template/main.cpp b/sample_projects/template/main.cpp index bf6e65d15..8de54bd5d 100644 --- a/sample_projects/template/main.cpp +++ b/sample_projects/template/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/virus_macrophage/main.cpp b/sample_projects/virus_macrophage/main.cpp index 7009514aa..5cbf9a1ca 100644 --- a/sample_projects/virus_macrophage/main.cpp +++ b/sample_projects/virus_macrophage/main.cpp @@ -87,23 +87,17 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - - // copy config file to output directry - system( copy_command ); // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects/worm/main.cpp b/sample_projects/worm/main.cpp index 9797710f0..a91dd43d4 100644 --- a/sample_projects/worm/main.cpp +++ b/sample_projects/worm/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects_intracellular/boolean/cancer_invasion/main.cpp b/sample_projects_intracellular/boolean/cancer_invasion/main.cpp index eac3e89cf..4a70fb415 100644 --- a/sample_projects_intracellular/boolean/cancer_invasion/main.cpp +++ b/sample_projects_intracellular/boolean/cancer_invasion/main.cpp @@ -88,31 +88,21 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; char copy_command_2 [1024]; if( argc > 1 ) { XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s/PhysiCell_settings.xml" , argv[1] , PhysiCell_settings.folder.c_str() ); sprintf( copy_command_2 , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + system( copy_command_2 ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - - if ( argc > 1 ) - { - system( copy_command_2 ); - } - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects_intracellular/boolean/physiboss_cell_lines/main.cpp b/sample_projects_intracellular/boolean/physiboss_cell_lines/main.cpp index 0f5754256..4eade935a 100644 --- a/sample_projects_intracellular/boolean/physiboss_cell_lines/main.cpp +++ b/sample_projects_intracellular/boolean/physiboss_cell_lines/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects_intracellular/boolean/template_BM/main.cpp b/sample_projects_intracellular/boolean/template_BM/main.cpp index e1dfd12cb..c457ce43b 100644 --- a/sample_projects_intracellular/boolean/template_BM/main.cpp +++ b/sample_projects_intracellular/boolean/template_BM/main.cpp @@ -88,24 +88,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s/PhysiCell_settings.xml" , argv[1] , PhysiCell_settings.folder.c_str() ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects_intracellular/boolean/tutorial/main.cpp b/sample_projects_intracellular/boolean/tutorial/main.cpp index 0cfa59427..13b2f4bdf 100644 --- a/sample_projects_intracellular/boolean/tutorial/main.cpp +++ b/sample_projects_intracellular/boolean/tutorial/main.cpp @@ -88,31 +88,21 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; char copy_command_2 [1024]; if( argc > 1 ) { XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s/PhysiCell_settings.xml" , argv[1] , PhysiCell_settings.folder.c_str() ); sprintf( copy_command_2 , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + system( copy_command_2 ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - - if( argc > 1 ) - { - system( copy_command_2 ); - } - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/sample_projects_intracellular/fba/cancer_metabolism/main.cpp b/sample_projects_intracellular/fba/cancer_metabolism/main.cpp index 0901f0038..912c88983 100644 --- a/sample_projects_intracellular/fba/cancer_metabolism/main.cpp +++ b/sample_projects_intracellular/fba/cancer_metabolism/main.cpp @@ -87,23 +87,17 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - - // copy config file to output directry - system( copy_command ); // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/unit_tests/custom_DCs_2substrates/main.cpp b/unit_tests/custom_DCs_2substrates/main.cpp index 8df1843ec..821b59c1b 100644 --- a/unit_tests/custom_DCs_2substrates/main.cpp +++ b/unit_tests/custom_DCs_2substrates/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads); diff --git a/unit_tests/custom_voxel_values/main.cpp b/unit_tests/custom_voxel_values/main.cpp index 8df1843ec..821b59c1b 100644 --- a/unit_tests/custom_voxel_values/main.cpp +++ b/unit_tests/custom_voxel_values/main.cpp @@ -87,24 +87,18 @@ int main( int argc, char* argv[] ) { // load and parse settings file(s) - bool XML_status = false; - char copy_command [1024]; + bool XML_status = false; if( argc > 1 ) { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + XML_status = load_PhysiCell_config_file( argv[1] ); } else { XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); } if( !XML_status ) { exit(-1); } - // copy config file to output directry - system( copy_command ); - // OpenMP setup omp_set_num_threads(PhysiCell_settings.omp_num_threads);