Skip to content

Commit

Permalink
- update inner equations for nonlinear systems (fix for #2324)
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16921 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Aug 26, 2013
1 parent 7d177c1 commit 569c48d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Compiler/Template/CodegenC.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2878,6 +2878,10 @@ template equationNonlinear(SimEqSystem eq, Context context, Text &varDecls /*BUF
match eq
case SES_NONLINEAR(__) then
let size = listLength(crefs)
let &tmp = buffer ""
let innerBody = (eqs |> eq2 =>
functionExtraResidualsPreBody(eq2, &varDecls /*BUFD*/, &tmp)
;separator="\n")
let nonlinindx = indexNonLinearSystem
<<
#ifdef _OMC_MEASURE_TIME
Expand All @@ -2897,6 +2901,8 @@ template equationNonlinear(SimEqSystem eq, Context context, Text &varDecls /*BUF
/* write solution */
<%crefs |> name hasindex i0 => '<%cref(name)%> = data->simulationInfo.nonlinearSystemData[<%indexNonLinearSystem%>].nlsx[<%i0%>];' ;separator="\n"%>
<%inlineCrefs(context,crefs)%>
/* update inner equations */
<%innerBody%>
#ifdef _OMC_MEASURE_TIME
SIM_PROF_ACC_EQ(modelInfoXmlGetEquation(&data->modelData.modelDataXml,<%index%>).profileBlockIndex);
#endif<%\n%>
Expand Down

0 comments on commit 569c48d

Please sign in to comment.