Skip to content

Commit b671be5

Browse files
committed
- Added crefs to linear systems in the simulation info (same as for non-linear systems)
- Added system sizes to the description of linear and non-linear systems git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11498 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 51a7088 commit b671be5

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Compiler/BackEnd/SimCode.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12118,7 +12118,7 @@ end matchcontinue;
1211812118
end replaceindex1;
1211912119

1212012120

12121-
protected function varName
12121+
public function varName
1212212122
input SimVar var;
1212312123
output DAE.ComponentRef name;
1212412124
algorithm

Compiler/susan_codegen/SimCode/CodegenC.tpl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6801,11 +6801,14 @@ template equationInfo(list<SimEqSystem> eqs)
68016801
'"SES_ARRAY_CALL_ASSIGN <%i0%>",0,NULL'
68026802
case SES_ALGORITHM(__) then '"SES_ALGORITHM <%i0%>", 0, NULL'
68036803
case SES_WHEN(__) then '"SES_WHEN <%i0%>", 0, NULL'
6804-
case SES_LINEAR(__) then '"LINEAR<%index%>", 0, NULL'
6804+
case SES_LINEAR(__) then
6805+
let &preBuf += 'const VAR_INFO** linearSystem<%index%>_crefs = (const VAR_INFO**)malloc(<%listLength(vars)%>*sizeof(VAR_INFO*));<%\n%>'
6806+
let &preBuf += '<%vars|>var hasindex i0 => 'linearSystem<%index%>_crefs[<%i0%>] = &<%cref(varName(var))%>__varInfo;'; separator="\n"%>;'
6807+
'"linear system <%index%> (size <%listLength(vars)%>)", <%listLength(vars)%>, linearSystem<%index%>_crefs'
68056808
case SES_NONLINEAR(__) then
68066809
let &preBuf += 'const VAR_INFO** residualFunc<%index%>_crefs = (const VAR_INFO**)malloc(<%listLength(crefs)%>*sizeof(VAR_INFO*));<%\n%>'
68076810
let &preBuf += '<%crefs|>cr hasindex i0 => 'residualFunc<%index%>_crefs[<%i0%>] = &<%cref(cr)%>__varInfo;'; separator="\n"%>;'
6808-
'"residualFunc<%index%>", <%listLength(crefs)%>, residualFunc<%index%>_crefs'
6811+
'"residualFunc<%index%> (size <%listLength(crefs)%>)", <%listLength(crefs)%>, residualFunc<%index%>_crefs'
68096812
case SES_MIXED(__) then '"MIXED<%index%>", 0, NULL'
68106813
else '"unknown equation <%i0%>",0,NULL'%>}
68116814
>> ; separator=",\n"%>

Compiler/susan_codegen/SimCode/SimCodeTV.mo

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,11 @@ package SimCode
579579
output Absyn.Info info;
580580
end eqInfo;
581581

582+
function varName
583+
input SimVar var;
584+
output DAE.ComponentRef cr;
585+
end varName;
586+
582587
end SimCode;
583588

584589

0 commit comments

Comments
 (0)