For example, assuming that the names for the new *.run and *.prf files are specified in the variables RunFileName2
and RuntimeControls2
, the following code snippet shows how to re-solve the same problem object pointed to by P:
SPARK::TRuntimeControls RuntimeControls2( "Runtime controls #2", // name of controls set RunFileName2 // *.run file name ); SPARK::TPreferenceSettings PreferenceSettings2( PrfFileName2 ); P->Initialize( RuntimeControls2 ); P->LoadPreferenceSettings( PreferenceSettings2 ); if ( P->Simulate() != SPARK::TProblem::SimulatorState_OK ) { SPARK::ExitWithError( SPARK::ExitCode_ERROR_NUMERICAL, __FILE__, "Abort simulation.", P // Specifiy active problem to ensure proper diagnostic ); } P->Terminate();