Skip to content

Commit

Permalink
Add clockIndex to Jacobians for clocked partitions, ticket:4237
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke authored and OpenModelica-Hudson committed Jan 29, 2017
1 parent 175a65b commit 4d45d7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -12902,15 +12902,15 @@ template functionJac(list<SimEqSystem> jacEquations, list<SimVar> tmpVars, Strin
match simCode
case SIMCODE(modelInfo = MODELINFO(__)) then
let classname = lastIdentOfPath(modelInfo.name)

let clockIndex = if intGt(listLength(tmpVars), 0) then getClockIndex(listGet(tmpVars, 1), simCode)
let &varDecls = buffer "" /*BUFD*/
let &tmp = buffer ""
let eqns_ = (jacEquations |> eq =>
equation_(eq, contextJacobian, &varDecls /*BUFD*/, /*&tmp*/ simCode, &extraFuncs , &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
;separator="\n")
equation_(eq, contextJacobian, &varDecls, simCode, &extraFuncs, &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
;separator="\n")
<<
void <%classname%>Jacobian::calc<%matrixName%>JacobianColumn()
{
<%if clockIndex then 'const int clockIndex = <%clockIndex%>;'%>
<%varDecls%>
<%eqns_%>
}
Expand Down

0 comments on commit 4d45d7a

Please sign in to comment.