Skip to content

Commit 3a2795f

Browse files
committed
copy config to output now part of core
1 parent cbf625e commit 3a2795f

File tree

22 files changed

+44
-166
lines changed

22 files changed

+44
-166
lines changed

modules/PhysiCell_settings.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ bool load_PhysiCell_config_file( std::string filename )
102102
if (!read_PhysiCell_config_file( filename ))
103103
{ return false; }
104104

105-
PhysiCell_settings.read_from_pugixml();
105+
PhysiCell_settings.read_from_pugixml();
106106

107-
// now read the microenvironment (optional)
107+
// now read the microenvironment (optional)
108108

109109
if( !setup_microenvironment_from_XML( physicell_config_root ) )
110110
{
@@ -119,7 +119,9 @@ bool load_PhysiCell_config_file( std::string filename )
119119

120120
create_output_directory( PhysiCell_settings.folder );
121121

122-
return true;
122+
copy_file_to_output( filename );
123+
124+
return true;
123125
}
124126

125127
PhysiCell_Settings::PhysiCell_Settings()

sample_projects/asymmetric_division/main.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,18 @@ int main( int argc, char* argv[] )
8787
{
8888
// load and parse settings file(s)
8989

90-
bool XML_status = false;
91-
char copy_command [1024];
90+
bool XML_status = false;
9291
if( argc > 1 )
9392
{
94-
XML_status = load_PhysiCell_config_file( argv[1] );
95-
sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() );
93+
XML_status = load_PhysiCell_config_file( argv[1] );
9694
}
9795
else
9896
{
9997
XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" );
100-
sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() );
10198
}
10299
if( !XML_status )
103100
{ exit(-1); }
104101

105-
// copy config file to output directry
106-
system( copy_command );
107-
108102
// OpenMP setup
109103
omp_set_num_threads(PhysiCell_settings.omp_num_threads);
110104

sample_projects/biorobots/main.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,18 @@ int main( int argc, char* argv[] )
8787
{
8888
// load and parse settings file(s)
8989

90-
bool XML_status = false;
91-
char copy_command [1024];
90+
bool XML_status = false;
9291
if( argc > 1 )
9392
{
94-
XML_status = load_PhysiCell_config_file( argv[1] );
95-
sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() );
93+
XML_status = load_PhysiCell_config_file( argv[1] );
9694
}
9795
else
9896
{
9997
XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" );
100-
sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() );
10198
}
10299
if( !XML_status )
103100
{ exit(-1); }
104101

105-
// copy config file to output directry
106-
system( copy_command );
107-
108102
// OpenMP setup
109103
omp_set_num_threads(PhysiCell_settings.omp_num_threads);
110104

sample_projects/cancer_biorobots/main.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,18 @@ int main( int argc, char* argv[] )
8787
{
8888
// load and parse settings file(s)
8989

90-
bool XML_status = false;
91-
char copy_command [1024];
90+
bool XML_status = false;
9291
if( argc > 1 )
9392
{
94-
XML_status = load_PhysiCell_config_file( argv[1] );
95-
sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() );
93+
XML_status = load_PhysiCell_config_file( argv[1] );
9694
}
9795
else
9896
{
9997
XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" );
100-
sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() );
10198
}
10299
if( !XML_status )
103100
{ exit(-1); }
104101

105-
// copy config file to output directry
106-
system( copy_command );
107-
108102
// OpenMP setup
109103
omp_set_num_threads(PhysiCell_settings.omp_num_threads);
110104

sample_projects/custom_division/main.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,18 @@ int main( int argc, char* argv[] )
8787
{
8888
// load and parse settings file(s)
8989

90-
bool XML_status = false;
91-
char copy_command [1024];
90+
bool XML_status = false;
9291
if( argc > 1 )
9392
{
94-
XML_status = load_PhysiCell_config_file( argv[1] );
95-
sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() );
93+
XML_status = load_PhysiCell_config_file( argv[1] );
9694
}
9795
else
9896
{
9997
XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" );
100-
sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() );
10198
}
10299
if( !XML_status )
103100
{ exit(-1); }
104101

