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

Commit 056a0fa

Browse files
rfrankeOpenModelica-Hudson
authored andcommitted
Set index of clocked partition for FMI Jacobian
There may be multiple indices. Use the max index for now, resulting in 0 for continuous models. Belonging to [master]: - #2281
1 parent de26b55 commit 056a0fa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Compiler/SimCode/SimCodeUtil.mo

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12805,7 +12805,8 @@ algorithm
1280512805
// collect algebraic loops and symjacs for FMIDer
1280612806
({contSimJac}, outModelInfo, symJacs) := addAlgebraicLoopsModelInfoSymJacs({contSimJac}, inModelInfo);
1280712807
contPartSimDer := SOME(contSimJac);
12808-
symJacFMI := {contSimJac};
12808+
// set partition index to number of clocks (max index) for now
12809+
symJacFMI := {rewriteJacPartIdx(contSimJac, inModelInfo.nSubClocks)};
1280912810
else
1281012811
contPartSimDer := NONE();
1281112812
end if;

Compiler/Template/CodegenCpp.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12972,7 +12972,7 @@ template functionJac(list<SimEqSystem> jacEquations, String matrixName, Integer
1297212972
<<
1297312973
void <%classname%>Jacobian::calc<%matrixName%>JacobianColumn()
1297412974
{
12975-
const int clockIndex = <%partIdx%>;
12975+
<%if intGt(partIdx, 0) then 'const int clockIndex = <%partIdx%>;'%>
1297612976
<%varDecls%>
1297712977
<%eqns_%>
1297812978
}

0 commit comments

Comments
 (0)