Skip to content

Commit 4f66de9

Browse files
ptaeuberOpenModelica-Hudson
authored andcommitted
Only reassign start value if it has been overwritten
1 parent ae9b4cf commit 4f66de9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Compiler/Template/CodegenC.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2946,6 +2946,7 @@ template functionUpdateBoundVariableAttributes(SimCode simCode, list<SimEqSystem
29462946
<<
29472947
<%crefAttributes(cref)%>.min = <%cref(cref)%>;
29482948
infoStreamPrint(LOG_INIT, 0, "%s(min=<%crefToPrintfArg(cref)%>)", <%crefVarInfo(cref)%>.name, (<%crefType(cref)%>) <%crefAttributes(cref)%>.min);
2949+
<%cref(cref)%> = <%crefAttributes(cref)%>.start;
29492950
>>
29502951
;separator="\n"
29512952
%>
@@ -2959,6 +2960,7 @@ template functionUpdateBoundVariableAttributes(SimCode simCode, list<SimEqSystem
29592960
<<
29602961
<%crefAttributes(cref)%>.max = <%cref(cref)%>;
29612962
infoStreamPrint(LOG_INIT, 0, "%s(max=<%crefToPrintfArg(cref)%>)", <%crefVarInfo(cref)%>.name, (<%crefType(cref)%>) <%crefAttributes(cref)%>.max);
2963+
<%cref(cref)%> = <%crefAttributes(cref)%>.start;
29622964
>>
29632965
;separator="\n"
29642966
%>
@@ -2972,6 +2974,7 @@ template functionUpdateBoundVariableAttributes(SimCode simCode, list<SimEqSystem
29722974
<<
29732975
<%crefAttributes(cref)%>.nominal = <%cref(cref)%>;
29742976
infoStreamPrint(LOG_INIT, 0, "%s(nominal=<%crefToPrintfArg(cref)%>)", <%crefVarInfo(cref)%>.name, (<%crefType(cref)%>) <%crefAttributes(cref)%>.nominal);
2977+
<%cref(cref)%> = <%crefAttributes(cref)%>.start;
29752978
>>
29762979
;separator="\n"
29772980
%>

SimulationRuntime/c/simulation/solver/initialization/initialization.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,6 @@ int initialization(DATA *data, threadData_t *threadData, const char* pInitMethod
574574
if(!(pInitFile && strcmp(pInitFile, ""))) {
575575
data->callback->updateBoundParameters(data, threadData);
576576
data->callback->updateBoundVariableAttributes(data, threadData);
577-
setAllVarsToStart(data);
578577
}
579578

580579
/* update static data of linear/non-linear system solvers */

0 commit comments

Comments
 (0)