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

Commit da97141

Browse files
perostOpenModelica-Hudson
authored andcommitted
Handle record better in lowerArrayEqn.
- Move the case that handles arrays of records to the top in BackendDAECreate.lowerArrayEqn, to avoid array equations involving records being turned into arrays of normal non-complex equations. Belonging to [master]: - #2864
1 parent c8cc40e commit da97141

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Compiler/BackEnd/BackendDAECreate.mo

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,14 +1838,6 @@ algorithm
18381838
DAE.Type tp;
18391839
Integer i;
18401840

1841-
case (_, _, _, _, _, _)
1842-
equation
1843-
true = Expression.isArray(e1) or Expression.isMatrix(e1);
1844-
true = Expression.isArray(e2) or Expression.isMatrix(e2);
1845-
ea1 = Expression.flattenArrayExpToList(e1);
1846-
ea2 = Expression.flattenArrayExpToList(e2);
1847-
then generateEquations(ea1, ea2, source, inEqAttributes, iAcc);
1848-
18491841
// array type with record
18501842
case (_, _, _, _, _, _)
18511843
equation
@@ -1859,6 +1851,14 @@ algorithm
18591851
//i = List.fold(ds, intMul, 1);
18601852
then BackendDAE.ARRAY_EQUATION(ds, e1, e2, source, inEqAttributes)::iAcc;
18611853

1854+
case (_, _, _, _, _, _)
1855+
equation
1856+
true = Expression.isArray(e1) or Expression.isMatrix(e1);
1857+
true = Expression.isArray(e2) or Expression.isMatrix(e2);
1858+
ea1 = Expression.flattenArrayExpToList(e1);
1859+
ea2 = Expression.flattenArrayExpToList(e2);
1860+
then generateEquations(ea1, ea2, source, inEqAttributes, iAcc);
1861+
18621862
case (_, _, _, _, _, _)
18631863
equation
18641864
ds = Expression.dimensionsSizes(dims);

0 commit comments

Comments
 (0)