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

Commit 8b160f9

Browse files
rfrankeOpenModelica-Hudson
authored andcommitted
Let simple array equations pass the backend, ticket:5110
if -d=-nfScalarize - adapt equation count - turn error from strongComponentsScalar to warning Belonging to [master]: - #2679
1 parent cc4c1bf commit 8b160f9

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Compiler/BackEnd/BackendDAETransform.mo

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,13 @@ algorithm
104104
then (syst, comps);
105105

106106
else algorithm
107-
Error.addInternalError("function strongComponentsScalar failed (sorting strong components)", sourceInfo());
108-
then fail();
107+
if Flags.isSet(Flags.NF_SCALARIZE) then
108+
Error.addInternalError("function strongComponentsScalar failed (sorting strong components)", sourceInfo());
109+
fail();
110+
else
111+
Error.addCompilerWarning("BackendDAETransform.strongComponentsScalar failed (sorting strong components)");
112+
end if;
113+
then (inSystem, {});
109114
end matchcontinue;
110115
end strongComponentsScalar;
111116

Compiler/BackEnd/BackendEquation.mo

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,17 @@ public function equationArraySize "author: lochel
188188
should correspond to the number of variables."
189189
input BackendDAE.EquationArray equationArray;
190190
output Integer outSize;
191+
protected
192+
Boolean nfScalarize = Flags.isSet(Flags.NF_SCALARIZE);
191193
algorithm
192194
outSize := 0;
193195
for i in 1:ExpandableArray.getLastUsedIndex(equationArray) loop
194196
if ExpandableArray.occupied(i, equationArray) then
195-
outSize := outSize + equationSize(ExpandableArray.get(i, equationArray));
197+
if nfScalarize then
198+
outSize := outSize + equationSize(ExpandableArray.get(i, equationArray));
199+
else
200+
outSize := outSize + 1;
201+
end if;
196202
end if;
197203
end for;
198204
end equationArraySize;

0 commit comments

Comments
 (0)