105-
// copy config file to output directry
106-
system( copy_command );
107-
108102
// OpenMP setup
109103
omp_set_num_threads(PhysiCell_settings.omp_num_threads);
110104

sample_projects/heterogeneity/main.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,18 @@ int main( int argc, char* argv[] )
8787
{
8888
// load and parse settings file(s)
8989

90-
bool XML_status = false;
91-
char copy_command [1024];
90+
bool XML_status = false;
9291
if( argc > 1 )
9392
{
94-
XML_status = load_PhysiCell_config_file( argv[1] );
95-
sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() );
93+
XML_status = load_PhysiCell_config_file( argv[1] );
9694
}
9795
else
9896
{
9997
XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" );
100-
sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() );
10198
}
10299
if( !XML_status )
103100
{ exit(-1); }
104101

105-
// copy config file to output directry
106-
system( copy_command );
107-
108102
// OpenMP setup
109103
omp_set_num_threads(PhysiCell_settings.omp_num_threads);
110104

sample_projects/immune_function/main.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,18 @@ int main( int argc, char* argv[] )
8787
{
8888
// load and parse settings file(s)
8989

90-
bool XML_status = false;
91-
char copy_command [1024];
90+
bool XML_status = false;
9291
if( argc > 1 )
9392
{
94-
XML_status = load_PhysiCell_config_file( argv[1] );
95-
sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() );
93+
XML_status = load_PhysiCell_config_file( argv[1] );
9694
}
9795
else
9896
{
9997
XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" );
100-
sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() );
10198
}
10299
if( !XML_status )
103100
{ exit(-1); }
104101

105-
// copy config file to output directry
106-
system( copy_command );
107-
108102
// OpenMP setup
109103
omp_set_num_threads(PhysiCell_settings.omp_num_threads);
110104

sample_projects/interactions/main.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,18 @@ int main( int argc, char* argv[] )
8787
{
8888
// load and parse settings file(s)
8989

90-
bool XML_status = false;
91-
char copy_command [1024];
90+
bool XML_status = false;
9291
if( argc > 1 )
9392
{
94-
XML_status = load_PhysiCell_config_file( argv[1] );
95-
sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() );
93+
XML_status = load_PhysiCell_config_file( argv[1] );
9694
}
9795
else
9896
{
9997
XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" );
100-
sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() );
10198
}
10299
if( !XML_status )
103100
{ exit(-1); }
104101

105-
// copy config file to output directry
106-
system( copy_command );
107-
108102
// OpenMP setup
109103
omp_set_num_threads(PhysiCell_settings.omp_num_threads);
110104

sample_projects/mechano/main.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,18 @@ int main( int argc, char* argv[] )
8787
{
8888
// load and parse settings file(s)
8989

90-
bool XML_status = false;
91-
char copy_command [1024];
90+
bool XML_status = false;
9291
if( argc > 1 )
9392
{
94-
XML_status = load_PhysiCell_config_file( argv[1] );
95-
sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() );
93+
XML_status = load_PhysiCell_config_file( argv[1] );
9694
}
9795
else
9896
{
9997
XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" );
100-
sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() );
10198
}
10299
if( !XML_status )
103100
{ exit(-1); }
104101

105-
// copy config file to output directry
106-
system( copy_command );
107-
108102
// OpenMP setup
109103
omp_set_num_threads(PhysiCell_settings.omp_num_threads);
110104

sample_projects/physimess/main.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,18 @@ int main( int argc, char* argv[] )
8787
{
8888
// load and parse settings file(s)
8989

90-
bool XML_status = false;
91-
char copy_command [1024];
90+
bool XML_status = false;
9291
if( argc > 1 )
9392
{
94-
XML_status = load_PhysiCell_config_file( argv[1] );
95-
sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() );
93+
XML_status = load_PhysiCell_config_file( argv[1] );
9694
}
9795
else
9896
{
9997
XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" );
100-
sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() );
10198
}
10299
if( !XML_status )
103100
{ exit(-1); }
104101

105-
// copy config file to output directry
106-
system( copy_command );
107-
108102
// OpenMP setup
109103
omp_set_num_threads(PhysiCell_settings.omp_num_threads);
110104

0 commit comments

Comments
 (0)