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

Commit d7274ca

Browse files
rfrankeOpenModelica-Hudson
authored andcommitted
[NF] Keep vectors in connect equations
Belonging to [master]: - #2712
1 parent 0dbda2b commit d7274ca

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Compiler/NFFrontEnd/NFConnections.mo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ public
144144
Boolean expanded;
145145
algorithm
146146
cr := ComponentRef.evaluateSubscripts(cref);
147+
148+
if not Flags.isSet(Flags.NF_SCALARIZE) then
149+
connectors := {Connector.fromCref(cr, ComponentRef.getSubscriptedType(cr), source)};
150+
return;
151+
end if;
152+
147153
cref_exp := Expression.CREF(ComponentRef.getSubscriptedType(cr), cr);
148154
(cref_exp, expanded) := ExpandExp.expand(cref_exp);
149155

Compiler/NFFrontEnd/NFConnector.mo

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,14 @@ protected
230230

231231
case Type.ARRAY()
232232
algorithm
233-
t := Type.arrayElementType(ty);
234-
for c in ComponentRef.scalarize(name) loop
235-
conns := splitImpl(c, t, face, source, cty, conns);
236-
end for;
233+
if Flags.isSet(Flags.NF_SCALARIZE) then
234+
t := Type.arrayElementType(ty);
235+
for c in ComponentRef.scalarize(name) loop
236+
conns := splitImpl(c, t, face, source, cty, conns);
237+
end for;
238+
else
239+
conns := CONNECTOR(name, ty, face, cty, source) :: conns;
240+
end if;
237241
then
238242
conns;
239243

0 commit comments

Comments
 (0)