File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
SimulationRuntime/c/simulation/solver/initialization Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -436,7 +436,8 @@ static int initialize(DATA *data, int optiMethod)
436436 {
437437 INFO (LOG_INIT , "no variables to initialize" );
438438 /* call initial_residual to execute algorithms with no counted outputs, for examples external objects as used in modelica3d */
439- initial_residual (data , initData -> initialResiduals );
439+ if (data -> modelData .nInitResiduals == 0 )
440+ initial_residual (data , initData -> initialResiduals );
440441 free (initData );
441442 return 0 ;
442443 }
@@ -447,6 +448,7 @@ static int initialize(DATA *data, int optiMethod)
447448 INFO (LOG_INIT , "no initial residuals (neither initial equations nor initial algorithms)" );
448449 /* call initial_residual to execute algorithms with no counted outputs, for examples external objects as used in modelica3d */
449450 initial_residual (data , initData -> initialResiduals );
451+ free (initData );
450452 return 0 ;
451453 }
452454
You can’t perform that action at this time.
0 commit comments