Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
fix in cpp template for jacobian variables used by algebraic loop
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - #1924
  • Loading branch information
niklwors authored and OpenModelica-Hudson committed Oct 19, 2017
1 parent ed4ccd8 commit baaffec
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Compiler/Template/CodegenCppCommon.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,23 @@ template representationCref(ComponentRef inCref, SimCode simCode ,Text& extraFun
case DAE_RESIDUAL_VAR() then
'__daeResidual[<%i%>]'
case JAC_VAR() then
'_<%getOption(matrixName)%>jac_y(<%i%>)'
match context
case ALGLOOP_CONTEXT(__) then
'_system->_<%getOption(matrixName)%>jac_y(<%i%>)'
else
'_<%getOption(matrixName)%>jac_y(<%i%>)'
case JAC_DIFF_VAR() then
'_<%getOption(matrixName)%>jac_tmp(<%i%>)'
match context
case ALGLOOP_CONTEXT(__) then
'_system->_<%getOption(matrixName)%>jac_tmp(<%i%>)'
else
'_<%getOption(matrixName)%>jac_tmp(<%i%>)'
case SEED_VAR() then
'_<%getOption(matrixName)%>jac_x(<%i%>)'
match context
case ALGLOOP_CONTEXT(__) then
'_system->_<%getOption(matrixName)%>jac_x(<%i%>)'
else
'_<%getOption(matrixName)%>jac_x(<%i%>)'
case VARIABLE() then
match var
case SIMVAR(index=-2) then
Expand Down

0 comments on commit baaffec

Please sign in to comment.