Skip to content

Commit 569c48d

Browse files
committed
- update inner equations for nonlinear systems (fix for #2324)
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16921 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 7d177c1 commit 569c48d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Compiler/Template/CodegenC.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,6 +2878,10 @@ template equationNonlinear(SimEqSystem eq, Context context, Text &varDecls /*BUF
28782878
match eq
28792879
case SES_NONLINEAR(__) then
28802880
let size = listLength(crefs)
2881+
let &tmp = buffer ""
2882+
let innerBody = (eqs |> eq2 =>
2883+
functionExtraResidualsPreBody(eq2, &varDecls /*BUFD*/, &tmp)
2884+
;separator="\n")
28812885
let nonlinindx = indexNonLinearSystem
28822886
<<
28832887
#ifdef _OMC_MEASURE_TIME
@@ -2897,6 +2901,8 @@ template equationNonlinear(SimEqSystem eq, Context context, Text &varDecls /*BUF
28972901
/* write solution */
28982902
<%crefs |> name hasindex i0 => '<%cref(name)%> = data->simulationInfo.nonlinearSystemData[<%indexNonLinearSystem%>].nlsx[<%i0%>];' ;separator="\n"%>
28992903
<%inlineCrefs(context,crefs)%>
2904+
/* update inner equations */
2905+
<%innerBody%>
29002906
#ifdef _OMC_MEASURE_TIME
29012907
SIM_PROF_ACC_EQ(modelInfoXmlGetEquation(&data->modelData.modelDataXml,<%index%>).profileBlockIndex);
29022908
#endif<%\n%>

0 commit comments

Comments
 (0)